summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-27 16:45:04 +0200
committerGünther Deschner <gd@samba.org>2008-05-27 16:48:03 +0200
commitb7f745b20012d236167c75fb082ae43f75be1ab5 (patch)
tree9e608a56d55bfb256349a941b5c62eaec42a8e46 /source3/nsswitch
parent7cc9b5c5a12a84a3ac386cbff0b5174151202bff (diff)
downloadsamba-b7f745b20012d236167c75fb082ae43f75be1ab5.tar.gz
samba-b7f745b20012d236167c75fb082ae43f75be1ab5.tar.bz2
samba-b7f745b20012d236167c75fb082ae43f75be1ab5.zip
wbinfo: prompt for password when none has been given.
Guenther (This used to be commit 7c1f36d84a4c5779ea86923be69e209d0c9c0943)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 7bb4abe9b2..2fb46c4a2f 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -958,7 +958,14 @@ static bool wbinfo_auth(char *username)
p++;
password = p;
} else {
- password = "";
+ char *prompt;
+ asprintf(&prompt, "Enter %s's password:", username);
+ if (!prompt) {
+ return false;
+ }
+
+ password = getpass(prompt);
+ SAFE_FREE(prompt);
}
name = s;
@@ -1001,6 +1008,16 @@ static bool wbinfo_auth_crap(char *username)
if (p) {
*p = 0;
fstrcpy(pass, p + 1);
+ } else {
+ char *prompt;
+ asprintf(&prompt, "Enter %s's password:", username);
+ if (!prompt) {
+ return false;
+ }
+
+ fstrcpy(pass, getpass(prompt));
+ SAFE_FREE(prompt);
+
}
parse_wbinfo_domain_user(username, name_domain, name_user);