The branch, v3-4-test has been updated
       via  e3dc0f5... s3: Fix bug 6338 -- net rpc trustdom list always display 
"none"
      from  12dcd59... docs: Fix Bug 6922: Add Registry patchfile for Win7 
domain join.

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


- Log -----------------------------------------------------------------
commit e3dc0f527700a8be5e239dacedb880ca88c47312
Author: Volker Lendecke <[email protected]>
Date:   Sun Nov 22 22:38:45 2009 +0100

    s3: Fix bug 6338 -- net rpc trustdom list always display "none"

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

Summary of changes:
 source3/utils/net_rpc.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 62c3faa..59dbf9f 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5958,6 +5958,7 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
        int i;
        struct lsa_DomainList dom_list;
        fstring pdc_name;
+       bool found_domain;
 
        /* trusting domains listing variables */
        struct policy_handle domain_hnd;
@@ -6042,6 +6043,8 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
         
        d_printf("Trusted domains list:\n\n");
 
+       found_domain = false;
+
        do {
                nt_status = rpccli_lsa_EnumTrustDom(pipe_hnd, mem_ctx,
                                                    &connect_hnd,
@@ -6059,16 +6062,19 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
                for (i = 0; i < dom_list.count; i++) {
                        print_trusted_domain(dom_list.domains[i].sid,
                                             dom_list.domains[i].name.string);
+                       found_domain = true;
                };
 
-               /*
-                * in case of no trusted domains say something rather
-                * than just display blank line
-                */
-               if (!dom_list.count) d_printf("none\n");
-
        } while (NT_STATUS_EQUAL(nt_status, STATUS_MORE_ENTRIES));
 
+       /*
+        * in case of no trusted domains say something rather
+        * than just display blank line
+        */
+       if (!found_domain) {
+               d_printf("none\n");
+       }
+
        /* close this connection before doing next one */
        nt_status = rpccli_lsa_Close(pipe_hnd, mem_ctx, &connect_hnd);
        if (NT_STATUS_IS_ERR(nt_status)) {
@@ -6131,6 +6137,8 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
         * perform actual enumeration
         */
 
+       found_domain = false;
+
        enum_ctx = 0;   /* reset enumeration context from last enumeration */
        do {
 
@@ -6153,6 +6161,8 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
 
                        char *str = CONST_DISCARD(char *, 
trusts->entries[i].name.string);
 
+                       found_domain = true;
+
                        /*
                         * get each single domain's sid (do we _really_ need 
this ?):
                         *  1) connect to domain's pdc
@@ -6193,10 +6203,12 @@ static int rpc_trustdom_list(struct net_context *c, int 
argc, const char **argv)
                        };
                };
 
-               if (!num_domains) d_printf("none\n");
-
        } while (NT_STATUS_EQUAL(nt_status, STATUS_MORE_ENTRIES));
 
+       if (!found_domain) {
+               d_printf("none\n");
+       }
+
        /* close opened samr and domain policy handles */
        nt_status = rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_hnd);
        if (!NT_STATUS_IS_OK(nt_status)) {


-- 
Samba Shared Repository

Reply via email to