diff options
-rw-r--r-- | source3/configure.in | 1 | ||||
-rw-r--r-- | source3/modules/vfs_posixacl.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index b938812812..718baed302 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5303,6 +5303,7 @@ AC_ARG_WITH(acl-support, AC_MSG_RESULT(Using FreeBSD posix ACLs) AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available]) AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) + default_static_modules="$default_static_modules vfs_posixacl" ;; *linux*) AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"]) diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c index 191c4a7cb0..109c1e20b2 100644 --- a/source3/modules/vfs_posixacl.c +++ b/source3/modules/vfs_posixacl.c @@ -200,9 +200,15 @@ static BOOL smb_ace_to_internal(acl_entry_t posix_ace, return False; } ace->a_perm = 0; +#ifdef HAVE_ACL_GET_PERM_NP + ace->a_perm |= (acl_get_perm_np(permset, ACL_READ) ? SMB_ACL_READ : 0); + ace->a_perm |= (acl_get_perm_np(permset, ACL_WRITE) ? SMB_ACL_WRITE : 0); + ace->a_perm |= (acl_get_perm_np(permset, ACL_EXECUTE) ? SMB_ACL_EXECUTE : 0); +#else ace->a_perm |= (acl_get_perm(permset, ACL_READ) ? SMB_ACL_READ : 0); ace->a_perm |= (acl_get_perm(permset, ACL_WRITE) ? SMB_ACL_WRITE : 0); ace->a_perm |= (acl_get_perm(permset, ACL_EXECUTE) ? SMB_ACL_EXECUTE : 0); +#endif return True; } |