svn commit: samba r4934 - in trunk/source/rpcclient: .

vlendec at samba.org vlendec at samba.org
Sat Jan 22 17:12:37 GMT 2005


Author: vlendec
Date: 2005-01-22 17:12:33 +0000 (Sat, 22 Jan 2005)
New Revision: 4934

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4934

Log:
List not only the first 10 trusts with rpcclient -c enumtrust.

Volker

Modified:
   trunk/source/rpcclient/cmd_lsarpc.c


Changeset:
Modified: trunk/source/rpcclient/cmd_lsarpc.c
===================================================================
--- trunk/source/rpcclient/cmd_lsarpc.c	2005-01-22 17:12:19 UTC (rev 4933)
+++ trunk/source/rpcclient/cmd_lsarpc.c	2005-01-22 17:12:33 UTC (rev 4934)
@@ -278,23 +278,29 @@
 	if (!NT_STATUS_IS_OK(result))
 		goto done;
 
-	/* Lookup list of trusted domains */
+	result = STATUS_MORE_ENTRIES;
 
-	result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx,
-					&num_domains,
-					&domain_names, &domain_sids);
-	if (!NT_STATUS_IS_OK(result) &&
-	    !NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) &&
-	    !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES))
-	    goto done;
+	while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) {
 
-	/* Print results: list of names and sids returned in this response. */	 
-	for (i = 0; i < num_domains; i++) {
-		fstring sid_str;
+		/* Lookup list of trusted domains */
 
-		sid_to_string(sid_str, &domain_sids[i]);
-		printf("%s %s\n", domain_names[i] ? domain_names[i] : 
-		       "*unknown*", sid_str);
+		result = cli_lsa_enum_trust_dom(cli, mem_ctx, &pol, &enum_ctx,
+						&num_domains,
+						&domain_names, &domain_sids);
+		if (!NT_STATUS_IS_OK(result) &&
+		    !NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) &&
+		    !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES))
+			goto done;
+
+		/* Print results: list of names and sids returned in this
+		 * response. */	 
+		for (i = 0; i < num_domains; i++) {
+			fstring sid_str;
+
+			sid_to_string(sid_str, &domain_sids[i]);
+			printf("%s %s\n", domain_names[i] ? domain_names[i] : 
+			       "*unknown*", sid_str);
+		}
 	}
 
  done:



More information about the samba-cvs mailing list