diff options
author | Günther Deschner <gd@samba.org> | 2007-12-14 17:37:24 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2007-12-21 15:29:10 +0100 |
commit | c5a84374b6b2af7adff807a739fb1dc279bd4a58 (patch) | |
tree | d89196a1acebe1123bd45a05ad6296ea3af16468 /source3/libnet | |
parent | 41410c86cc698f997dd82a143fd92277060384b0 (diff) | |
download | samba-c5a84374b6b2af7adff807a739fb1dc279bd4a58.tar.gz samba-c5a84374b6b2af7adff807a739fb1dc279bd4a58.tar.bz2 samba-c5a84374b6b2af7adff807a739fb1dc279bd4a58.zip |
Make sure we also support non-domain join.
Guenther
(This used to be commit c818f5505a124a6f0bb9274a1ba4a6147d2f17b3)
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index ce5b1b7b10..dd3d2254d8 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -250,6 +250,16 @@ static WERROR do_modify_vals_config(TALLOC_CTX *mem_ctx, WERROR werr; bool is_ad = false; + if (!(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE)) { + + werr = do_modify_val_config(key, "security", "user"); + W_ERROR_NOT_OK_RETURN(werr); + + werr = do_modify_val_config(key, "workgroup", + r->in.domain_name); + return werr; + } + if (r->out.dns_domain_name) { is_ad = true; } @@ -273,8 +283,8 @@ static WERROR do_modify_vals_config(TALLOC_CTX *mem_ctx, return werr; } -static WERROR do_DomainJoinConfig(TALLOC_CTX *mem_ctx, - struct libnet_JoinCtx *r) +static WERROR do_JoinConfig(TALLOC_CTX *mem_ctx, + struct libnet_JoinCtx *r) { WERROR werr; struct registry_key *key = NULL; @@ -342,13 +352,18 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx, return WERR_NOT_SUPPORTED; } - werr = do_DomainJoin(mem_ctx, r); + if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) { + werr = do_DomainJoin(mem_ctx, r); + if (!W_ERROR_IS_OK(werr)) { + return werr; + } + } + + werr = do_JoinConfig(mem_ctx, r); if (!W_ERROR_IS_OK(werr)) { return werr; } - werr = do_DomainJoinConfig(mem_ctx, r); - return werr; } |