Remove redundant parameter fd from SMB_VFS_SYS_ACL_SET_FD().
authorMichael Adam <obnox@samba.org>
Tue, 8 Jan 2008 00:54:19 +0000 (01:54 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 8 Jan 2008 00:54:19 +0000 (01:54 +0100)
Michael
(This used to be commit 9296e93588c0e795cae770765050247ac1474a74)

14 files changed:
source3/include/vfs.h
source3/include/vfs_macros.h
source3/lib/sysacls.c
source3/modules/vfs_aixacl.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_hpuxacl.c
source3/modules/vfs_irixacl.c
source3/modules/vfs_posixacl.c
source3/modules/vfs_solarisacl.c
source3/modules/vfs_tru64acl.c
source3/smbd/posix_acls.c

index abe474f36034f2cbf3585b1854377e58ea2f923d..f6f7d4fded8a0465f4b47aa69229254b116f8817 100644 (file)
@@ -93,6 +93,7 @@
 /* Leave at 22 - not yet released. Remove parameter fd from getlock. - obnox */
 /* Leave at 22 - not yet released. Remove parameter fd from sys_acl_get_fd. - obnox */
 /* Leave at 22 - not yet released. Remove parameter fd from fchmod_acl. - obnox */
+/* Leave at 22 - not yet released. Remove parameter fd from sys_acl_set_fd. - obnox */
 
 
 
@@ -366,7 +367,7 @@ struct vfs_ops {
                int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset);
                int (*sys_acl_valid)(struct vfs_handle_struct *handle, SMB_ACL_T theacl );
                int (*sys_acl_set_file)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
-               int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_ACL_T theacl);
+               int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl);
                int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, const char *path);
                int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
                int (*sys_acl_free_text)(struct vfs_handle_struct *handle, char *text);
index 3cd4be17604d2f448df9e6c8e9af7fb6dbdc2657..3b9852a19c79554c517e5e80b1c7f8108d4baf5a 100644 (file)
 #define SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs.ops.sys_acl_set_permset((conn)->vfs.handles.sys_acl_set_permset, (entry), (permset)))
 #define SMB_VFS_SYS_ACL_VALID(conn, theacl) ((conn)->vfs.ops.sys_acl_valid((conn)->vfs.handles.sys_acl_valid, (theacl)))
 #define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs.ops.sys_acl_set_file((conn)->vfs.handles.sys_acl_set_file, (name), (acltype), (theacl)))
-#define SMB_VFS_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
+#define SMB_VFS_SYS_ACL_SET_FD(fsp, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (theacl)))
 #define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs.ops.sys_acl_delete_def_file((conn)->vfs.handles.sys_acl_delete_def_file, (path)))
 #define SMB_VFS_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_get_perm((conn)->vfs.handles.sys_acl_get_perm, (permset), (perm)))
 #define SMB_VFS_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs.ops.sys_acl_free_text((conn)->vfs.handles.sys_acl_free_text, (text)))
 #define SMB_VFS_OPAQUE_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs_opaque.ops.sys_acl_set_permset((conn)->vfs_opaque.handles.sys_acl_set_permset, (entry), (permset)))
 #define SMB_VFS_OPAQUE_SYS_ACL_VALID(conn, theacl) ((conn)->vfs_opaque.ops.sys_acl_valid((conn)->vfs_opaque.handles.sys_acl_valid, (theacl)))
 #define SMB_VFS_OPAQUE_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs_opaque.ops.sys_acl_set_file((conn)->vfs_opaque.handles.sys_acl_set_file, (name), (acltype), (theacl)))
