summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index fd9796dbf4..3eb727f96b 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -76,7 +76,7 @@ NTSTATUS smbd_check_open_rights(struct connection_struct *conn,
*access_granted = 0;
- if (conn->server_info->utok.uid == 0 || conn->admin_user) {
+ if (get_current_uid(conn) == (uid_t)0) {
/* I'm sorry sir, I didn't know you were root... */
*access_granted = access_mask;
if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) {
@@ -2173,7 +2173,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
new_file_created = True;
}
- set_share_mode(lck, fsp, conn->server_info->utok.uid, 0,
+ set_share_mode(lck, fsp, get_current_uid(conn), 0,
fsp->oplock_type);
/* Handle strange delete on close create semantics. */
@@ -2638,7 +2638,7 @@ static NTSTATUS open_directory(connection_struct *conn,
return status;
}
- set_share_mode(lck, fsp, conn->server_info->utok.uid, 0, NO_OPLOCK);
+ set_share_mode(lck, fsp, get_current_uid(conn), 0, NO_OPLOCK);
/* For directories the delete on close bit at open time seems
always to be honored on close... See test 19 in Samba4 BASE-DELETE. */