summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-19 15:32:37 +0200
committerGünther Deschner <gd@samba.org>2008-08-19 15:33:36 +0200
commit833af26eebb5aa3cc8c6e0a05e2b7c70bbe62d4e (patch)
tree23e4b2154f10e3fbd386bd4218b13b3786443d55 /source3/nsswitch
parent1cef895f4be7d7a2cb8872adba30c82d490a70e1 (diff)
downloadsamba-833af26eebb5aa3cc8c6e0a05e2b7c70bbe62d4e.tar.gz
samba-833af26eebb5aa3cc8c6e0a05e2b7c70bbe62d4e.tar.bz2
samba-833af26eebb5aa3cc8c6e0a05e2b7c70bbe62d4e.zip
wbinfo: add wbinfo_prompt_pass.
Guenther (This used to be commit 7cf6ed68236e7dd64657cb1087a5a687d6f59ad1)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index c1d41a53fd..3ae3d218f4 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -879,6 +879,33 @@ static bool wbinfo_lookupname(const char *full_name)
return true;
}
+static char *wbinfo_prompt_pass(const char *prefix,
+ const char *username)
+{
+ char *prompt;
+ const char *ret = NULL;
+
+ prompt = talloc_asprintf(talloc_tos(), "Enter %s's ", username);
+ if (!prompt) {
+ return NULL;
+ }
+ if (prefix) {
+ prompt = talloc_asprintf_append(prompt, "%s ", prefix);
+ if (!prompt) {
+ return NULL;
+ }
+ }
+ prompt = talloc_asprintf_append(prompt, "password: ");
+ if (!prompt) {
+ return NULL;
+ }
+
+ ret = getpass(prompt);
+ TALLOC_FREE(prompt);
+
+ return SMB_STRDUP(ret);
+}
+
/* Authenticate a user with a plaintext password */
static bool wbinfo_auth_krb5(char *username, const char *cctype, uint32 flags)