-#define SMB_VFS_OPAQUE_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
+#define SMB_VFS_OPAQUE_SYS_ACL_SET_FD(fsp, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (theacl)))
 #define SMB_VFS_OPAQUE_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs_opaque.ops.sys_acl_delete_def_file((conn)->vfs_opaque.handles.sys_acl_delete_def_file, (path)))
 #define SMB_VFS_OPAQUE_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_get_perm((conn)->vfs_opaque.handles.sys_acl_get_perm, (permset), (perm)))
 #define SMB_VFS_OPAQUE_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs_opaque.ops.sys_acl_free_text((conn)->vfs_opaque.handles.sys_acl_free_text, (text)))
 #define SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset) ((handle)->vfs_next.ops.sys_acl_set_permset((handle)->vfs_next.handles.sys_acl_set_permset, (entry), (permset)))
 #define SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl) ((handle)->vfs_next.ops.sys_acl_valid((handle)->vfs_next.handles.sys_acl_valid, (theacl)))
 #define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl) ((handle)->vfs_next.ops.sys_acl_set_file((handle)->vfs_next.handles.sys_acl_set_file, (name), (acltype), (theacl)))
-#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (fd), (theacl)))
+#define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (theacl)))
 #define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path) ((handle)->vfs_next.ops.sys_acl_delete_def_file((handle)->vfs_next.handles.sys_acl_delete_def_file, (path)))
 #define SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm) ((handle)->vfs_next.ops.sys_acl_get_perm((handle)->vfs_next.handles.sys_acl_get_perm, (permset), (perm)))
 #define SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text) ((handle)->vfs_next.ops.sys_acl_free_text((handle)->vfs_next.handles.sys_acl_free_text, (text)))
index f23d03f706fd7684908eaf37057ba962589bef9a..9c1256ed650039d8a4c895f9aa9b4f5a9a6dab60 100644 (file)
@@ -3,7 +3,7 @@
    Samba system utilities for ACL support.
    Copyright (C) Jeremy Allison 2000.
    Copyright (C) Volker Lendecke 2006
-   Copyright (C) Michael Adam 2006
+   Copyright (C) Michael Adam 2006,2008
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -376,9 +376,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
  
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return posixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return posixacl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -407,9 +407,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return aixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return aixacl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -438,9 +438,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return tru64acl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return tru64acl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -469,9 +469,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return solarisacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return solarisacl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -500,9 +500,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return hpuxacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return hpuxacl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -531,9 +531,9 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
-       return irixacl_sys_acl_set_fd(handle, fsp, fd, acl_d);
+       return irixacl_sys_acl_set_fd(handle, fsp, acl_d);
 }
 
 int sys_acl_delete_def_file(vfs_handle_struct *handle,
@@ -577,7 +577,7 @@ int sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  int fd, SMB_ACL_T acl_d)
+                  SMB_ACL_T acl_d)
 {
 #ifdef ENOTSUP
        errno = ENOTSUP;
index 1a76ed68789036450eeb5a9076c6e838686b3e99..726a7f485e84e7218d93f153d431c182b68f2fb8 100644 (file)
@@ -153,7 +153,7 @@ int aixacl_sys_acl_set_file(vfs_handle_struct *handle,
 
 int aixacl_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
        struct acl *file_acl = NULL;
        unsigned int rc;
@@ -162,7 +162,7 @@ int aixacl_sys_acl_set_fd(vfs_handle_struct *handle,
        if (!file_acl)
                return -1;
 
-       rc = fchacl(fd,file_acl,file_acl->acl_len);
+       rc = fchacl(fsp->fh->fd,file_acl,file_acl->acl_len);
        DEBUG(10,("errno is %d\n",errno));
        DEBUG(10,("return code is %d\n",rc));
        SAFE_FREE(file_acl);
index 42ecb9892c0b6ef27fd0cbf612a8407f250546d3..996adbbdfe3b2c185776b7ad1da5a5987fc9ce6e 100644 (file)
@@ -448,7 +448,7 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
 
 int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
        struct acl      *acl_aixc;
        acl_type_t      acl_type_info;
@@ -467,7 +467,7 @@ int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
                return -1;
 
        rc = aclx_fput(
-               fd,
+               fsp->fh->fd,
                SET_ACL, /* set only the ACL, not mode bits */
                acl_type_info,
                acl_aixc,
index f820d4b3e26f320b2f2ed26a2174e3d5660243b1..a46c2a336f3d92ef03d35bfe3bdcdaca223bfe2d 100644 (file)
@@ -1097,9 +1097,9 @@ static int vfswrap_sys_acl_set_file(vfs_handle_struct *handle,  const char *name
        return sys_acl_set_file(handle, name, acltype, theacl);
 }
 
-static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl)
+static int vfswrap_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
 {
-       return sys_acl_set_fd(handle, fsp, fd, theacl);
+       return sys_acl_set_fd(handle, fsp, theacl);
 }
 
 static int vfswrap_sys_acl_delete_def_file(vfs_handle_struct *handle,  const char *path)
index 4e70879dc23d5d648a31970d8419d0386732d4a3..64c74df1bad02b3e8709f5a17e4a626d410c9fe6 100644 (file)
@@ -250,7 +250,7 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
                                  const char *name, SMB_ACL_TYPE_T acltype,
                                  SMB_ACL_T theacl);
 static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, SMB_ACL_T theacl);
+                               SMB_ACL_T theacl);
 static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
                                         const char *path);
 static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
