From 33bd9b4bb901d08c3c9479bef0a748bb7f5f5fa7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 15 Mar 2010 12:24:06 -0700 Subject: Remove reference to conn->admin_user in preparation for removal. We use (uid_t)0 here not sec_initial_uid() as make test uses a single user context. I will revisit this when all the uid check changes are complete. Jeremy. --- source3/smbd/dir.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'source3/smbd/dir.c') diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index b1e9734681..69c5d7534a 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1127,11 +1127,12 @@ static bool user_can_read_file(connection_struct *conn, struct smb_filename *smb_fname) { /* - * If user is a member of the Admin group - * we never hide files from them. + * Never hide files from the root user. + * We use (uid_t)0 here not sec_initial_uid() + * as make test uses a single user context. */ - if (conn->admin_user) { + if (get_current_uid(conn) == (uid_t)0) { return True; } @@ -1149,11 +1150,12 @@ static bool user_can_write_file(connection_struct *conn, const struct smb_filename *smb_fname) { /* - * If user is a member of the Admin group - * we never hide files from them. + * Never hide files from the root user. + * We use (uid_t)0 here not sec_initial_uid() + * as make test uses a single user context. */ - if (conn->admin_user) { + if (get_current_uid(conn) == (uid_t)0) { return True; } @@ -1176,12 +1178,14 @@ static bool file_is_special(connection_struct *conn, const struct smb_filename *smb_fname) { /* - * If user is a member of the Admin group - * we never hide files from them. + * Never hide files from the root user. + * We use (uid_t)0 here not sec_initial_uid() + * as make test uses a single user context. */ - if (conn->admin_user) + if (get_current_uid(conn) == (uid_t)0) { return False; + } SMB_ASSERT(VALID_STAT(smb_fname->st)); -- cgit