DIsplay the short domain name in "wbinfo -m " by default.
authorGerald W. Carter <jerry@samba.org>
Thu, 27 Mar 2008 20:23:36 +0000 (15:23 -0500)
committerGerald W. Carter <jerry@samba.org>
Mon, 31 Mar 2008 18:40:58 +0000 (13:40 -0500)
This fixes wbinfo -m to make preexisting behavior.
Also adds the dns domain to the --verbose output.
(This used to be commit b68caaa81bd75bb882c9363612d11d49dd73cb6f)

source3/nsswitch/wbinfo.c

index 63748de016e92418ab1318cae47bc084621df289..d62e82a659c989377f7fa95dc7bffaf866fa6f41 100644 (file)
@@ -374,9 +374,9 @@ static bool wbinfo_list_domains(bool list_all_domains, bool verbose)
                TALLOC_CTX *frame = talloc_stackframe();
 
                if (print_all) {
-                       d_printf("%-34s%-12s%-12s%-10s%-10s\n", 
-                           "Domain Name", " Trust Type", "Transitive", 
-                           "Incoming", "Outgoing");
+                       d_printf("%-16s%-24s%-12s%-12s%-5s%-5s\n", 
+                                "Domain Name", "DNS Domain", "Trust Type", 
+                                "Transitive", "In", "Out");
                }
 
                while(next_token_talloc(frame,&extra_data,&name,"\n")) {
@@ -388,16 +388,22 @@ static bool wbinfo_list_domains(bool list_all_domains, bool verbose)
                        if ((end = strchr(beg, '\\')) == NULL)
                                goto error;
                        *end = 0;
-                       if(*beg == 0)
-                               d_printf("%-34s", name);
-                       else 
-                               d_printf("%-34s", beg);
+
+                       /* Print short name */
+
+                       d_printf("%-16s", name);
 
                        if (!print_all) {
                                d_printf("\n"); 
                                continue;
                        }
 
+                       /* Print DNS domain */
+
+                       if (beg) {
+                               d_printf("%-24s", beg);
+                       }
+
                        /* Skip SID */
                        beg = ++end;
                        if ((end = strchr(beg, '\\')) == NULL)
@@ -408,7 +414,7 @@ static bool wbinfo_list_domains(bool list_all_domains, bool verbose)
                        if ((end = strchr(beg, '\\')) == NULL)
                                goto error;
                        *end = 0;
-                       d_printf(" %-12s", beg);
+                       d_printf("%-12s", beg);
 
                        /* Print Transitive */
                        beg = ++end;
@@ -422,11 +428,11 @@ static bool wbinfo_list_domains(bool list_all_domains, bool verbose)
                        if ((end = strchr(beg, '\\')) == NULL)
                                goto error;
                        *end = 0;
-                       d_printf("%-10s", beg);
+                       d_printf("%-5s", beg);
 
                        /* Print Outgoing */
                        beg = ++end;
-                       d_printf("%-10s\n", beg);
+                       d_printf("%-5s\n", beg);
                }
                goto out;