Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ public class AbfsConfiguration{
DefaultValue = DEFAULT_FS_AZURE_ACCOUNT_IS_HNS_ENABLED)
private String isNamespaceEnabledAccount;

@BooleanConfigurationValidatorAnnotation(ConfigurationKey = FS_AZURE_ACCOUNT_IS_POSIX_ACL_SUPPORTED,
DefaultValue = true)
private boolean isPosixAclSupported;

@BooleanConfigurationValidatorAnnotation(ConfigurationKey = FS_AZURE_ENABLE_DFSTOBLOB_FALLBACK,
DefaultValue = DEFAULT_FS_AZURE_ENABLE_DFSTOBLOB_FALLBACK)
private boolean isDfsToBlobFallbackEnabled;
Expand Down Expand Up @@ -742,7 +746,7 @@ public AbfsServiceType getFsConfiguredServiceTypeFromUrl() {
* @return the service type.
*/
public AbfsServiceType getConfiguredServiceTypeForFNSAccounts() {
return getCaseInsensitiveEnum(FS_AZURE_FNS_ACCOUNT_SERVICE_TYPE, null);
return getCaseInsensitiveEnum(FS_AZURE_FNS_ACCOUNT_SERVICE_TYPE, getFsConfiguredServiceType());
}

/**
Expand All @@ -763,6 +767,10 @@ public boolean isDfsToBlobFallbackEnabled() {
return isDfsToBlobFallbackEnabled;
}

public boolean isPosixAclSupported() {
return isPosixAclSupported;
}

/**
* Checks if the service type configured is valid for account type used.
* HNS Enabled accounts cannot have service type as BLOB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public OutputStream createFile(final Path path,
if (triggerConditionalCreateOverwrite) {
op = conditionalCreateOverwriteFile(relativePath,
statistics,
new Permissions(isNamespaceEnabled, permission, umask),
new Permissions(isNamespaceEnabled && abfsConfiguration.isPosixAclSupported(), permission, umask),
isAppendBlob,
contextEncryptionAdapter,
tracingContext
Expand All @@ -719,7 +719,7 @@ public OutputStream createFile(final Path path,
} else {
op = createClient.createPath(relativePath, true,
overwrite,
new Permissions(isNamespaceEnabled, permission, umask),
new Permissions(isNamespaceEnabled && abfsConfiguration.isPosixAclSupported(), permission, umask),
isAppendBlob,
null,
contextEncryptionAdapter,
Expand Down Expand Up @@ -852,8 +852,8 @@ public void createDirectory(final Path path, final FsPermission permission,

boolean overwrite =
!isNamespaceEnabled || abfsConfiguration.isEnabledMkdirOverwrite();
Permissions permissions = new Permissions(isNamespaceEnabled,
permission, umask);
Permissions permissions = new Permissions(
isNamespaceEnabled && abfsConfiguration.isPosixAclSupported(), permission, umask);
final AbfsRestOperation op = createClient.createPath(getRelativePath(path),
false, overwrite, permissions, false, null, null, tracingContext);
perfInfo.registerResult(op.getResult()).registerSuccess(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public final class ConfigurationKeys {
*/
public static final String FS_AZURE_ACCOUNT_IS_HNS_ENABLED = "fs.azure.account.hns.enabled";

/**
* Config to indicate whether the account supports POSIX ACLs (x-ms-permissions, x-ms-umask).
* Defaults to true. Set to false for HNS accounts that have POSIX ACL support disabled —
* suppresses POSIX headers without changing the service endpoint routing.
*/
public static final String FS_AZURE_ACCOUNT_IS_POSIX_ACL_SUPPORTED =
"fs.azure.account.posix.acls.supported";

/**
* Config to specify which {@link AbfsServiceType} to use with HNS-Disabled Account type.
* Default value will be identified from URL used to initialize filesystem.
Expand Down