From 6d484cd842b085692236a23eb89355991a4e938f Mon Sep 17 00:00:00 2001 From: jpandre Date: Wed, 27 Aug 2008 10:42:22 +0000 Subject: [PATCH] Made ACL requests to always return unsupported when ACLs are disabled --- src/ntfs-3g.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 3a9f2c1e..7929b84c 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -1850,14 +1850,15 @@ static int ntfs_fuse_getxattr(const char *path, const char *name, if (ntfs_fuse_is_named_data_stream(path)) return -EINVAL; /* n/a for named data streams. */ - - /* JPA return unsupported if no user mapping has been defined */ - if (!ntfs_fuse_fill_security_context(&security)) { - if (ctx->silent) - res = 0; - else - res = -EOPNOTSUPP; - + /* + * return unsupported if ACL were disabled + * or no user mapping has been defined + * However no error will be returned to getfacl + */ + if ((ctx->secure_flags + & ((1 << SECURITY_DEFAULT) | (1 << SECURITY_RAW))) + || !ntfs_fuse_fill_security_context(&security)) { + res = -EOPNOTSUPP; } else { ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni) @@ -1927,14 +1928,14 @@ static int ntfs_fuse_setxattr(const char *path, const char *name, if (ntfs_fuse_is_named_data_stream(path)) return -EINVAL; /* n/a for named data streams. */ - - /* JPA return unsupported if no user mapping has been defined */ - if (!ntfs_fuse_fill_security_context(&security)) { - if (ctx->silent) - res = 0; - else - res = -EOPNOTSUPP; - + /* + * return unsupported if ACL were disabled + * or no user mapping has been defined + */ + if ((ctx->secure_flags + & ((1 << SECURITY_DEFAULT) | (1 << SECURITY_RAW))) + || !ntfs_fuse_fill_security_context(&security)) { + res = -EOPNOTSUPP; } else { ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni) @@ -2012,14 +2013,14 @@ static int ntfs_fuse_removexattr(const char *path, const char *name) if (ntfs_fuse_is_named_data_stream(path)) return -EINVAL; /* n/a for named data streams. */ - - /* JPA return unsupported if no user mapping has been defined */ - if (!ntfs_fuse_fill_security_context(&security)) { - if (ctx->silent) - res = 0; - else - res = -EOPNOTSUPP; - + /* + * return unsupported if ACL were disabled + * or no user mapping has been defined. + */ + if ((ctx->secure_flags + & ((1 << SECURITY_DEFAULT) | (1 << SECURITY_RAW))) + || !ntfs_fuse_fill_security_context(&security)) { + res = -EOPNOTSUPP; } else { ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni)