summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-12-11 21:32:16 +0100
committerGünther Deschner <gd@samba.org>2007-12-21 15:29:10 +0100
commit4f6e8dfa51dfef72d13efc4acd3ede37d1f69eac (patch)
tree818d5986ae2b476d4508104b305578f28ebc0e26 /source3
parent5bf7319ac49a850288f2caaa60c248450d504348 (diff)
downloadsamba-4f6e8dfa51dfef72d13efc4acd3ede37d1f69eac.tar.gz
samba-4f6e8dfa51dfef72d13efc4acd3ede37d1f69eac.tar.bz2
samba-4f6e8dfa51dfef72d13efc4acd3ede37d1f69eac.zip
Fill in NetJoinDomainLocal().
Guenther (This used to be commit 4896f22bb50ea9ae0c4807ed9b2dd4283c254364)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/joindomain.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 1b951d7a5c..96983d43e3 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -32,7 +32,41 @@ static WERROR NetJoinDomainLocal(TALLOC_CTX *mem_ctx,
const char *password,
uint32_t join_flags)
{
- return WERR_NOT_SUPPORTED;
+ struct libnet_JoinCtx *r = NULL;
+ WERROR werr;
+
+ werr = libnet_init_JoinCtx(mem_ctx, &r);
+ W_ERROR_NOT_OK_RETURN(werr);
+
+ if (!server_name || !domain_name) {
+ return WERR_INVALID_PARAM;
+ }
+
+ r->in.server_name = talloc_strdup(mem_ctx, server_name);
+ W_ERROR_HAVE_NO_MEMORY(r->in.server_name);
+
+ r->in.domain_name = talloc_strdup(mem_ctx, domain_name);
+ W_ERROR_HAVE_NO_MEMORY(r->in.domain_name);
+
+ if (account_ou) {
+ r->in.account_ou = talloc_strdup(mem_ctx, account_ou);
+ W_ERROR_HAVE_NO_MEMORY(r->in.account_ou);
+ }
+
+ if (Account) {
+ r->in.admin_account = talloc_strdup(mem_ctx, Account);
+ W_ERROR_HAVE_NO_MEMORY(r->in.admin_account);
+ }
+
+ if (password) {
+ r->in.password = talloc_strdup(mem_ctx, password);
+ W_ERROR_HAVE_NO_MEMORY(r->in.password);
+ }
+
+ r->in.join_flags = join_flags;
+ r->in.modify_config = true;
+
+ return libnet_Join(mem_ctx, r);
}
static WERROR NetJoinDomainRemote(TALLOC_CTX *mem_ctx,