summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-04 23:11:53 +0100
committerGünther Deschner <gd@samba.org>2008-01-07 12:48:21 +0100
commit6345220151c4b09380b0b461f51309c043052916 (patch)
tree9572b012dcea75f43c3d4fe8f77da91ccc936616 /source3
parentd82702c21881120726065240af6db0fac3c4fef6 (diff)
downloadsamba-6345220151c4b09380b0b461f51309c043052916.tar.gz
samba-6345220151c4b09380b0b461f51309c043052916.tar.bz2
samba-6345220151c4b09380b0b461f51309c043052916.zip
Only create machine account in libnetjoin when requested to.
Guenther (This used to be commit bc025a3860483e8cdbd0f61579689c9edadd3af0)
Diffstat (limited to 'source3')
-rw-r--r--source3/libnet/libnet_join.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 95b643ffa6..36d5c0a889 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -138,17 +138,21 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
strlower_m(acct_name);
const_acct_name = acct_name;
- status = rpccli_samr_create_dom_user(pipe_hnd, mem_ctx, &domain_pol,
- acct_name, ACB_WSTRUST,
- 0xe005000b, &user_pol, &user_rid);
- if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
- if (!(r->in.join_flags & WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED)) {
- goto done;
+ if (r->in.join_flags & WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE) {
+ status = rpccli_samr_create_dom_user(pipe_hnd, mem_ctx,
+ &domain_pol,
+ acct_name, ACB_WSTRUST,
+ 0xe005000b, &user_pol,
+ &user_rid);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
+ if (!(r->in.join_flags & WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED)) {
+ goto done;
+ }
}
- }
- if (NT_STATUS_IS_OK(status)) {
- rpccli_samr_close(pipe_hnd, mem_ctx, &user_pol);
+ if (NT_STATUS_IS_OK(status)) {
+ rpccli_samr_close(pipe_hnd, mem_ctx, &user_pol);
+ }
}
status = rpccli_samr_lookup_names(pipe_hnd, mem_ctx,