[PATCH 13/16] smbget: Use new samba_getpass() function.

Andreas Schneider asn at samba.org
Tue Nov 27 04:23:53 MST 2012


Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source3/utils/smbget.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index d60a13f..207746f 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -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);
-- 
1.8.0




More information about the samba-technical mailing list