wbinfo: fix output of wbinfo --sid-to-name for sids of type DOMAIN
authorMichael Adam <obnox@samba.org>
Sat, 21 Sep 2013 19:02:00 +0000 (21:02 +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 04478a7551976a69d4f6b4a0122d97c88245ed3c..61acd1aa9e1ba6bbc6480a6df19dc50ca1a28604 100644 (file)
@@ -1222,8 +1222,12 @@ static bool wbinfo_lookupsid(const char *sid_str)
 
        /* Display response */
 
-       d_printf("%s%c%s %d\n",
-                domain, winbind_separator(), name, type);
+       if (type == WBC_SID_NAME_DOMAIN) {
+               d_printf("%s %d\n", domain, type);
+       } else {
+               d_printf("%s%c%s %d\n",
+                        domain, winbind_separator(), name, type);
+       }
 
        wbcFreeMemory(domain);
        wbcFreeMemory(name);