s3-smbd: Call sys_acl_set_permset() directly rather than via the VFS
authorAndrew Bartlett <abartlet@samba.org>
Mon, 13 Aug 2012 10:00:21 +0000 (20:00 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2012 01:44:49 +0000 (11:44 +1000)
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett

source3/smbd/posix_acls.c

index 9e61706126e0697d46d69d6b5e2ad6f3e35be81a..a6982ec1099dbcd5213137a23fc4df3ff1ed3cc4 100644 (file)
@@ -2953,7 +2953,7 @@ static bool set_canon_ace_list(files_struct *fsp,
                 * ..and apply them to the entry.
                 */
 
-               if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, the_entry, the_permset) == -1) {
+               if (sys_acl_set_permset(the_entry, the_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to add permset on entry %d. (%s)\n",
                                i, strerror(errno) ));
                        goto fail;
@@ -2985,7 +2985,7 @@ static bool set_canon_ace_list(files_struct *fsp,
                        goto fail;
                }
 
-               if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, mask_entry, mask_permset) == -1) {
+               if (sys_acl_set_permset(mask_entry, mask_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to add mask permset. (%s)\n", strerror(errno) ));
                        goto fail;
                }
@@ -4354,7 +4354,7 @@ static int chmod_acl_internals( connection_struct *conn, SMB_ACL_T posix_acl, mo
                if (map_acl_perms_to_permset(conn, perms, &permset) == -1)
                        return -1;
 
-               if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) == -1)
+               if (sys_acl_set_permset(entry, permset) == -1)
                        return -1;
        }
 
@@ -4579,7 +4579,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, uint16 num_
                }
 
                /* Now apply to the new ACL entry. */
-               if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, the_entry, the_permset) == -1) {
+               if (sys_acl_set_permset(the_entry, the_permset) == -1) {
                        DEBUG(0,("create_posix_acl_from_wire: Failed to add permset on entry %u. (%s)\n",
                                i, strerror(errno) ));
                        goto fail;
@@ -4757,17 +4757,17 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
                }
 
                if (tagtype == SMB_ACL_USER_OBJ) {
-                       if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, user_ent, permset) == -1) {
+                       if (sys_acl_set_permset(user_ent, permset) == -1) {
                                DEBUG(5,("remove_posix_acl: failed to set permset from ACL on file %s (%s).\n",
                                        fname, strerror(errno) ));
                        }
                } else if (tagtype == SMB_ACL_GROUP_OBJ) {
-                       if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, group_ent, permset) == -1) {
+                       if (sys_acl_set_permset(group_ent, permset) == -1) {
                                DEBUG(5,("remove_posix_acl: failed to set permset from ACL on file %s (%s).\n",
                                        fname, strerror(errno) ));
                        }
                } else if (tagtype == SMB_ACL_OTHER) {
-                       if (SMB_VFS_SYS_ACL_SET_PERMSET(conn, other_ent, permset) == -1) {
+                       if (sys_acl_set_permset(other_ent, permset) == -1) {
                                DEBUG(5,("remove_posix_acl: failed to set permset from ACL on file %s (%s).\n",
                                        fname, strerror(errno) ));
                        }