diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-06-14 11:18:13 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-06-18 08:59:17 +0200 |
commit | 4a97448cc9433a4a8e03f8efbe00a404d72c3616 (patch) | |
tree | 06061057831dd3bb08b647fa073096c7d514a1af /source3/smbd/process.c | |
parent | d1c8057997f97c6cd537496611dfae4e8b4af520 (diff) | |
download | samba-4a97448cc9433a4a8e03f8efbe00a404d72c3616.tar.gz |
smbd: let switch_message() only call chdir_current_service() for SMBtdis/SMBexit
These are the two opcodes with DO_CHDIR, we don't want the
set_current_case_sensitive() logic for them,
so we don't need the full set_current_service() anymore.
The AS_USER case is already handled before, set_current_case_sensitive()
is called directly before change_to_user(), which already
calls chdir_current_service().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 7babf4d5699..88362711632 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1654,11 +1654,14 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req) } } - if (!set_current_service(conn,SVAL(req->inbuf,smb_flg), - (flags & (AS_USER|DO_CHDIR) - ?True:False))) { - reply_nterror(req, NT_STATUS_ACCESS_DENIED); - return conn; + if (flags & DO_CHDIR) { + bool ok; + + ok = chdir_current_service(conn); + if (!ok) { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + return conn; + } } conn->num_smb_operations++; } |