diff options
author | Kai Blin <kai@samba.org> | 2009-08-12 23:41:32 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2009-08-18 19:53:38 +0200 |
commit | fa7d7a49b8de543cd6ac60ed5ae175a4becc598e (patch) | |
tree | 5df5a6cc62e7876ff77a1c94bef25f5f548306c0 /nsswitch | |
parent | 49d1eec8ea02519ed9851812f96f4675abdf34b6 (diff) | |
download | samba-fa7d7a49b8de543cd6ac60ed5ae175a4becc598e.tar.gz samba-fa7d7a49b8de543cd6ac60ed5ae175a4becc598e.tar.bz2 samba-fa7d7a49b8de543cd6ac60ed5ae175a4becc598e.zip |
s3 wbinfo: remove --get-auth-user and --set-auth-user functionality
Point to the corresponding commands in "net" instead.
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/wbinfo.c | 95 |
1 files changed, 6 insertions, 89 deletions
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c index 415d0591df..5fede6bc32 100644 --- a/nsswitch/wbinfo.c +++ b/nsswitch/wbinfo.c @@ -1569,99 +1569,15 @@ static bool print_domain_groups(const char *domain) static bool wbinfo_set_auth_user(char *username) { - const char *password; - char *p; - fstring user, domain; - - /* Separate into user and password */ - - parse_wbinfo_domain_user(username, domain, user); - - p = strchr(user, '%'); - - if (p != NULL) { - *p = 0; - password = p+1; - } else { - char *thepass = getpass("Password: "); - if (thepass) { - password = thepass; - } else - password = ""; - } - - /* Store or remove DOMAIN\username%password in secrets.tdb */ - - secrets_init(); - - if (user[0]) { - - if (!secrets_store(SECRETS_AUTH_USER, user, - strlen(user) + 1)) { - d_fprintf(stderr, "error storing username\n"); - return false; - } - - /* We always have a domain name added by the - parse_wbinfo_domain_user() function. */ - - if (!secrets_store(SECRETS_AUTH_DOMAIN, domain, - strlen(domain) + 1)) { - d_fprintf(stderr, "error storing domain name\n"); - return false; - } - - } else { - secrets_delete(SECRETS_AUTH_USER); - secrets_delete(SECRETS_AUTH_DOMAIN); - } - - if (password[0]) { - - if (!secrets_store(SECRETS_AUTH_PASSWORD, password, - strlen(password) + 1)) { - d_fprintf(stderr, "error storing password\n"); - return false; - } - - } else - secrets_delete(SECRETS_AUTH_PASSWORD); - - return true; + d_fprintf(stderr, "This functionality was moved to the 'net' utility.\n" + "See 'net help setauthuser' for details.\n"); + return false; } static void wbinfo_get_auth_user(void) { - char *user, *domain, *password; - char separator[] = {'\0', '\0'}; - - /* Lift data from secrets file */ - - secrets_fetch_ipc_userpass(&user, &domain, &password); - - if ((!user || !*user) && (!domain || !*domain ) && - (!password || !*password)){ - - SAFE_FREE(user); - SAFE_FREE(domain); - SAFE_FREE(password); - d_printf("No authorised user configured\n"); - return; - } - - /* Pretty print authorised user info */ - - if (domain) { - separator[0] = winbind_separator(); - } - - d_printf("%s%s%s%s%s\n", domain ? domain : "", - separator, user, - password ? "%" : "", password ? password : ""); - - SAFE_FREE(user); - SAFE_FREE(domain); - SAFE_FREE(password); + d_fprintf(stderr, "This functionality was moved to the 'net' utility.\n" + "See 'net help getauthuser' for details.\n"); } static bool wbinfo_ping(void) @@ -2170,6 +2086,7 @@ int main(int argc, char **argv, char **envp) break; case OPT_GET_AUTH_USER: wbinfo_get_auth_user(); + goto done; break; case OPT_GETDCNAME: if (!wbinfo_getdcname(string_arg)) { |