wbinfo: fix output of wbinfo --sid-to-name for sids of type DOMAIN
[nivanova/samba-autobuild/.git] / 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);