summaryrefslogtreecommitdiff
path: root/source3/smbd/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r--source3/smbd/dir.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index b1e9734681..69ebc57473 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1129,9 +1129,11 @@ static bool user_can_read_file(connection_struct *conn,
/*
* If user is a member of the Admin group
* we never hide files from them.
+ * Use (uid_t)0 here not sec_initial_uid()
+ * because of the RAW-SAMBA3HIDE test.
*/
- if (conn->admin_user) {
+ if (get_current_uid(conn) == (uid_t)0) {
return True;
}
@@ -1151,9 +1153,11 @@ static bool user_can_write_file(connection_struct *conn,
/*
* If user is a member of the Admin group
* we never hide files from them.
+ * Use (uid_t)0 here not sec_initial_uid()
+ * because of the RAW-SAMBA3HIDE test.
*/
- if (conn->admin_user) {
+ if (get_current_uid(conn) == (uid_t)0) {
return True;
}
@@ -1178,10 +1182,13 @@ static bool file_is_special(connection_struct *conn,
/*
* If user is a member of the Admin group
* we never hide files from them.
+ * Use (uid_t)0 here not sec_initial_uid()
+ * because of the RAW-SAMBA3HIDE test.
*/
- if (conn->admin_user)
+ if (get_current_uid(conn) == (uid_t)0) {
return False;
+ }
SMB_ASSERT(VALID_STAT(smb_fname->st));