diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index 078a0f73..818a4380 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -2826,6 +2826,8 @@ int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, /* * Remove a default Posix ACL from a file + * + * Returns 0, or -1 if there is a problem which errno describes */ int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 976df15d..a5adb423 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -1909,7 +1909,11 @@ static int ntfs_fuse_getxattr(const char *path, const char *name, #if POSIXACLS struct SECURITY_CONTEXT security; - /* hijack Posix/NTFS ACL retrieval */ + /* + * hijack Posix/NTFS ACL retrieval, whatever mode + * was selected for xattr (from the user's point + * of view, ACLs are not xattr) + */ if ((!strcmp(name,nf_ns_xattr_posix_access) || !strcmp(name,nf_ns_xattr_posix_default) || !strcmp(name,nf_ns_xattr_ntfs))) { @@ -1984,7 +1988,12 @@ static int ntfs_fuse_setxattr(const char *path, const char *name, #if POSIXACLS struct SECURITY_CONTEXT security; - /* hijack Posix/NTFS ACL setting */ + /* + * hijack Posix/NTFS ACL retrieval, whatever mode + * was selected for xattr (from the user's point + * of view, ACLs are not xattr) + * Note : updating an ACL does not set ctime + */ if (!strcmp(name,nf_ns_xattr_posix_access) || !strcmp(name,nf_ns_xattr_posix_default) || !strcmp(name,nf_ns_xattr_ntfs)) { @@ -2077,7 +2086,12 @@ static int ntfs_fuse_removexattr(const char *path, const char *name) #if POSIXACLS struct SECURITY_CONTEXT security; - /* hijack Posix/NTFS ACL removal */ + /* + * hijack Posix/NTFS ACL retrieval, whatever mode + * was selected for xattr (from the user's point + * of view, ACLs are not xattr) + * Note : updating an ACL does not set ctime + */ if (!strcmp(name,nf_ns_xattr_posix_access) || !strcmp(name,nf_ns_xattr_posix_default) || !strcmp(name,nf_ns_xattr_ntfs)) { @@ -2089,8 +2103,9 @@ static int ntfs_fuse_removexattr(const char *path, const char *name) else { ni = ntfs_check_access_xattr(path,&security); if (ni) { - res = ntfs_remove_posix_acl(&security,path, - name,ni); + if (ntfs_remove_posix_acl(&security,path, + name,ni)) + res = -errno; if (ntfs_inode_close(ni)) set_fuse_error(&res); } else