diff options
author | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-09-03 11:04:24 +0000 |
---|---|---|
committer | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-09-03 11:04:24 +0000 |
commit | 2491cdeb2d5c1a0dd38e03c5d76b3b9b084aa643 (patch) | |
tree | 16e07e2e2dce00e54ac11d95f34cfbf7b22bf050 /libexec/login_radius | |
parent | 96753c3ba1c3d981e4f608e1412a902224c519f2 (diff) |
convert to use readpassphrase() instead of DEPRECATED/getpass()
OK millert@
Diffstat (limited to 'libexec/login_radius')
-rw-r--r-- | libexec/login_radius/raddauth.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libexec/login_radius/raddauth.c b/libexec/login_radius/raddauth.c index 5261e377f49..a98a88ca78e 100644 --- a/libexec/login_radius/raddauth.c +++ b/libexec/login_radius/raddauth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raddauth.c,v 1.28 2015/10/05 17:31:17 millert Exp $ */ +/* $OpenBSD: raddauth.c,v 1.29 2016/09/03 11:04:23 gsoares Exp $ */ /*- * Copyright (c) 1996, 1997 Berkeley Software Design, Inc. All rights reserved. @@ -85,6 +85,7 @@ #include <time.h> #include <unistd.h> #include <md5.h> +#include <readpassphrase.h> #include "login_radius.h" @@ -148,6 +149,7 @@ raddauth(char *username, char *class, char *style, char *challenge, static char _pwstate[1024]; u_char req_id; char *userstyle, *passwd, *pwstate, *rad_service; + char pbuf[AUTH_PASS_LEN+1]; int auth_port; char vector[AUTH_VECTOR_LEN+1], *p, *v; int i; @@ -191,7 +193,8 @@ raddauth(char *username, char *class, char *style, char *challenge, v = p+1; } if (passwd == NULL) - passwd = getpass("Password:"); + passwd = readpassphrase("Password:", pbuf, sizeof(pbuf), + RPP_ECHO_OFF); } else passwd = password; if (passwd == NULL) @@ -316,7 +319,8 @@ retry: return (0); } req_id++; - if ((passwd = getpass("")) == NULL) + if ((passwd = readpassphrase("", pbuf, sizeof(pbuf), + RPP_ECHO_OFF)) == NULL) passwd = ""; break; |