diff --git a/include/ntfs-3g/security.h b/include/ntfs-3g/security.h index e6161b34..c927c0f5 100644 --- a/include/ntfs-3g/security.h +++ b/include/ntfs-3g/security.h @@ -282,6 +282,8 @@ int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, ntfs_inode *ni); int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, const char *name, ntfs_inode *ni); +#endif + int ntfs_get_ntfs_acl(struct SECURITY_CONTEXT *scx, const char *path, const char *name, char *value, size_t size, ntfs_inode *ni); @@ -289,9 +291,6 @@ int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, const char *path, const char *name, const char *value, size_t size, ntfs_inode *ni); -#endif - - /* * Security API for direct access to security descriptors * based on Win32 API diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index 1e5d6a2d..33cd53cc 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -2128,6 +2128,8 @@ int ntfs_get_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, return (outsize ? (int)outsize : -errno); } +#endif /* POSIXACLS */ + /* * Get an NTFS ACL * @@ -2155,8 +2157,6 @@ int ntfs_get_ntfs_acl(struct SECURITY_CONTEXT *scx, const char *path, return (outsize ? (int)outsize : -errno); } -#endif /* POSIXACLS */ - /* * Get owner, group and permissions in an stat structure * returns permissions, or -1 if there is a problem @@ -2849,6 +2849,8 @@ int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, const char *path, (const char*)NULL, 0, ni)); } +#endif + /* * Set a new NTFS ACL to a file * @@ -2867,7 +2869,11 @@ int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, if ((size > 0) && ntfs_valid_descr(value,size) && (ntfs_attr_size(value) == size)) { +#if POSIXACLS if (ntfs_allowed_as_owner(scx,path,ni)) { +#else + { /* relying on fuse for access control */ +#endif /* need copying in order to write */ attr = (char*)ntfs_malloc(size); if (attr) { @@ -2908,9 +2914,6 @@ int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, return (res ? -1 : 0); } -#endif - - /* * Set new permissions to a file * Checks user mapping has been defined before request for setting