mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s3-netlogon: Fix setting the machinge account password.
This bug has been found with uid wrapper. (cherry picked from commitbda9752b10
) Fix bug #8550 (Calls inside netr_set_machine_account_password() to set the machine account password must be done as root). (cherry picked from commit3b4268ff09
)
This commit is contained in:
parent
6f3fda8c85
commit
6cbf3638d5
@ -1120,6 +1120,7 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
|
||||
goto out;
|
||||
}
|
||||
|
||||
become_root();
|
||||
status = samr_find_machine_account(mem_ctx,
|
||||
h,
|
||||
account_name,
|
||||
@ -1127,6 +1128,7 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
|
||||
NULL,
|
||||
NULL,
|
||||
&user_handle);
|
||||
unbecome_root();
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
goto out;
|
||||
}
|
||||
@ -1170,12 +1172,14 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
|
||||
|
||||
info->info18 = info18;
|
||||
|
||||
become_root();
|
||||
status = dcerpc_samr_SetUserInfo2(h,
|
||||
mem_ctx,
|
||||
&user_handle,
|
||||
UserInternal1Information,
|
||||
info,
|
||||
&result);
|
||||
unbecome_root();
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user