mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
smbd: don't call change_to_root_user() before change_to_guest()
This is just an optimization and it makes it clearer that calling change_to_root_user() just before change_to_guest() is useless and confusing. We call change_to_guest() before set_current_service() now, but that has no impact as we pass 'do_chdir=false' as AS_GUEST is never mixed with AS_USER or DO_CHDIR. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jun 14 23:38:55 CEST 2018 on sn-devel-144
This commit is contained in:
parent
9393d95f22
commit
5ef6775919
@ -1624,6 +1624,15 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
|
|||||||
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
|
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
} else if (flags & AS_GUEST) {
|
||||||
|
/*
|
||||||
|
* Does this protocol need to be run as guest? (Only archane
|
||||||
|
* messenger service requests have this...)
|
||||||
|
*/
|
||||||
|
if (!change_to_guest()) {
|
||||||
|
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* This call needs to be run as root */
|
/* This call needs to be run as root */
|
||||||
change_to_root_user();
|
change_to_root_user();
|
||||||
@ -1656,17 +1665,6 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
|
|||||||
conn->num_smb_operations++;
|
conn->num_smb_operations++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Does this protocol need to be run as guest? (Only archane
|
|
||||||
* messenger service requests have this...)
|
|
||||||
*/
|
|
||||||
if (flags & AS_GUEST) {
|
|
||||||
if (!change_to_guest()) {
|
|
||||||
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update encryption and signing state tracking flags that are
|
* Update encryption and signing state tracking flags that are
|
||||||
* used by smbstatus to display signing and encryption status.
|
* used by smbstatus to display signing and encryption status.
|
||||||
|
Loading…
Reference in New Issue
Block a user