summaryrefslogtreecommitdiff
path: root/source4/lib/cmdline
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-05-03 20:23:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:35 -0500
commit1789976c172085569026e62bc563ff0ea017fe9d (patch)
treed58a52341eb7d75a42fa86a930ec158b8a22798d /source4/lib/cmdline
parent5d689a5de2d6ddfbab1753ff219d9d55cb009cac (diff)
downloadsamba-1789976c172085569026e62bc563ff0ea017fe9d.tar.gz
samba-1789976c172085569026e62bc563ff0ea017fe9d.tar.bz2
samba-1789976c172085569026e62bc563ff0ea017fe9d.zip
r15420: Add a new function to print a the 'unparsed' string format for usernames.
This is used in the password prompt, and should be reversable by the parse string function. Also, don't look at the ccache, even for the guess code, if kerberos is disabled. Andrew Bartlett (This used to be commit 4c4b8e4b396ca44270a0456c732d3b9c3c34d69d)
Diffstat (limited to 'source4/lib/cmdline')
-rw-r--r--source4/lib/cmdline/credentials.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/source4/lib/cmdline/credentials.c b/source4/lib/cmdline/credentials.c
index b2ec67a72e..3bf0a15677 100644
--- a/source4/lib/cmdline/credentials.c
+++ b/source4/lib/cmdline/credentials.c
@@ -24,27 +24,14 @@
static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
{
- char *prompt;
char *ret;
- const char *domain;
- const char *username;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
- const char *bind_dn = cli_credentials_get_bind_dn(credentials);
-
- if (bind_dn) {
- prompt = talloc_asprintf(mem_ctx, "Password for [%s]:",
- bind_dn);
- } else {
- cli_credentials_get_ntlm_username_domain(credentials, mem_ctx, &username, &domain);
- if (domain && domain[0]) {
- prompt = talloc_asprintf(mem_ctx, "Password for [%s\\%s]:",
- domain, username);
- } else {
- prompt = talloc_asprintf(mem_ctx, "Password for [%s]:",
- username);
- }
- }
+ const char *prompt_name = cli_credentials_get_unparsed_name(credentials, mem_ctx);
+ const char *prompt;
+
+ prompt = talloc_asprintf(mem_ctx, "Password for [%s]:",
+ prompt_name);
ret = getpass(prompt);