Second part of fix for #6154, ensure we return max access
authorJeremy Allison <jra@samba.org>
Thu, 5 Mar 2009 01:17:43 +0000 (17:17 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 5 Mar 2009 01:17:43 +0000 (17:17 -0800)
if admin user.
Jeremy.

source3/smbd/open.c

index 569c2603192f811aef1c35299bda198a5e0e02ab..acd347520d1952d447a7fe2237b18d8486a59de6 100644 (file)
@@ -76,6 +76,15 @@ static NTSTATUS check_open_rights(struct connection_struct *conn,
 
        *access_granted = 0;
 
+       if (conn->server_info->utok.uid == 0 || conn->admin_user) {
+               /* I'm sorry sir, I didn't know you were root... */
+               *access_granted = access_mask;
+               if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) {
+                       *access_granted |= FILE_GENERIC_ALL;
+               }
+               return NT_STATUS_OK;
+       }
+
        status = SMB_VFS_GET_NT_ACL(conn, fname,
                        (OWNER_SECURITY_INFORMATION |
                        GROUP_SECURITY_INFORMATION |