r50: Fix bug 1139 as per fix suggested by jdev@panix.com,
authorJeremy Allison <jra@samba.org>
Mon, 5 Apr 2004 14:27:48 +0000 (14:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:06 +0000 (10:51 -0500)
swap lookups for user and group - group will do an
algorithmic lookup if it fails, user won't.
Jeremy.

source/smbd/posix_acls.c

index 620e123e14dfa6776dee9f4e124278c2c4d4c261..25e8fd802bd688502b6b18a621797a64f228d566 100644 (file)
@@ -1363,12 +1363,12 @@ static BOOL create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst,
                        if (nt4_compatible_acls())
                                psa->flags |= SEC_ACE_FLAG_INHERIT_ONLY;
 
-               } else if (NT_STATUS_IS_OK(sid_to_gid( &current_ace->trustee, &current_ace->unix_ug.gid))) {
-                       current_ace->owner_type = GID_ACE;
-                       current_ace->type = SMB_ACL_GROUP;
                } else if (NT_STATUS_IS_OK(sid_to_uid( &current_ace->trustee, &current_ace->unix_ug.uid))) {
                        current_ace->owner_type = UID_ACE;
                        current_ace->type = SMB_ACL_USER;
+               } else if (NT_STATUS_IS_OK(sid_to_gid( &current_ace->trustee, &current_ace->unix_ug.gid))) {
+                       current_ace->owner_type = GID_ACE;
+                       current_ace->type = SMB_ACL_GROUP;
                } else {
                        fstring str;