summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-10-27 11:21:08 +0200
committerKarolin Seeger <kseeger@samba.org>2011-11-01 20:06:12 +0100
commit3b4268ff0929740a2845a02a5b6f2596ff31f7f9 (patch)
tree6d9078a644a8ced3d38f5b5240dfc1596a5792f0
parent110ee604f5d632a38af4a61295f7100fcfbd1d0a (diff)
downloadsamba-3b4268ff0929740a2845a02a5b6f2596ff31f7f9.tar.gz
samba-3b4268ff0929740a2845a02a5b6f2596ff31f7f9.tar.xz
samba-3b4268ff0929740a2845a02a5b6f2596ff31f7f9.zip
s3-netlogon: Fix setting the machinge account password.
This bug has been found with uid wrapper. (cherry picked from commit bda9752b1036c4d4db76a526a79a091419bf757c) Fix bug #8550 (Calls inside netr_set_machine_account_password() to set the machine account password must be done as root).
-rw-r--r--source3/rpc_server/netlogon/srv_netlog_nt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index aa424e052a9..ecdfac707b3 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -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;
}