From da39fbf24a6a967ad77c2de99408cbf4353dc9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 19 Dec 2018 16:01:53 +0100 Subject: [PATCH] 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(). --- src/lowntfs-3g.c | 2 +- src/ntfs-3g.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index 0660439b..b553838b 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -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; diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 4e0912ae..1631a224 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -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;