r5050: make sure we translate the generic to the specific bits before doing a
authorAndrew Tridgell <tridge@samba.org>
Thu, 27 Jan 2005 23:22:12 +0000 (23:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:17 +0000 (13:09 -0500)
pvfs_access_check_unix().

Fixes a problem with the cifsfs filesystem
(This used to be commit 8ebc61a2297176515d767ef0f67ec912293ab905)

source4/ntvfs/posix/pvfs_acl.c

index c2856ad2928e9dfe991eede3dd8263cd92011816..258d4e5bcb6f22b1e5d6a2901cdab73ac5c4178b 100644 (file)
@@ -372,6 +372,10 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
                return NT_STATUS_NO_MEMORY;
        }
 
+       /* expand the generic access bits to file specific bits */
+       *access_mask = pvfs_translate_mask(*access_mask);
+       *access_mask &= ~SEC_FILE_READ_ATTRIBUTE;
+
        status = pvfs_acl_load(pvfs, name, -1, acl);
        if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
                talloc_free(acl);
@@ -389,11 +393,6 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
                return NT_STATUS_INVALID_ACL;
        }
 
-       /* expand the generic access bits to file specific bits */
-       *access_mask = pvfs_translate_mask(*access_mask);
-
-       *access_mask &= ~SEC_FILE_READ_ATTRIBUTE;
-
        /* check the acl against the required access mask */
        status = sec_access_check(sd, token, *access_mask, access_mask);