smbget: Use new samba_getpass() function.
authorAndreas Schneider <asn@samba.org>
Fri, 23 Nov 2012 13:38:14 +0000 (14:38 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 3 Dec 2012 13:35:10 +0000 (14:35 +0100)
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
source3/utils/smbget.c

index d60a13fd69bc056b185c31cd3d5c5e26b5d7c41f..207746f5d4b0f2f8ba6dea954ed1b3a130e467d3 100644 (file)
@@ -109,13 +109,12 @@ static void get_auth_data(const char *srv, const char *shr, char *wg, int wglen,
        } else if(username) strncpy(un, username, unlen-1);
 
        if(!nonprompt && !password) {
-               char *prompt, *pass;
+               char *prompt;
                if (asprintf(&prompt, "Password for %s at %s: ", shr, srv) == -1) {
                        return;
                }
-               pass = getpass(prompt);
+               (void) samba_getpass(prompt, pw, pwlen, false, false);
                free(prompt);
-               strncpy(pw, pass, pwlen-1);
        } else if(password) strncpy(pw, password, pwlen-1);
 
        if(workgroup)strncpy(wg, workgroup, wglen-1);