@@ -1843,11 +1843,11 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, SMB_ACL_T theacl)
+                               SMB_ACL_T theacl)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl);
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle,
               "%s", fsp->fsp_name);
index 714f6e2917cba47e1aba8000bdfc4a214408fbcf..bcf61f3bc75f6a49ef91e7ddb853a5c68998458a 100644 (file)
@@ -615,7 +615,7 @@ int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
 
 int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
        return gpfsacl_sys_acl_set_file(handle, fsp->fsp_name, SMB_ACL_TYPE_ACCESS, theacl);
 }
index 67fbfe56f63f63a96d49198950992e24d3ac541e..e101886450b191d93af72ec27cd0f978bc76c6da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Unix SMB/Netbios implementation.
  * VFS module to get and set HP-UX ACLs
- * Copyright (C) Michael Adam 2006
+ * Copyright (C) Michael Adam 2006,2008
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -306,14 +306,14 @@ int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle,
  */
 int hpuxacl_sys_acl_set_fd(vfs_handle_struct *handle,
                              files_struct *fsp,
-                             int fd, SMB_ACL_T theacl)
+                             SMB_ACL_T theacl)
 {
         /*
          * HPUX doesn't have the facl call. Fake it using the path.... JRA.
          */
        /* For all I see, the info should already be in the fsp
         * parameter, but get it again to be safe --- necessary? */
-        files_struct *file_struct_p = file_find_fd(fd);
+        files_struct *file_struct_p = file_find_fd(fsp->fh->fd);
         if (file_struct_p == NULL) {
                 errno = EBADF;
                 return -1;
index cf53633504314c02153a441779395df6bebfd9dd..6484e8f3eb927e246d3eaec0e8bab63ab2cc539a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Unix SMB/Netbios implementation.
    VFS module to get and set irix acls
-   Copyright (C) Michael Adam 2006
+   Copyright (C) Michael Adam 2006,2008
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -49,7 +49,7 @@ int irixacl_sys_acl_set_file(vfs_handle_struct *handle,
 
 int irixacl_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
        errno = ENOTSUP;
        return -1;
index faa5e8e2ad79bf4c568cdbf993be03ae7e64f5ae..21fb2ada3196d2f2903ee0b7a608edb088b0040c 100644 (file)
@@ -113,14 +113,14 @@ int posixacl_sys_acl_set_file(vfs_handle_struct *handle,
 
 int posixacl_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
        int res;
        acl_t acl = smb_acl_to_posix(theacl);
        if (acl == NULL) {
                return -1;
        }
-       res =  acl_set_fd(fd, acl);
+       res =  acl_set_fd(fsp->fh->fd, acl);
        acl_free(acl);
        return res;
 }
index cda243f8c15fd5deb544ecaeda2f29e936abea9e..ce763f07e7bfc69338ae0c027860f266e67900b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Unix SMB/Netbios implementation.
    VFS module to get and set Solaris ACLs
-   Copyright (C) Michael Adam 2006
+   Copyright (C) Michael Adam 2006,2008
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -219,7 +219,7 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
  */
 int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
                              files_struct *fsp,
-                             int fd, SMB_ACL_T theacl)
+                             SMB_ACL_T theacl)
 {
        SOLARIS_ACL_T solaris_acl = NULL;
        SOLARIS_ACL_T default_acl = NULL;
@@ -242,7 +242,7 @@ int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
                           strerror(errno)));
                goto done;
        }
