Second part of fix for #6154, ensure we return max access
authorJeremy Allison <jra@samba.org>
Thu, 5 Mar 2009 01:18:12 +0000 (17:18 -0800)
committerKarolin Seeger <kseeger@samba.org>
Fri, 6 Mar 2009 07:28:30 +0000 (08:28 +0100)
if admin user.
Jeremy.
(cherry picked from commit 30d2017c7bb01adb5e9ce4bf84df845d676665de)

source/smbd/open.c

index 9b51ff0d9485896322e2c1452a22a6aafe52ebac..d2f85ce521afb13ff04422b84e0a332fd9eb3c6b 100644 (file)
@@ -59,6 +59,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 |