From 34a2082e68b24694d28598e14265b57a7b4a9769 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 4 Mar 2009 17:18:12 -0800 Subject: [PATCH] Second part of fix for #6154, ensure we return max access if admin user. Jeremy. (cherry picked from commit 30d2017c7bb01adb5e9ce4bf84df845d676665de) --- source/smbd/open.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/smbd/open.c b/source/smbd/open.c index 9b51ff0d948..d2f85ce521a 100644 --- a/source/smbd/open.c +++ b/source/smbd/open.c @@ -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 | -- 2.11.4.GIT