[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre3-99-g1162b4f

Karolin Seeger kseeger at samba.org
Tue May 20 09:12:10 GMT 2008


The branch, v3-2-stable has been updated
       via  1162b4f5a16b937ead40ee7787489a22c868875f (commit)
       via  e0e7fae322cdcfe4f2c88c943a954e3da3d91605 (commit)
       via  df97bdf8a29f044e3c21df1fde9ca59652b01d9c (commit)
      from  ef8b620edc77b23a8849ec469768d8f220c4e895 (commit)

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


- Log -----------------------------------------------------------------
commit 1162b4f5a16b937ead40ee7787489a22c868875f
Author: Günther Deschner <gd at samba.org>
Date:   Wed Apr 23 10:55:26 2008 +0200

    rpcclient: Add tiny fix for cmd_samr_get_dispinfo_idx().
    
    Guenther
    (cherry picked from commit c15b5d73badafdc93066197aefaaaa72e37a8b99)

commit e0e7fae322cdcfe4f2c88c943a954e3da3d91605
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 22 23:11:53 2008 +0200

    rpcclient: Add getdispinfoidx command.
    
    Guenther
    (cherry picked from commit 7d8461d080c92a83bd7a8d168fdf1fe98e8bec9a)

commit df97bdf8a29f044e3c21df1fde9ca59652b01d9c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue May 6 15:06:12 2008 +0200

    Fix a memleak in construct_printer_info_7()
    
    Also fix a "ignoring asprintf result" warning
    (cherry picked from commit 64d21f39636019d6a17f84efc6fb9e61e67a235e)

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

Summary of changes:
 source/rpc_server/srv_spoolss_nt.c |    7 +++-
 source/rpcclient/cmd_samr.c        |   63 ++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index da1528f..a8aa339 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -4361,10 +4361,13 @@ static bool construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *p
 	struct GUID guid;
 
 	if (is_printer_published(print_hnd, snum, &guid)) {
-		asprintf(&guid_str, "{%s}",
-			 smb_uuid_string(talloc_tos(), guid));
+		if (asprintf(&guid_str, "{%s}",
+			     smb_uuid_string(talloc_tos(), guid)) == -1) {
+			return false;
+		}
 		strupper_m(guid_str);
 		init_unistr(&printer->guid, guid_str);
+		SAFE_FREE(guid_str);
 		printer->action = SPOOL_DS_PUBLISH;
 	} else {
 		init_unistr(&printer->guid, "");
diff --git a/source/rpcclient/cmd_samr.c b/source/rpcclient/cmd_samr.c
index e58354d..5523d2a 100644
--- a/source/rpcclient/cmd_samr.c
+++ b/source/rpcclient/cmd_samr.c
@@ -2565,6 +2565,68 @@ static NTSTATUS cmd_samr_chgpasswd3(struct rpc_pipe_client *cli,
 	return result;
 }
 
+static NTSTATUS cmd_samr_get_dispinfo_idx(struct rpc_pipe_client *cli,
+					  TALLOC_CTX *mem_ctx,
+					  int argc, const char **argv)
+{
+	NTSTATUS status;
+	struct policy_handle connect_handle;
+	struct policy_handle domain_handle;
+	uint16_t level = 1;
+	struct lsa_String name;
+	uint32_t idx = 0;
+
+	if (argc < 2 || argc > 3) {
+		printf("Usage: %s name level\n", argv[0]);
+		return NT_STATUS_INVALID_PARAMETER;
+	}
+
+	init_lsa_String(&name, argv[1]);
+
+	if (argc == 3) {
+		level = atoi(argv[2]);
+	}
+
+	status = rpccli_try_samr_connects(cli, mem_ctx,
+					  SEC_RIGHTS_MAXIMUM_ALLOWED,
+					  &connect_handle);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		goto done;
+	}
+
+	status = rpccli_samr_OpenDomain(cli, mem_ctx,
+					&connect_handle,
+					SEC_RIGHTS_MAXIMUM_ALLOWED,
+					&domain_sid,
+					&domain_handle);
+
+	if (!NT_STATUS_IS_OK(status))
+		goto done;
+
+
+	status = rpccli_samr_GetDisplayEnumerationIndex(cli, mem_ctx,
+							&domain_handle,
+							level,
+							&name,
+							&idx);
+
+	if (NT_STATUS_IS_OK(status) ||
+	    NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) {
+		printf("idx: %d (0x%08x)\n", idx, idx);
+	}
+ done:
+
+	if (is_valid_policy_hnd(&domain_handle)) {
+		rpccli_samr_Close(cli, mem_ctx, &domain_handle);
+	}
+	if (is_valid_policy_hnd(&connect_handle)) {
+		rpccli_samr_Close(cli, mem_ctx, &connect_handle);
+	}
+
+	return status;
+
+}
 /* List of commands exported by this module */
 
 struct cmd_set samr_commands[] = {
@@ -2602,5 +2664,6 @@ struct cmd_set samr_commands[] = {
 	{ "lookupdomain",       RPC_RTYPE_NTSTATUS, cmd_samr_lookup_domain,         NULL, PI_SAMR, NULL, "Lookup Domain Name", "" },
 	{ "chgpasswd2",         RPC_RTYPE_NTSTATUS, cmd_samr_chgpasswd2,            NULL, PI_SAMR, NULL, "Change user password", "" },
 	{ "chgpasswd3",         RPC_RTYPE_NTSTATUS, cmd_samr_chgpasswd3,            NULL, PI_SAMR, NULL, "Change user password", "" },
+	{ "getdispinfoidx",     RPC_RTYPE_NTSTATUS, cmd_samr_get_dispinfo_idx,      NULL, PI_SAMR, NULL, "Get Display Information Index", "" },
 	{ NULL }
 };


-- 
Samba Shared Repository


More information about the samba-cvs mailing list