[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-417-g09e01a4

Volker Lendecke vl at sernet.de
Fri Nov 30 21:22:34 GMT 2007


The branch, v3-2-test has been updated
       via  09e01a47164702f67403e61bc478d1cb54f0508e (commit)
       via  a41f9aef843378b1f85f9b3d672d00f3399fa342 (commit)
       via  58d49023b9bc7d27e770f18a25cc6cebdc95b300 (commit)
       via  177dab0ce31970c851531ffd2a6c5946e329a048 (commit)
       via  7cea527e8712cde34378ae8b32aad1e4aab0c17b (commit)
       via  fd9d73ad44b0f0b3656a50a663b60aa26e7f7376 (commit)
       via  2d5236cc37fe015ce9098a0ebe99cdc0ca3537ae (commit)
       via  7f021b3cb7845c6eb142668f66599886cd92182f (commit)
       via  b350e482b9b211caf08c22c7528b51e47b4a5cce (commit)
       via  88a01bd810c36631272c5db727334bdc6f12f07d (commit)
       via  08a5a036ba97d1f4830d73e95b8369aa9e6683e8 (commit)
       via  6bf2c8038c4bc7a52b7f260209ade0bdeb95c685 (commit)
       via  258ef17a266548bc02bed1870fd4ef5a272300b3 (commit)
       via  b1d36cdb86978cb31d470fccf2dc24d366835c36 (commit)
      from  0ae61e26547e594e94037d4474a008221e5df8cf (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 09e01a47164702f67403e61bc478d1cb54f0508e
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 20:33:51 2007 +0100

    Avoid to include net prototypes, just reference user creds.
    
    Guenther

commit a41f9aef843378b1f85f9b3d672d00f3399fa342
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 20:21:37 2007 +0100

    Add "net dom" command suite to "net".
    
    Guenther

commit 58d49023b9bc7d27e770f18a25cc6cebdc95b300
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 20:20:54 2007 +0100

    Add "net dom unjoin" code.
    
    Guenther

commit 177dab0ce31970c851531ffd2a6c5946e329a048
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 20:20:18 2007 +0100

    Add "net dom join" code.
    
    Guenther

commit 7cea527e8712cde34378ae8b32aad1e4aab0c17b
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 20:18:46 2007 +0100

    Add header file for NetJoinDomain() and friends.
    
    Guenther

commit fd9d73ad44b0f0b3656a50a663b60aa26e7f7376
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 19:57:08 2007 +0100

    Add NetUnjoinDomain().
    
    Guenther

commit 2d5236cc37fe015ce9098a0ebe99cdc0ca3537ae
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 19:56:41 2007 +0100

    Robustness-fixes for NetJoinDomain().
    
    Guenther

commit 7f021b3cb7845c6eb142668f66599886cd92182f
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 19:55:40 2007 +0100

    Give NetJoinDomain() enough time to finish.
    
    Guenther

commit b350e482b9b211caf08c22c7528b51e47b4a5cce
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 19:52:27 2007 +0100

    domain_name is a ref pointer.
    
    Guenther

commit 88a01bd810c36631272c5db727334bdc6f12f07d
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 19:46:25 2007 +0100

    Merge join error codes from Samba 4.
    
    Guenther

commit 08a5a036ba97d1f4830d73e95b8369aa9e6683e8
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 18:49:21 2007 +0100

    Add NetJoinDomain call.
    
    Guenther

commit 6bf2c8038c4bc7a52b7f260209ade0bdeb95c685
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 18:47:25 2007 +0100

    Move param helper routines to one place.
    
    Guenther

commit 258ef17a266548bc02bed1870fd4ef5a272300b3
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 14:34:33 2007 +0100

    Make encode_wkssvc_join_password_buffer() non-static.
    
    Guenther

commit b1d36cdb86978cb31d470fccf2dc24d366835c36
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 30 14:05:53 2007 +0100

    Merge encode_wkssvc_join_password_buffer() from samba4.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in                                 |    8 +-
 source/include/doserr.h                            |    5 +
 source/lib/netapi/joindomain.c                     |  185 ++++++++++++++++++++
 .../{libgpo/gpo_ini.h => lib/netapi/joindomain.h}  |   26 ++--
 source/libsmb/doserr.c                             |    3 +
 source/libsmb/smbencrypt.c                         |   36 ++++
 source/param/util.c                                |   50 ++++++
 source/utils/net.c                                 |    1 +
 source/utils/net_ads.c                             |   14 --
 source/utils/net_dom.c                             |  168 ++++++++++++++++++
 source/utils/net_groupmap.c                        |   31 ----
 source/utils/net_help.c                            |    1 +
 12 files changed, 465 insertions(+), 63 deletions(-)
 create mode 100644 source/lib/netapi/joindomain.c
 copy source/{libgpo/gpo_ini.h => lib/netapi/joindomain.h} (66%)
 create mode 100644 source/param/util.c
 create mode 100644 source/utils/net_dom.c


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 4cec671..4eea8f1 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -318,7 +318,7 @@ READLINE_OBJ = lib/readline.o
 # Be sure to include them into your application
 POPT_LIB_OBJ = lib/popt_common.o
 
-PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o lib/sharesec.o
+PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o
 PARAM_REG_ADD_OBJ = $(UTIL_REG_API_OBJ)
 PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)
 
@@ -706,6 +706,8 @@ REG_API_OBJ = registry/reg_api.o \
 	      $(UTIL_REG_API_OBJ) \
 	      $(UTIL_REG_SMBCONF_OBJ)
 
+NETAPI_OBJ = lib/netapi/joindomain.o
+
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
 	   utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
 	   utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
@@ -715,7 +717,7 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_domain.o utils/net_help.o \
 	   utils/netlookup.o utils/net_sam.o utils/net_rpc_shell.o \
 	   utils/net_util.o utils/net_rpc_sh_acct.o utils/net_rpc_audit.o \
 	   $(PASSWD_UTIL_OBJ) utils/net_dns.o utils/net_ads_gpo.o \
-	   utils/net_conf.o auth/token_util.o
+	   utils/net_conf.o auth/token_util.o utils/net_dom.o
 
 NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
 	  $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
@@ -725,7 +727,7 @@ NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
 	  $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
 	  $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
 	  $(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
-	  $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ)
+	  $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(NETAPI_OBJ)
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
 	  $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
diff --git a/source/include/doserr.h b/source/include/doserr.h
index 6e29faf..a22eda2 100644
--- a/source/include/doserr.h
+++ b/source/include/doserr.h
@@ -217,6 +217,11 @@
 #define WERR_DEST_NOT_FOUND W_ERROR(2152)
 #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320)
 #define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453)
+
+#define WERR_SETUP_ALREADY_JOINED W_ERROR(2691)
+#define WERR_SETUP_NOT_JOINED W_ERROR(2692)
+#define WERR_SETUP_DOMAIN_CONTROLLER W_ERROR(2693)
+
 #define WERR_DEVICE_NOT_AVAILABLE W_ERROR(4319)
 #define WERR_STATUS_MORE_ENTRIES   W_ERROR(0x0105)
 
diff --git a/source/lib/netapi/joindomain.c b/source/lib/netapi/joindomain.c
new file mode 100644
index 0000000..e0986ce
--- /dev/null
+++ b/source/lib/netapi/joindomain.c
@@ -0,0 +1,185 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  NetApi Join Support
+ *  Copyright (C) Guenther Deschner 2007
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+
+extern const char *opt_user_name;
+extern const char *opt_workgroup;
+extern const char *opt_password;
+
+WERROR NetJoinDomain(const char *server_name,
+		     const char *domain_name,
+		     const char *account_ou,
+		     const char *Account,
+		     const char *password,
+		     uint32_t join_flags)
+{
+	TALLOC_CTX *mem_ctx = NULL;
+	struct cli_state *cli = NULL;
+	struct rpc_pipe_client *pipe_cli = NULL;
+	struct wkssvc_PasswordBuffer encrypted_password;
+	NTSTATUS status;
+	WERROR werr;
+	unsigned int old_timeout;
+
+	ZERO_STRUCT(encrypted_password);
+
+	mem_ctx = talloc_init("NetJoinDomain");
+	if (!mem_ctx) {
+		werr = WERR_NOMEM;
+		goto done;
+	}
+
+	if (!server_name || is_myname_or_ipaddr(server_name)) {
+		werr = WERR_NOT_SUPPORTED;
+		goto done;
+	}
+
+	if (!domain_name) {
+		werr = WERR_INVALID_PARAM;
+		goto done;
+	}
+
+	status = cli_full_connection(&cli, NULL, server_name,
+				     NULL, 0,
+				     "IPC$", "IPC",
+				     opt_user_name, opt_workgroup,
+				     opt_password, 0, Undefined, NULL);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	}
+
+	old_timeout = cli_set_timeout(cli, 60000);
+
+	pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC,
+					    &status);
+	if (!pipe_cli) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	};
+
+	if (password) {
+		encode_wkssvc_join_password_buffer(mem_ctx,
+						   password,
+						   &cli->user_session_key,
+						   &encrypted_password);
+	}
+
+	old_timeout = cli_set_timeout(cli, 60000);
+
+	status = rpccli_wkssvc_NetrJoinDomain2(pipe_cli, mem_ctx,
+					       server_name, domain_name,
+					       account_ou, Account,
+					       &encrypted_password,
+					       join_flags);
+	if (!NT_STATUS_IS_OK(status)) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	}
+
+	werr = WERR_OK;
+
+ done:
+	if (cli) {
+		cli_set_timeout(cli, old_timeout);
+		cli_shutdown(cli);
+	}
+	TALLOC_FREE(mem_ctx);
+
+	return werr;
+}
+
+WERROR NetUnjoinDomain(const char *server_name,
+		       const char *account,
+		       const char *password,
+		       uint32_t unjoin_flags)
+{
+	TALLOC_CTX *mem_ctx = NULL;
+	struct cli_state *cli = NULL;
+	struct rpc_pipe_client *pipe_cli = NULL;
+	struct wkssvc_PasswordBuffer encrypted_password;
+	NTSTATUS status;
+	WERROR werr;
+	unsigned int old_timeout;
+
+	ZERO_STRUCT(encrypted_password);
+
+	mem_ctx = talloc_init("NetUnjoinDomain");
+	if (!mem_ctx) {
+		werr = WERR_NOMEM;
+		goto done;
+	}
+
+	if (!server_name || is_myname_or_ipaddr(server_name)) {
+		werr = WERR_NOT_SUPPORTED;
+		goto done;
+	}
+
+	status = cli_full_connection(&cli, NULL, server_name,
+				     NULL, 0,
+				     "IPC$", "IPC",
+				     opt_user_name, opt_workgroup,
+				     opt_password, 0, Undefined, NULL);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	}
+
+	old_timeout = cli_set_timeout(cli, 60000);
+
+	pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC,
+					    &status);
+	if (!pipe_cli) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	};
+
+	if (password) {
+		encode_wkssvc_join_password_buffer(mem_ctx,
+						   password,
+						   &cli->user_session_key,
+						   &encrypted_password);
+	}
+
+	old_timeout = cli_set_timeout(cli, 60000);
+
+	status = rpccli_wkssvc_NetrUnjoinDomain2(pipe_cli, mem_ctx,
+						 server_name,
+						 account,
+						 &encrypted_password,
+						 unjoin_flags);
+	if (!NT_STATUS_IS_OK(status)) {
+		werr = ntstatus_to_werror(status);
+		goto done;
+	}
+
+	werr = WERR_OK;
+
+ done:
+	if (cli) {
+		cli_set_timeout(cli, old_timeout);
+		cli_shutdown(cli);
+	}
+	TALLOC_FREE(mem_ctx);
+
+	return werr;
+}
diff --git a/source/libgpo/gpo_ini.h b/source/lib/netapi/joindomain.h
similarity index 66%
copy from source/libgpo/gpo_ini.h
copy to source/lib/netapi/joindomain.h
index fa03dba..2c71702 100644
--- a/source/libgpo/gpo_ini.h
+++ b/source/lib/netapi/joindomain.h
@@ -1,6 +1,6 @@
 /*
  *  Unix SMB/CIFS implementation.
- *  Group Policy Support
+ *  NetApi Support
  *  Copyright (C) Guenther Deschner 2007
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -17,17 +17,13 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-/* FIXME: get rid of iniparser */
-#include <iniparser.h>
-
-struct gp_inifile_context {
-	TALLOC_CTX *mem_ctx;
-	dictionary *dict;
-	const char *generated_filename;
-};
-
-/* prototypes */
-
-NTSTATUS gp_inifile_init_context(TALLOC_CTX *mem_ctx, uint32_t flags,
-				 const char *unix_path, const char *suffix,
-				 struct gp_inifile_context **ctx_ret);
+WERROR NetJoinDomain(const char *server,
+		     const char *domain,
+		     const char *account_ou,
+		     const char *account,
+		     const char *password,
+		     uint32_t join_options);
+WERROR NetUnjoinDomain(const char *server_name,
+		       const char *account,
+		       const char *password,
+		       uint32_t unjoin_flags);
diff --git a/source/libsmb/doserr.c b/source/libsmb/doserr.c
index 478b87d..84cc898 100644
--- a/source/libsmb/doserr.c
+++ b/source/libsmb/doserr.c
@@ -69,6 +69,9 @@ werror_code_struct dos_errs[] =
 	{ "WERR_DFS_CANT_CREATE_JUNCT", WERR_DFS_CANT_CREATE_JUNCT },
 	{ "WERR_MACHINE_LOCKED", WERR_MACHINE_LOCKED },
 	{ "WERR_DOMAIN_CONTROLLER_NOT_FOUND", WERR_DOMAIN_CONTROLLER_NOT_FOUND },
