This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[ira/wip.git] / source3 / nsswitch / wbinfo.c
index f779d6afb4c94ed763ce4fb3401dd049ab4c874c..772332ee59272fe981fb1675c4592765a0ad0cec 100644 (file)
@@ -298,18 +298,20 @@ static BOOL wbinfo_domain_info(const char *domain_name)
 
        /* Display response */
 
-       d_printf("Name    : %s\n", response.data.domain_info.name);
-       d_printf("Alt_Name: %s\n", response.data.domain_info.alt_name);
+       d_printf("Name              : %s\n", response.data.domain_info.name);
+       d_printf("Alt_Name          : %s\n", response.data.domain_info.alt_name);
 
-       d_printf("SID     : %s\n", response.data.domain_info.sid);
+       d_printf("SID               : %s\n", response.data.domain_info.sid);
 
-       d_printf("Native  : %s\n",
+       d_printf("Active Directory  : %s\n",
+                response.data.domain_info.active_directory ? "Yes" : "No");
+       d_printf("Native            : %s\n",
                 response.data.domain_info.native_mode ? "Yes" : "No");
 
-       d_printf("Primary : %s\n",
+       d_printf("Primary           : %s\n",
                 response.data.domain_info.primary ? "Yes" : "No");
 
-       d_printf("Sequence: %d\n", response.data.domain_info.sequence_number);
+       d_printf("Sequence          : %d\n", response.data.domain_info.sequence_number);
 
        return True;
 }
@@ -482,7 +484,7 @@ static BOOL wbinfo_lookupname(char *name)
 
        /* Display response */
 
-       d_printf("%s %d\n", response.data.sid.sid, response.data.sid.type);
+       d_printf("%s %s (%d)\n", response.data.sid.sid, sid_type_lookup(response.data.sid.type), response.data.sid.type);
 
        return True;
 }
@@ -909,21 +911,21 @@ static void wbinfo_get_auth_user(void)
        char *user, *domain, *password;
 
        /* Lift data from secrets file */
+       
+       secrets_fetch_ipc_userpass(&user, &domain, &password);
 
-       secrets_init();
-
-       user = secrets_fetch(SECRETS_AUTH_USER, NULL);
-       domain = secrets_fetch(SECRETS_AUTH_DOMAIN, NULL);
-       password = secrets_fetch(SECRETS_AUTH_PASSWORD, NULL);
+       if ((!user || !*user) && (!domain || !*domain ) && (!password || !*password)){
 
-       if (!user && !domain && !password) {
+               SAFE_FREE(user);
+               SAFE_FREE(domain);
+               SAFE_FREE(password);
                d_printf("No authorised user configured\n");
                return;
        }
 
        /* Pretty print authorised user info */
 
-       d_printf("%s%s%s%s%s\n", domain ? domain : "", domain ? "\\" : "",
+       d_printf("%s%s%s%s%s\n", domain ? domain : "", domain ? lp_winbind_separator(): "",
                 user, password ? "%" : "", password ? password : "");
 
        SAFE_FREE(user);
@@ -990,8 +992,7 @@ int main(int argc, char **argv)
                { "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
                { "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
                { "sequence", 0, POPT_ARG_NONE, 0, OPT_SEQUENCE, "Show sequence numbers of all domains" },
-               { "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D',
-                 "Show all most info we have about the domain" },
+               { "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D', "Show most of the info we have about the domain" },
                { "user-groups", 'r', POPT_ARG_STRING, &string_arg, 'r', "Get user groups", "USER" },
                { "user-sids", 0, POPT_ARG_STRING, &string_arg, OPT_USERSIDS, "Get user group sids for user SID", "SID" },
                { "authenticate", 'a', POPT_ARG_STRING, &string_arg, 'a', "authenticate user", "user%password" },
@@ -1178,7 +1179,7 @@ int main(int argc, char **argv)
                        break;
                case 'O':
                        if ( !wbinfo_remove_user_from_group(string_arg) ) {
-                               d_printf("Could not remove user kfrom group\n");
+                               d_printf("Could not remove user from group\n");
                                goto done;
                        }
                        break;