Fixed reporting an error when setxattr is rejected

When permissions are enabled and setxattr() is rejected, an error
must be returned even though the option silent is set. This is needed
for "cp -p" to know it has to try setting the permissions again and use
chmod().
This commit is contained in:
Jean-Pierre André 2018-12-19 16:01:53 +01:00
parent 85c1634a26
commit da39fbf24a
2 changed files with 2 additions and 2 deletions

View File

@ -3152,7 +3152,7 @@ static ntfs_inode *ntfs_check_access_xattr(fuse_req_t req,
|| !(ctx->secure_flags & (1 << SECURITY_ACL))
|| (setting && ctx->inherit))
&& foracl) {
if (ctx->silent)
if (ctx->silent && !ctx->security.mapping[MAPUSERS])
errno = 0;
else
errno = EOPNOTSUPP;

View File

@ -2879,7 +2879,7 @@ static ntfs_inode *ntfs_check_access_xattr(struct SECURITY_CONTEXT *security,
|| !(ctx->secure_flags & (1 << SECURITY_ACL))
|| (setting && ctx->inherit))
&& foracl) {
if (ctx->silent)
if (ctx->silent && !ctx->security.mapping[MAPUSERS])
errno = 0;
else
errno = EOPNOTSUPP;