wbinfo: fix ouptput of --lookup-sids for sids of type DOMAIN
authorMichael Adam <obnox@samba.org>
Sat, 21 Sep 2013 08:35:57 +0000 (10:35 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 13 Nov 2013 10:40:28 +0000 (11:40 +0100)
To print only the domain name and not "DOMIN\<SID>".

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
nsswitch/wbinfo.c

index c3e3ad3274389035fb6a7e1d8e6bfe8327d58fbe..0a7fa965be4b5eecaceac599b40349e487904ce4 100644 (file)
@@ -1393,9 +1393,15 @@ static bool wbinfo_lookup_sids(const char *arg)
        for (i=0; i<num_sids; i++) {
                wbcSidToStringBuf(&sids[i], sidstr, sizeof(sidstr));
 
-               d_printf("%s -> %s\\%s %d\n", sidstr,
-                        domains[names[i].domain_index].short_name,
-                        names[i].name, names[i].type);
+               if (names[i].type == WBC_SID_NAME_DOMAIN) {
+                       d_printf("%s -> %s %d\n", sidstr,
+                                domains[names[i].domain_index].short_name,
+                                names[i].type);
+               } else {
+                       d_printf("%s -> %s\\%s %d\n", sidstr,
+                                domains[names[i].domain_index].short_name,
+                                names[i].name, names[i].type);
+               }
        }
        wbcFreeMemory(names);
        wbcFreeMemory(domains);