summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-05-13 23:57:26 +0200
committerGünther Deschner <gd@samba.org>2009-06-16 12:13:53 +0200
commit33be1f56f778116a5657b257ffb0f1eb7196658a (patch)
tree84d545100aeb251d5ec013638828fae8a7d1046f /source3/lib/netapi
parent2f884753dd9fea349adfd826b14780129d5fdd06 (diff)
downloadsamba-33be1f56f778116a5657b257ffb0f1eb7196658a.tar.gz
samba-33be1f56f778116a5657b257ffb0f1eb7196658a.tar.bz2
samba-33be1f56f778116a5657b257ffb0f1eb7196658a.zip
s3-netapi: Fix Bug #6305. Correctly prompt for a password when a username was given.
When no callback or wrapping has managed to get a password, prompt in the netapi connection manager for a password. Guenther
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/cm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index d28b2b2126..55f5350821 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -42,8 +42,12 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
}
auth_info->signing_state = Undefined;
set_cmdline_auth_info_use_kerberos(auth_info, ctx->use_kerberos);
- set_cmdline_auth_info_password(auth_info, ctx->password);
set_cmdline_auth_info_username(auth_info, ctx->username);
+ if (ctx->password) {
+ set_cmdline_auth_info_password(auth_info, ctx->password);
+ } else {
+ set_cmdline_auth_info_getpass(auth_info);
+ }
if (ctx->username && ctx->username[0] &&
ctx->password && ctx->password[0] &&