[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2182-gd54456f

Günther Deschner gd at samba.org
Wed Feb 13 11:19:37 GMT 2008


The branch, v3-2-test has been updated
       via  d54456f3c42f123af5516c6f75c87b279fdc775f (commit)
       via  46d5989562bb771b3dcb2fdd197d2f90c3ff8653 (commit)
      from  a84bf0786f269b8514e0a08e32fa429cefabe1d3 (commit)

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


- Log -----------------------------------------------------------------
commit d54456f3c42f123af5516c6f75c87b279fdc775f
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jan 30 23:43:57 2008 +0100

    Use rpccli_netr_LogonControl() in rpcclient.
    
    Guenther

commit 46d5989562bb771b3dcb2fdd197d2f90c3ff8653
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 13 11:43:45 2008 +0100

    Remove redundant (and unused) set of samr opcodes.
    
    Guenther

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

Summary of changes:
 source/include/rpc_samr.h       |   71 ---------------------------------------
 source/rpcclient/cmd_netlogon.c |   56 +++++++++++++++++++++---------
 2 files changed, 39 insertions(+), 88 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h
index 62c6b16..cf60279 100644
--- a/source/include/rpc_samr.h
+++ b/source/include/rpc_samr.h
@@ -74,77 +74,6 @@ SamrTestPrivateFunctionsUser
 
 ********************************************************************/
 
-#define SAMR_CONNECT_ANON      0x00
-#define SAMR_CLOSE_HND         0x01
-#define SAMR_SET_SEC_OBJECT    0x02
-#define SAMR_QUERY_SEC_OBJECT  0x03
-
-#define SAMR_UNKNOWN_4         0x04 /* profile info? */
-#define SAMR_LOOKUP_DOMAIN     0x05
-#define SAMR_ENUM_DOMAINS      0x06
-#define SAMR_OPEN_DOMAIN       0x07
-#define SAMR_QUERY_DOMAIN_INFO 0x08
-#define SAMR_SET_DOMAIN_INFO   0x09
-
-#define SAMR_CREATE_DOM_GROUP  0x0a
-#define SAMR_ENUM_DOM_GROUPS   0x0b
-#define SAMR_ENUM_DOM_USERS    0x0d
-#define SAMR_CREATE_DOM_ALIAS  0x0e
-#define SAMR_ENUM_DOM_ALIASES  0x0f
-#define SAMR_QUERY_USERALIASES 0x10
-
-#define SAMR_LOOKUP_NAMES      0x11
-#define SAMR_LOOKUP_RIDS       0x12
-
-#define SAMR_OPEN_GROUP        0x13
-#define SAMR_QUERY_GROUPINFO   0x14
-#define SAMR_SET_GROUPINFO     0x15
-#define SAMR_ADD_GROUPMEM      0x16
-#define SAMR_DELETE_DOM_GROUP  0x17
-#define SAMR_DEL_GROUPMEM      0x18
-#define SAMR_QUERY_GROUPMEM    0x19
-#define SAMR_UNKNOWN_1A        0x1a
-
-#define SAMR_OPEN_ALIAS        0x1b
-#define SAMR_QUERY_ALIASINFO   0x1c
-#define SAMR_SET_ALIASINFO     0x1d
-#define SAMR_DELETE_DOM_ALIAS  0x1e
-#define SAMR_ADD_ALIASMEM      0x1f
-#define SAMR_DEL_ALIASMEM      0x20
-#define SAMR_QUERY_ALIASMEM    0x21
-
-#define SAMR_OPEN_USER         0x22
-#define SAMR_DELETE_DOM_USER   0x23
-#define SAMR_QUERY_USERINFO    0x24
-#define SAMR_SET_USERINFO2     0x25 /* this is SAMR_SET_USERINFO! */
-#define SAMR_QUERY_USERGROUPS  0x27
-
-#define SAMR_QUERY_DISPINFO    0x28
-#define SAMR_GET_DISPENUM_INDEX 0x29
-#define SAMR_UNKNOWN_2a        0x2a
-#define SAMR_UNKNOWN_2b        0x2b
-#define SAMR_GET_USRDOM_PWINFO 0x2c
-#define SAMR_REMOVE_SID_FOREIGN_DOMAIN        0x2d
-#define SAMR_QUERY_DOMAIN_INFO2  0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
-#define SAMR_UNKNOWN_2f        0x2f
-#define SAMR_QUERY_DISPINFO3   0x30 /* Alias for SAMR_QUERY_DISPINFO
-				       with info level 3 */
-#define SAMR_UNKNOWN_31        0x31
-#define SAMR_CREATE_USER       0x32
-#define SAMR_QUERY_DISPINFO4   0x33 /* Alias for SAMR_QUERY_DISPINFO
-				       with info level 4 */
-#define SAMR_ADDMULTI_ALIASMEM 0x34
-
-#define SAMR_UNKNOWN_35        0x35
-#define SAMR_UNKNOWN_36        0x36
-#define SAMR_CHGPASSWD_USER    0x37
-#define SAMR_GET_DOM_PWINFO    0x38
-#define SAMR_CONNECT           0x39
-#define SAMR_SET_USERINFO      0x3A /* this is SAMR_SET_USERINFO2! */
-#define SAMR_CONNECT4          0x3E
-#define SAMR_CHGPASSWD_USER3   0x3F
-#define SAMR_CONNECT5          0x40
-
 #define PASS_MUST_CHANGE_AT_NEXT_LOGON	0x01
 #define PASS_DONT_CHANGE_AT_NEXT_LOGON	0x00
 
diff --git a/source/rpcclient/cmd_netlogon.c b/source/rpcclient/cmd_netlogon.c
index a752003..b175357 100644
--- a/source/rpcclient/cmd_netlogon.c
+++ b/source/rpcclient/cmd_netlogon.c
@@ -348,30 +348,52 @@ static WERROR cmd_netlogon_dsr_getsitename(struct rpc_pipe_client *cli,
 	return WERR_OK;
 }
 
-static NTSTATUS cmd_netlogon_logon_ctrl(struct rpc_pipe_client *cli, 
-                                        TALLOC_CTX *mem_ctx, int argc, 
-                                        const char **argv)
+static WERROR cmd_netlogon_logon_ctrl(struct rpc_pipe_client *cli,
+				      TALLOC_CTX *mem_ctx, int argc,
+				      const char **argv)
 {
-#if 0
-	uint32 query_level = 1;
-#endif
-	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+	NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+	WERROR werr;
+	const char *logon_server = cli->cli->desthost;
+	enum netr_LogonControlCode function_code = 1;
+	uint32_t level = 1;
+	union netr_CONTROL_QUERY_INFORMATION info;
+
+	if (argc > 4) {
+		fprintf(stderr, "Usage: %s <logon_server> <function_code> "
+			"<level>\n", argv[0]);
+		return WERR_OK;
+	}
 
-	if (argc > 1) {
-		fprintf(stderr, "Usage: %s\n", argv[0]);
-		return NT_STATUS_OK;
+	if (argc >= 2) {
+		logon_server = argv[1];
 	}
 
-#if 0
-	result = cli_netlogon_logon_ctrl(cli, mem_ctx, query_level);
-	if (!NT_STATUS_IS_OK(result)) {
-		goto done;
+	if (argc >= 3) {
+		function_code = atoi(argv[2]);
+	}
+
+	if (argc >= 4) {
+		level = atoi(argv[3]);
+	}
+
+	status = rpccli_netr_LogonControl(cli, mem_ctx,
+					  logon_server,
+					  function_code,
+					  level,
+					  &info,
+					  &werr);
+	if (!NT_STATUS_IS_OK(status)) {
+		return ntstatus_to_werror(status);
+	}
+
+	if (!W_ERROR_IS_OK(werr)) {
+		return werr;
 	}
-#endif
 
 	/* Display results */
 
-	return result;
+	return werr;
 }
 
 /* Display sam synchronisation information */
@@ -852,7 +874,7 @@ struct cmd_set netlogon_commands[] = {
 	{ "dsr_getdcnameex2", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex2, PI_NETLOGON, NULL, "Get trusted DC name",     "" },
 	{ "dsr_getsitename", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getsitename, PI_NETLOGON, NULL, "Get sitename",     "" },
 	{ "dsr_getforesttrustinfo", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getforesttrustinfo, PI_NETLOGON, NULL, "Get Forest Trust Info",     "" },
-	{ "logonctrl",  RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl,  NULL, PI_NETLOGON, NULL, "Logon Control",       "" },
+	{ "logonctrl",  RPC_RTYPE_WERROR, NULL, cmd_netlogon_logon_ctrl, PI_NETLOGON, NULL, "Logon Control",       "" },
 	{ "samsync",    RPC_RTYPE_NTSTATUS, cmd_netlogon_sam_sync,    NULL, PI_NETLOGON, NULL, "Sam Synchronisation", "" },
 	{ "samdeltas",  RPC_RTYPE_NTSTATUS, cmd_netlogon_sam_deltas,  NULL, PI_NETLOGON, NULL, "Query Sam Deltas",    "" },
 	{ "samlogon",   RPC_RTYPE_NTSTATUS, cmd_netlogon_sam_logon,   NULL, PI_NETLOGON, NULL, "Sam Logon",           "" },


-- 
Samba Shared Repository


More information about the samba-cvs mailing list