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/open.c | |
parent | 31b0417f7def5af5392088eec8fe6e77074d3da9 (diff) | |
download | samba-e80ceb1d7355c8c46a2ed90d5721cf367640f4e8.tar.gz samba-e80ceb1d7355c8c46a2ed90d5721cf367640f4e8.tar.xz 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/open.c')
-rw-r--r-- | source3/smbd/open.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index fd9796dbf4f..3eb727f96bd 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. */ |