s3-netapi: Fix Bug #6305. Correctly prompt for a password when a username was given.
authorGünther Deschner <gd@samba.org>
Wed, 13 May 2009 21:57:26 +0000 (23:57 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 16 Jun 2009 10:13:53 +0000 (12:13 +0200)
When no callback or wrapping has managed to get a password, prompt in the
netapi connection manager for a password.

Guenther

source3/lib/netapi/cm.c

index d28b2b21263b5e7488c8ed9f6dc28160cbeaff0c..55f5350821bbc6bc39c27291b5a46a397f835067 100644 (file)
@@ -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] &&