mirror of
https://github.com/samba-team/samba.git
synced 2025-10-19 23:33:15 +03:00
s3: Use root_mode() to get uid_wrapper working correctly.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
committed by
Stefan Metzmacher
parent
15feb84273
commit
6118c2ec2c
@@ -170,7 +170,7 @@ bool regkey_access_check(struct registry_key_handle *key, uint32 requested,
|
||||
WERROR err;
|
||||
|
||||
/* root free-pass, like we have on all other pipes like samr, lsa, etc. */
|
||||
if (geteuid() == sec_initial_uid()) {
|
||||
if (root_mode()) {
|
||||
*granted = REG_KEY_ALL;
|
||||
return true;
|
||||
}
|
||||
|
@@ -505,7 +505,7 @@ void *_policy_handle_find(struct pipes_struct *p,
|
||||
return NULL;
|
||||
}
|
||||
if ((access_required & rpc_hnd->access_granted) != access_required) {
|
||||
if (geteuid() == sec_initial_uid()) {
|
||||
if (root_mode()) {
|
||||
DEBUG(4, ("%s: ACCESS should be DENIED (granted: "
|
||||
"%#010x; required: %#010x)\n", location,
|
||||
rpc_hnd->access_granted, access_required));
|
||||
|
@@ -2644,7 +2644,7 @@ static NTSTATUS get_user_info_18(struct pipes_struct *p,
|
||||
if (ret == False) {
|
||||
DEBUG(4, ("User %s not found\n", sid_string_dbg(user_sid)));
|
||||
TALLOC_FREE(smbpass);
|
||||
return (geteuid() == sec_initial_uid()) ? NT_STATUS_NO_SUCH_USER : NT_STATUS_ACCESS_DENIED;
|
||||
return root_mode() ? NT_STATUS_NO_SUCH_USER : NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
DEBUG(3,("User:[%s] 0x%x\n", pdb_get_username(smbpass), pdb_get_acct_ctrl(smbpass) ));
|
||||
@@ -3683,7 +3683,7 @@ NTSTATUS _samr_CreateUser2(struct pipes_struct *p,
|
||||
|
||||
/* determine which user right we need to check based on the acb_info */
|
||||
|
||||
if (geteuid() == sec_initial_uid()) {
|
||||
if (root_mode()) {
|
||||
can_add_account = true;
|
||||
} else if (acb_info & ACB_WSTRUST) {
|
||||
needed_priv = SEC_PRIV_MACHINE_ACCOUNT;
|
||||
|
@@ -64,7 +64,7 @@ NTSTATUS access_check_object( struct security_descriptor *psd, struct security_t
|
||||
}
|
||||
|
||||
/* Check if we are root */
|
||||
if (geteuid() == sec_initial_uid()) {
|
||||
if (root_mode()) {
|
||||
is_root = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user