-       if (!solaris_acl_get_fd(fd, &default_acl, &default_count)) {
+       if (!solaris_acl_get_fd(fsp->fh->fd, &default_acl, &default_count)) {
                DEBUG(10, ("error getting (default) acl from fd\n"));
                goto done;
        }
@@ -258,7 +258,7 @@ int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
                goto done;
        }
 
-       ret = facl(fd, SETACL, count, solaris_acl);
+       ret = facl(fsp->fh->fd, SETACL, count, solaris_acl);
        if (ret != 0) {
                DEBUG(10, ("call of facl failed (%s).\n", strerror(errno)));
        }
index ee81ee60213676fcb84043cab5abd1576180b3b0..b23a7ddcfab2d85402518486cf3e3aa10a88c943 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Unix SMB/Netbios implementation.
    VFS module to get and set Tru64 acls
-   Copyright (C) Michael Adam 2006
+   Copyright (C) Michael Adam 2006,2008
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -128,14 +128,14 @@ fail:
 
 int tru64acl_sys_acl_set_fd(vfs_handle_struct *handle,
                            files_struct *fsp,
-                           int fd, SMB_ACL_T theacl)
+                           SMB_ACL_T theacl)
 {
         int res;
         acl_t tru64_acl = smb_acl_to_tru64_acl(theacl);
         if (tru64_acl == NULL) {
                 return -1;
         }
-        res =  acl_set_fd(fd, ACL_TYPE_ACCESS, tru64_acl);
+        res =  acl_set_fd(fsp->fh->fd, ACL_TYPE_ACCESS, tru64_acl);
         acl_free(tru64_acl);
         return res;
 
index 23a246fea76f8e0e5d14e51864f41192cf21c735..b6cb1d2e5407cbd6dc99c0320acbd5d0fb2c4c42 100644 (file)
@@ -2573,7 +2573,7 @@ static bool set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, bool defau
                        }
                }
        } else {
-               if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, the_acl) == -1) {
+               if (SMB_VFS_SYS_ACL_SET_FD(fsp, 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.
@@ -2589,7 +2589,7 @@ static bool set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, bool defau
                                        fsp->fsp_name ));
 
                                become_root();
-                               sret = SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, the_acl);
+                               sret = SMB_VFS_SYS_ACL_SET_FD(fsp, the_acl);
                                unbecome_root();
                                if (sret == 0) {
                                        ret = True;
@@ -3814,7 +3814,7 @@ int fchmod_acl(files_struct *fsp, mode_t mode)
        if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1)
                goto done;
 
-       ret = SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, posix_acl);
+       ret = SMB_VFS_SYS_ACL_SET_FD(fsp, posix_acl);
 
   done:
 
@@ -4152,7 +4152,7 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
 
        /* Set the new empty file ACL. */
        if (fsp && fsp->fh->fd != -1) {
-               if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, new_file_acl) == -1) {
+               if (SMB_VFS_SYS_ACL_SET_FD(fsp, new_file_acl) == -1) {
                        DEBUG(5,("remove_posix_acl: acl_set_file failed on %s (%s)\n",
                                fname, strerror(errno) ));
                        goto done;
@@ -4199,7 +4199,7 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *
 
        if (fsp && fsp->fh->fd != -1) {
                /* The preferred way - use an open fd. */
-               if (SMB_VFS_SYS_ACL_SET_FD(fsp, fsp->fh->fd, file_acl) == -1) {
+               if (SMB_VFS_SYS_ACL_SET_FD(fsp, file_acl) == -1) {
                        DEBUG(5,("set_unix_posix_acl: acl_set_file failed on %s (%s)\n",
                                fname, strerror(errno) ));
                        SMB_VFS_SYS_ACL_FREE_ACL(conn, file_acl);