summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/libwbclient/wbc_pam.c2
-rw-r--r--source3/nsswitch/wbinfo.c19
2 files changed, 19 insertions, 2 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_pam.c b/source3/nsswitch/libwbclient/wbc_pam.c
index 6385094235..c109625abf 100644
--- a/source3/nsswitch/libwbclient/wbc_pam.c
+++ b/source3/nsswitch/libwbclient/wbc_pam.c
@@ -309,7 +309,7 @@ wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
}
strncpy(request.data.auth.pass,
params->password.plaintext,
- sizeof(request.data.auth.user)-1);
+ sizeof(request.data.auth.pass)-1);
break;
case WBC_AUTH_USER_LEVEL_HASH:
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);