Fix VFS layer:
[samba.git] / source3 / smbd / posix_acls.c
index a38acc437d99c9608f2782ede2c9dc81f05864f0..34c33af473d7991c365df0ce8ddd381f245d736d 100644 (file)
@@ -158,9 +158,9 @@ static mode_t convert_permset_to_mode_t(connection_struct *conn, SMB_ACL_PERMSET
 {
        mode_t ret = 0;
 
-       ret |= (conn->vfs_ops.sys_acl_get_perm(conn, permset, SMB_ACL_READ) ? S_IRUSR : 0);
-       ret |= (conn->vfs_ops.sys_acl_get_perm(conn, permset, SMB_ACL_WRITE) ? S_IWUSR : 0);
-       ret |= (conn->vfs_ops.sys_acl_get_perm(conn, permset, SMB_ACL_EXECUTE) ? S_IXUSR : 0);
+       ret |= (VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_READ) ? S_IRUSR : 0);
+       ret |= (VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_WRITE) ? S_IWUSR : 0);
+       ret |= (VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_EXECUTE) ? S_IXUSR : 0);
 
        return ret;
 }
@@ -190,18 +190,18 @@ static mode_t unix_perms_to_acl_perms(mode_t mode, int r_mask, int w_mask, int x
 
 static int map_acl_perms_to_permset(connection_struct *conn, mode_t mode, SMB_ACL_PERMSET_T *p_permset)
 {
-       if (conn->vfs_ops.sys_acl_clear_perms(conn, *p_permset) ==  -1)
+       if (VFS_SYS_ACL_CLEAR_PERMS(conn, *p_permset) ==  -1)
                return -1;
        if (mode & S_IRUSR) {
-               if (conn->vfs_ops.sys_acl_add_perm(conn, *p_permset, SMB_ACL_READ) == -1)
+               if (VFS_SYS_ACL_ADD_PERM(conn, *p_permset, SMB_ACL_READ) == -1)
                        return -1;
        }
        if (mode & S_IWUSR) {
-               if (conn->vfs_ops.sys_acl_add_perm(conn, *p_permset, SMB_ACL_WRITE) == -1)
+               if (VFS_SYS_ACL_ADD_PERM(conn, *p_permset, SMB_ACL_WRITE) == -1)
                        return -1;
        }
        if (mode & S_IXUSR) {
-               if (conn->vfs_ops.sys_acl_add_perm(conn, *p_permset, SMB_ACL_EXECUTE) == -1)
+               if (VFS_SYS_ACL_ADD_PERM(conn, *p_permset, SMB_ACL_EXECUTE) == -1)
                        return -1;
        }
        return 0;
@@ -649,7 +649,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
        /*
         * When setting ACLs and missing one out of SMB_ACL_USER_OBJ,
         * SMB_ACL_GROUP_OBJ, SMB_ACL_OTHER, try to retrieve current
-        * values. For user and other a simple vfs_stat would do, but
+        * values. For user and other a simple VFS_STAT would do, but
         * we would get mask instead of group. Let's do it via ACL.
         */
 
@@ -659,13 +659,13 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
                int entry_id = SMB_ACL_FIRST_ENTRY;
 
                if(fsp->is_directory || fsp->fd == -1) {
-                       current_posix_acl = conn->vfs_ops.sys_acl_get_file(conn, fsp->fsp_name, SMB_ACL_TYPE_ACCESS);
+                       current_posix_acl = VFS_SYS_ACL_GET_FILE(conn, fsp->fsp_name, SMB_ACL_TYPE_ACCESS);
                } else {
-                       current_posix_acl = conn->vfs_ops.sys_acl_get_fd(fsp, fsp->fd);
+                       current_posix_acl = VFS_SYS_ACL_GET_FD(fsp, fsp->fd);
                }
 
                if (current_posix_acl) {
-                       while (conn->vfs_ops.sys_acl_get_entry(conn, current_posix_acl, entry_id, &entry) == 1) {
+                       while (VFS_SYS_ACL_GET_ENTRY(conn, current_posix_acl, entry_id, &entry) == 1) {
                                SMB_ACL_TAG_T tagtype;
                                SMB_ACL_PERMSET_T permset;
 
@@ -674,10 +674,10 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
                                        entry_id = SMB_ACL_NEXT_ENTRY;
 
                                /* Is this a MASK entry ? */
-                               if (conn->vfs_ops.sys_acl_get_tag_type(conn, entry, &tagtype) == -1)
+                               if (VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) == -1)
                                        continue;
 
-                               if (conn->vfs_ops.sys_acl_get_permset(conn, entry, &permset) == -1)
+                               if (VFS_SYS_ACL_GET_PERMSET(conn, entry, &permset) == -1)
                                        continue;
 
                                switch(tagtype) {
@@ -695,7 +695,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
                                                break;
                                }
                        }
-                       conn->vfs_ops.sys_acl_free_acl(conn, current_posix_acl);
+                       VFS_SYS_ACL_FREE_ACL(conn, current_posix_acl);
                } else {
                        DEBUG(10,("ensure_canon_entry_valid: failed to retrieve current ACL of %s\n",
                                fsp->fsp_name));
@@ -1658,7 +1658,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
        SMB_ACL_ENTRY_T entry;
        size_t ace_count;
 
-       while ( posix_acl && (conn->vfs_ops.sys_acl_get_entry(conn, posix_acl, entry_id, &entry) == 1)) {
+       while ( posix_acl && (VFS_SYS_ACL_GET_ENTRY(conn, posix_acl, entry_id, &entry) == 1)) {
                SMB_ACL_TAG_T tagtype;
                SMB_ACL_PERMSET_T permset;
                DOM_SID sid;
@@ -1670,10 +1670,10 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
                        entry_id = SMB_ACL_NEXT_ENTRY;
 
                /* Is this a MASK entry ? */
-               if (conn->vfs_ops.sys_acl_get_tag_type(conn, entry, &tagtype) == -1)
+               if (VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) == -1)
                        continue;
 
-               if (conn->vfs_ops.sys_acl_get_permset(conn, entry, &permset) == -1)
+               if (VFS_SYS_ACL_GET_PERMSET(conn, entry, &permset) == -1)
                        continue;
 
                /* Decide which SID to use based on the ACL type. */
@@ -1686,7 +1686,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
                                break;
                        case SMB_ACL_USER:
                                {
-                                       uid_t *puid = (uid_t *)conn->vfs_ops.sys_acl_get_qualifier(conn, entry);
+                                       uid_t *puid = (uid_t *)VFS_SYS_ACL_GET_QUALIFIER(conn, entry);
                                        if (puid == NULL) {
                                                DEBUG(0,("canonicalise_acl: Failed to get uid.\n"));
                                                continue;
@@ -1703,7 +1703,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
                                        uid_to_sid( &sid, *puid);
                                        unix_ug.uid = *puid;
                                        owner_type = UID_ACE;
-                                       conn->vfs_ops.sys_acl_free_qualifier(conn, (void *)puid,tagtype);
+                                       VFS_SYS_ACL_FREE_QUALIFIER(conn, (void *)puid,tagtype);
                                        break;
                                }
                        case SMB_ACL_GROUP_OBJ:
@@ -1714,7 +1714,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
                                break;
                        case SMB_ACL_GROUP:
                                {
-                                       gid_t *pgid = (gid_t *)conn->vfs_ops.sys_acl_get_qualifier(conn, entry);
+                                       gid_t *pgid = (gid_t *)VFS_SYS_ACL_GET_QUALIFIER(conn, entry);
                                        if (pgid == NULL) {
                                                DEBUG(0,("canonicalise_acl: Failed to get gid.\n"));
                                                continue;
@@ -1722,7 +1722,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
                                        gid_to_sid( &sid, *pgid);
                                        unix_ug.gid = *pgid;
                                        owner_type = GID_ACE;
-                                       conn->vfs_ops.sys_acl_free_qualifier(conn, (void *)pgid,tagtype);
+                                       VFS_SYS_ACL_FREE_QUALIFIER(conn, (void *)pgid,tagtype);
                                        break;
                                }
                        case SMB_ACL_MASK:
@@ -1807,7 +1807,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
 {
        connection_struct *conn = fsp->conn;
        BOOL ret = False;
-       SMB_ACL_T the_acl = conn->vfs_ops.sys_acl_init(conn, (int)count_canon_ace_list(the_ace) + 1);
+       SMB_ACL_T the_acl = VFS_SYS_ACL_INIT(conn, (int)count_canon_ace_list(the_ace) + 1);
        canon_ace *p_ace;
        int i;
        SMB_ACL_ENTRY_T mask_entry;
@@ -1865,7 +1865,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                 * Get the entry for this ACE.
                 */
 
-               if (conn->vfs_ops.sys_acl_create_entry(conn, &the_acl, &the_entry) == -1) {
+               if (VFS_SYS_ACL_CREATE_ENTRY(conn, &the_acl, &the_entry) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to create entry %d. (%s)\n",
                                i, strerror(errno) ));
                        goto done;
@@ -1891,7 +1891,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                 * First tell the entry what type of ACE this is.
                 */
 
-               if (conn->vfs_ops.sys_acl_set_tag_type(conn, the_entry, p_ace->type) == -1) {
+               if (VFS_SYS_ACL_SET_TAG_TYPE(conn, the_entry, p_ace->type) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to set tag type on entry %d. (%s)\n",
                                i, strerror(errno) ));
                        goto done;
@@ -1903,7 +1903,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                 */
 
                if ((p_ace->type == SMB_ACL_USER) || (p_ace->type == SMB_ACL_GROUP)) {
-                       if (conn->vfs_ops.sys_acl_set_qualifier(conn, the_entry,(void *)&p_ace->unix_ug.uid) == -1) {
+                       if (VFS_SYS_ACL_SET_QUALIFIER(conn, the_entry,(void *)&p_ace->unix_ug.uid) == -1) {
                                DEBUG(0,("set_canon_ace_list: Failed to set qualifier on entry %d. (%s)\n",
                                        i, strerror(errno) ));
                                goto done;
@@ -1914,7 +1914,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                 * Convert the mode_t perms in the canon_ace to a POSIX permset.
                 */
 
-               if (conn->vfs_ops.sys_acl_get_permset(conn, the_entry, &the_permset) == -1) {
+               if (VFS_SYS_ACL_GET_PERMSET(conn, the_entry, &the_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to get permset on entry %d. (%s)\n",
                                i, strerror(errno) ));
                        goto done;
@@ -1930,7 +1930,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                 * ..and apply them to the entry.
                 */
 
-               if (conn->vfs_ops.sys_acl_set_permset(conn, the_entry, the_permset) == -1) {
+               if (VFS_SYS_ACL_SET_PERMSET(conn, the_entry, the_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to add permset on entry %d. (%s)\n",
                                i, strerror(errno) ));
                        goto done;
@@ -1941,17 +1941,17 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
        }
 
        if (needs_mask && !got_mask_entry) {
-               if (conn->vfs_ops.sys_acl_create_entry(conn, &the_acl, &mask_entry) == -1) {
+               if (VFS_SYS_ACL_CREATE_ENTRY(conn, &the_acl, &mask_entry) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to create mask entry. (%s)\n", strerror(errno) ));
                        goto done;
                }
 
-               if (conn->vfs_ops.sys_acl_set_tag_type(conn, mask_entry, SMB_ACL_MASK) == -1) {
+               if (VFS_SYS_ACL_SET_TAG_TYPE(conn, mask_entry, SMB_ACL_MASK) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to set tag type on mask entry. (%s)\n",strerror(errno) ));
                        goto done;
                }
 
-               if (conn->vfs_ops.sys_acl_get_permset(conn, mask_entry, &mask_permset) == -1) {
+               if (VFS_SYS_ACL_GET_PERMSET(conn, mask_entry, &mask_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to get mask permset. (%s)\n", strerror(errno) ));
                        goto done;
                }
@@ -1961,7 +1961,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                        goto done;
                }
 
-               if (conn->vfs_ops.sys_acl_set_permset(conn, mask_entry, mask_permset) == -1) {
+               if (VFS_SYS_ACL_SET_PERMSET(conn, mask_entry, mask_permset) == -1) {
                        DEBUG(0,("set_canon_ace_list: Failed to add mask permset. (%s)\n", strerror(errno) ));
                        goto done;
                }
@@ -1971,7 +1971,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
         * Check if the ACL is valid.
         */
 
-       if (conn->vfs_ops.sys_acl_valid(conn, the_acl) == -1) {
+       if (VFS_SYS_ACL_VALID(conn, the_acl) == -1) {
                DEBUG(0,("set_canon_ace_list: ACL type (%s) is invalid for set (%s).\n",
                                the_acl_type == SMB_ACL_TYPE_DEFAULT ? "directory default" : "file",
                                strerror(errno) ));
@@ -1983,7 +1983,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
         */
 
        if(default_ace || fsp->is_directory || fsp->fd == -1) {
-               if (conn->vfs_ops.sys_acl_set_file(conn, fsp->fsp_name, the_acl_type, the_acl) == -1) {
+               if (VFS_SYS_ACL_SET_FILE(conn, fsp->fsp_name, the_acl_type, the_acl) == -1) {
                        /*
                         * Some systems allow all the above calls and only fail with no ACL support
                         * when attempting to apply the acl. HPUX with HFS is an example of this. JRA.
@@ -2002,7 +2002,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
                        goto done;
                }
        } else {
-               if (conn->vfs_ops.sys_acl_set_fd(fsp, fsp->fd, the_acl) == -1) {
+               if (VFS_SYS_ACL_SET_FD(fsp, fsp->fd, the_acl) == -1) {
                        /*
                         * Some systems allow all the above calls and only fail with no ACL support
                         * when attempting to apply the acl. HPUX with HFS is an example of this. JRA.
@@ -2026,7 +2026,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
   done:
 
        if (the_acl != NULL)
-           conn->vfs_ops.sys_acl_free_acl(conn, the_acl);
+           VFS_SYS_ACL_FREE_ACL(conn, the_acl);
 
        return ret;
 }
@@ -2057,8 +2057,8 @@ SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T acl)
 
        if (!acl)
                return NULL;
-       if (conn->vfs_ops.sys_acl_get_entry(conn, acl, SMB_ACL_FIRST_ENTRY, &entry) != 1) {
-               conn->vfs_ops.sys_acl_free_acl(conn, acl);
+       if (VFS_SYS_ACL_GET_ENTRY(conn, acl, SMB_ACL_FIRST_ENTRY, &entry) != 1) {
+               VFS_SYS_ACL_FREE_ACL(conn, acl);
                return NULL;
        }
        return acl;
@@ -2224,34 +2224,34 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc)
        if(fsp->is_directory || fsp->fd == -1) {
 
                /* Get the stat struct for the owner info. */
-               if(vfs_stat(fsp->conn,fsp->fsp_name, &sbuf) != 0) {
+               if(VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf) != 0) {
                        return 0;
                }
                /*
                 * Get the ACL from the path.
                 */
 
-               posix_acl = conn->vfs_ops.sys_acl_get_file(conn, fsp->fsp_name, SMB_ACL_TYPE_ACCESS);
+               posix_acl = VFS_SYS_ACL_GET_FILE(conn, fsp->fsp_name, SMB_ACL_TYPE_ACCESS);
 
                /*
                 * If it's a directory get the default POSIX ACL.
                 */
 
                if(fsp->is_directory) {
-                       dir_acl = conn->vfs_ops.sys_acl_get_file(conn, fsp->fsp_name, SMB_ACL_TYPE_DEFAULT);
+                       dir_acl = VFS_SYS_ACL_GET_FILE(conn, fsp->fsp_name, SMB_ACL_TYPE_DEFAULT);
                        dir_acl = free_empty_sys_acl(conn, dir_acl);
                }
 
        } else {
 
                /* Get the stat struct for the owner info. */
-               if(vfs_fstat(fsp,fsp->fd,&sbuf) != 0) {
+               if(VFS_FSTAT(fsp,fsp->fd,&sbuf) != 0) {
                        return 0;
                }
                /*
                 * Get the ACL from the fd.
                 */
-               posix_acl = conn->vfs_ops.sys_acl_get_fd(fsp, fsp->fd);
+               posix_acl = VFS_SYS_ACL_GET_FD(fsp, fsp->fd);
        }
 
        DEBUG(5,("get_nt_acl : file ACL %s, directory ACL %s\n",
@@ -2479,9 +2479,9 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc)
  done:
 
        if (posix_acl)
-               conn->vfs_ops.sys_acl_free_acl(conn, posix_acl);
+               VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
        if (dir_acl)
-               conn->vfs_ops.sys_acl_free_acl(conn, dir_acl);
+               VFS_SYS_ACL_FREE_ACL(conn, dir_acl);
        free_canon_ace_list(file_ace);
        free_canon_ace_list(dir_ace);
        SAFE_FREE(nt_ace_list);
@@ -2505,14 +2505,14 @@ static int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_
        SMB_STRUCT_STAT st;
 
        /* try the direct way first */
-       ret = vfs_chown(conn, fname, uid, gid);
+       ret = VFS_CHOWN(conn, fname, uid, gid);
        if (ret == 0)
                return 0;
 
        if(!CAN_WRITE(conn) || !lp_dos_filemode(SNUM(conn)))
                return -1;
 
-       if (vfs_stat(conn,fname,&st))
+       if (VFS_STAT(conn,fname,&st))
                return -1;
 
        fsp = open_file_fchmod(conn,fname,&st);
@@ -2527,7 +2527,7 @@ static int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_
 
        become_root();
        /* Keep the current file gid the same. */
-       ret = vfswrap_fchown(fsp, fsp->fd, uid, (gid_t)-1);
+       ret = VFS_FCHOWN(fsp, fsp->fd, uid, (gid_t)-1);
        unbecome_root();
 
        close_file_fchmod(fsp);
@@ -2570,10 +2570,10 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
         */
 
        if(fsp->is_directory || fsp->fd == -1) {
-               if(vfs_stat(fsp->conn,fsp->fsp_name, &sbuf) != 0)
+               if(VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf) != 0)
                        return False;
        } else {
-               if(vfs_fstat(fsp,fsp->fd,&sbuf) != 0)
+               if(VFS_FSTAT(fsp,fsp->fd,&sbuf) != 0)
                        return False;
        }
 
@@ -2619,7 +2619,7 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
                 */
 
                if(fsp->is_directory) {
-                       if(vfs_stat(fsp->conn, fsp->fsp_name, &sbuf) != 0) {
+                       if(VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf) != 0) {
                                return False;
                        }
                } else {
@@ -2627,9 +2627,9 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
                        int ret;
     
                        if(fsp->fd == -1)
-                               ret = vfs_stat(fsp->conn, fsp->fsp_name, &sbuf);
+                               ret = VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf);
                        else
-                               ret = vfs_fstat(fsp,fsp->fd,&sbuf);
+                               ret = VFS_FSTAT(fsp,fsp->fd,&sbuf);
   
                        if(ret != 0)
                                return False;
@@ -2697,7 +2697,7 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
                                         * No default ACL - delete one if it exists.
                                         */
 
-                                       if (conn->vfs_ops.sys_acl_delete_def_file(conn, fsp->fsp_name) == -1) {
+                                       if (VFS_SYS_ACL_DELETE_DEF_FILE(conn, fsp->fsp_name) == -1) {
                                                DEBUG(3,("set_nt_acl: sys_acl_delete_def_file failed (%s)\n", strerror(errno)));
                                                free_canon_ace_list(file_ace_list);
                                                free_canon_ace_list(dir_ace_list);
@@ -2726,7 +2726,7 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
                                        DEBUG(3,("set_nt_acl: chmod %s. perms = 0%o.\n",
                                                fsp->fsp_name, (unsigned int)posix_perms ));
 
-                                       if(conn->vfs_ops.chmod(conn,fsp->fsp_name, posix_perms) == -1) {
+                                       if(VFS_CHMOD(conn,fsp->fsp_name, posix_perms) == -1) {
                                                DEBUG(3,("set_nt_acl: chmod %s, 0%o failed. Error = %s.\n",
                                                                fsp->fsp_name, (unsigned int)posix_perms, strerror(errno) ));
                                                free_canon_ace_list(file_ace_list);
@@ -2768,7 +2768,7 @@ static int chmod_acl_internals( connection_struct *conn, SMB_ACL_T posix_acl, mo
        SMB_ACL_ENTRY_T entry;
        int num_entries = 0;
 
-       while ( conn->vfs_ops.sys_acl_get_entry(conn, posix_acl, entry_id, &entry) == 1) {
+       while ( VFS_SYS_ACL_GET_ENTRY(conn, posix_acl, entry_id, &entry) == 1) {
                SMB_ACL_TAG_T tagtype;
                SMB_ACL_PERMSET_T permset;
                mode_t perms;
@@ -2777,10 +2777,10 @@ static int chmod_acl_internals( connection_struct *conn, SMB_ACL_T posix_acl, mo
                if (entry_id == SMB_ACL_FIRST_ENTRY)
                        entry_id = SMB_ACL_NEXT_ENTRY;
 
-               if (conn->vfs_ops.sys_acl_get_tag_type(conn, entry, &tagtype) == -1)
+               if (VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) == -1)
                        return -1;
 
-               if (conn->vfs_ops.sys_acl_get_permset(conn, entry, &permset) == -1)
+               if (VFS_SYS_ACL_GET_PERMSET(conn, entry, &permset) == -1)
                        return -1;
 
                num_entries++;
@@ -2811,7 +2811,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 (conn->vfs_ops.sys_acl_set_permset(conn, entry, permset) == -1)
+               if (VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) == -1)
                        return -1;
        }
 
@@ -2837,17 +2837,17 @@ static int copy_access_acl(connection_struct *conn, const char *from, const char
        SMB_ACL_T posix_acl = NULL;
        int ret = -1;
 
-       if ((posix_acl = conn->vfs_ops.sys_acl_get_file(conn, from, SMB_ACL_TYPE_ACCESS)) == NULL)
+       if ((posix_acl = VFS_SYS_ACL_GET_FILE(conn, from, SMB_ACL_TYPE_ACCESS)) == NULL)
                return -1;
 
        if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
                goto done;
 
-       ret = conn->vfs_ops.sys_acl_set_file(conn, to, SMB_ACL_TYPE_ACCESS, posix_acl);
+       ret = VFS_SYS_ACL_SET_FILE(conn, to, SMB_ACL_TYPE_ACCESS, posix_acl);
 
  done:
 
-       conn->vfs_ops.sys_acl_free_acl(conn, posix_acl);
+       VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
        return ret;
 }
 
@@ -2889,17 +2889,17 @@ int fchmod_acl(files_struct *fsp, int fd, mode_t mode)
        SMB_ACL_T posix_acl = NULL;
        int ret = -1;
 
-       if ((posix_acl = conn->vfs_ops.sys_acl_get_fd(fsp, fd)) == NULL)
+       if ((posix_acl = VFS_SYS_ACL_GET_FD(fsp, fd)) == NULL)
                return -1;
 
        if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
                goto done;
 
-       ret = conn->vfs_ops.sys_acl_set_fd(fsp, fd, posix_acl);
+       ret = VFS_SYS_ACL_SET_FD(fsp, fd, posix_acl);
 
   done:
 
-       conn->vfs_ops.sys_acl_free_acl(conn, posix_acl);
+       VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
        return ret;
 }
 
@@ -2909,14 +2909,14 @@ int fchmod_acl(files_struct *fsp, int fd, mode_t mode)
 
 BOOL directory_has_default_acl(connection_struct *conn, const char *fname)
 {
-        SMB_ACL_T dir_acl = conn->vfs_ops.sys_acl_get_file( conn, fname, SMB_ACL_TYPE_DEFAULT);
+        SMB_ACL_T dir_acl = VFS_SYS_ACL_GET_FILE( conn, fname, SMB_ACL_TYPE_DEFAULT);
         BOOL has_acl = False;
         SMB_ACL_ENTRY_T entry;
 
-        if (dir_acl != NULL && (conn->vfs_ops.sys_acl_get_entry(conn, dir_acl, SMB_ACL_FIRST_ENTRY, &entry) == 1))
+        if (dir_acl != NULL && (VFS_SYS_ACL_GET_ENTRY(conn, dir_acl, SMB_ACL_FIRST_ENTRY, &entry) == 1))
                 has_acl = True;
 
        if (dir_acl)
-               conn->vfs_ops.sys_acl_free_acl(conn, dir_acl);
+               VFS_SYS_ACL_FREE_ACL(conn, dir_acl);
         return has_acl;
 }