diff options
author | Jeremy Allison <jra@samba.org> | 2010-03-12 13:56:51 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-03-12 13:56:51 -0800 |
commit | e80ceb1d7355c8c46a2ed90d5721cf367640f4e8 (patch) | |
tree | a1172af1868d93449ac25d68576193a872e0bb50 /source3/smbd/dir.c | |
parent | 31b0417f7def5af5392088eec8fe6e77074d3da9 (diff) | |
download | samba-e80ceb1d7355c8c46a2ed90d5721cf367640f4e8.tar.gz samba-e80ceb1d7355c8c46a2ed90d5721cf367640f4e8.tar.bz2 samba-e80ceb1d7355c8c46a2ed90d5721cf367640f4e8.zip |
Remove more uses of "extern struct current_user current_user;".
Use accessor functions to get to this value. Tidies up much of
the user context code. Volker, please look at the changes in smbd/uid.c
to familiarize yourself with these changes as I think they make the
logic in there cleaner.
Cause smbd/posix_acls.c code to look at current user context, not
stored context on the conn struct - allows correct use of these
function calls under a become_root()/unbecome_root() pair.
Jeremy.
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r-- | source3/smbd/dir.c | 13 |
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)); |