+	{ "WERR_SETUP_NOT_JOINED", WERR_SETUP_NOT_JOINED },
+	{ "WERR_SETUP_ALREADY_JOINED", WERR_SETUP_ALREADY_JOINED },
+	{ "WERR_SETUP_DOMAIN_CONTROLLER", WERR_SETUP_DOMAIN_CONTROLLER },
 	{ "WERR_DEVICE_NOT_AVAILABLE", WERR_DEVICE_NOT_AVAILABLE },
 	{ "WERR_LOGON_FAILURE", WERR_LOGON_FAILURE },
 	{ "WERR_NO_SUCH_DOMAIN", WERR_NO_SUCH_DOMAIN },
diff --git a/source/libsmb/smbencrypt.c b/source/libsmb/smbencrypt.c
index 77ff063..6060669 100644
--- a/source/libsmb/smbencrypt.c
+++ b/source/libsmb/smbencrypt.c
@@ -694,3 +694,39 @@ char *decrypt_trustdom_secret(const char *pass, DATA_BLOB *data_in)
 
 }
 
+/* encode a wkssvc_PasswordBuffer:
+ *
+ * similar to samr_CryptPasswordEx. Different: 8byte confounder (instead of
+ * 16byte), confounder in front of the 516 byte buffer (instead of after that
+ * buffer), calling MD5Update() first with session_key and then with confounder
+ * (vice versa in samr) - Guenther */
+
+void encode_wkssvc_join_password_buffer(TALLOC_CTX *mem_ctx,
+					const char *pwd,
+					DATA_BLOB *session_key,
+					struct wkssvc_PasswordBuffer *pwd_buf)
+{
+	uint8_t buffer[516];
+	struct MD5Context ctx;
+
+	DATA_BLOB confounded_session_key = data_blob_talloc(mem_ctx, NULL, 16);
+
+	int confounder_len = 8;
+	uint8_t confounder[8];
+
+	encode_pw_buffer(buffer, pwd, STR_UNICODE);
+
+	generate_random_buffer((uint8_t *)confounder, confounder_len);
+
+	MD5Init(&ctx);
+	MD5Update(&ctx, session_key->data, session_key->length);
+	MD5Update(&ctx, confounder, confounder_len);
+	MD5Final(confounded_session_key.data, &ctx);
+
+	SamOEMhashBlob(buffer, 516, &confounded_session_key);
+
+	memcpy(&pwd_buf->data[0], confounder, confounder_len);
+	memcpy(&pwd_buf->data[8], buffer, 516);
+
+	data_blob_free(&confounded_session_key);
+}
diff --git a/source/param/util.c b/source/param/util.c
new file mode 100644
index 0000000..f953484
--- /dev/null
+++ b/source/param/util.c
@@ -0,0 +1,50 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  param helper routines
+ *  Copyright (C) Gerald Carter                2003
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+
+/*********************************************************
+ utility function to parse an integer parameter from
+ "parameter = value"
+**********************************************************/
+uint32 get_int_param( const char* param )
+{
+	char *p;
+
+	p = strchr( param, '=' );
+	if ( !p )
+		return 0;
+
+	return atoi(p+1);
+}
+
+/*********************************************************
+ utility function to parse an integer parameter from
+ "parameter = value"
+**********************************************************/
+char* get_string_param( const char* param )
+{
+	char *p;
+
+	p = strchr( param, '=' );
+	if ( !p )
+		return NULL;
+
+	return (p+1);
+}
diff --git a/source/utils/net.c b/source/utils/net.c
index 8015358..ee671f6 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -940,6 +940,7 @@ static struct functable net_func[] = {
 	{"TIME", net_time},
 	{"LOOKUP", net_lookup},
 	{"JOIN", net_join},
+	{"DOM", net_dom},
 	{"CACHE", net_cache},
 	{"GETLOCALSID", net_getlocalsid},
 	{"SETLOCALSID", net_setlocalsid},
diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c
index ac8f794..d54b817 100644
--- a/source/utils/net_ads.c
+++ b/source/utils/net_ads.c
@@ -1430,20 +1430,6 @@ static NTSTATUS net_update_dns(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads)
 
 
 /*******************************************************************
- utility function to parse an integer parameter from
- "parameter = value"
-**********************************************************/
-static char* get_string_param( const char* param )
-{
-	char *p;
-
-	if ( (p = strchr( param, '=' )) == NULL )
-		return NULL;
-
-	return (p+1);
-}
-
-/*******************************************************************
  ********************************************************************/
 
 static int net_ads_join_usage(int argc, const char **argv)
diff --git a/source/utils/net_dom.c b/source/utils/net_dom.c
new file mode 100644
index 0000000..79130a8
--- /dev/null
+++ b/source/utils/net_dom.c
@@ -0,0 +1,168 @@
+/*
+   Samba Unix/Linux SMB client library
+   net dom commands for remote join/unjoin
+   Copyright (C) 2007 Günther Deschner
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "utils/net.h"
+#include "lib/netapi/joindomain.h"
+
+static int net_dom_usage(int argc, const char **argv)
+{
+	d_printf("usage: net dom join "
+		 "<domain=DOMAIN> <ou=OU> <account=ACCOUNT> <password=PASSWORD> <reboot>\n");
+	d_printf("usage: net dom unjoin "
+		 "<account=ACCOUNT> <password=PASSWORD> <reboot>\n");
+
+	return -1;
+}
+
+int net_help_dom(int argc, const char **argv)
+{
+	d_printf("net dom join"\
+		"\n  Join a remote machine\n");
+	d_printf("net dom unjoin"\
+		"\n  Unjoin a remote machine\n");
+
+	return -1;
+}
+
+static int net_dom_unjoin(int argc, const char **argv)
+{
+	const char *server_name = NULL;
+	const char *account = NULL;
+	const char *password = NULL;
+	uint32_t unjoin_flags = WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE |
+				WKSSVC_JOIN_FLAGS_JOIN_TYPE;
+	bool reboot = false;
+	WERROR werr;
+	int i;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list