diff options
author | jkh <jkh@FreeBSD.org> | 1996-09-11 08:36:54 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-09-11 08:36:54 +0000 |
commit | 3ed54b53190eb2d5067017830ea88dcba03ff99e (patch) | |
tree | 413e6c430734e71f9a9735e6287111cc6beb8950 /usr.sbin | |
parent | c60a92f8855ee0dcbdb4f4cb2fd0fb607746ed8b (diff) | |
download | FreeBSD-src-3ed54b53190eb2d5067017830ea88dcba03ff99e.zip FreeBSD-src-3ed54b53190eb2d5067017830ea88dcba03ff99e.tar.gz |
Make passwords no longer echo or display. Because of this, we now also
ask for matching confirmation. I'm sure there is a clever direct-from-perl
ioctl way of putting the terminal into noecho mode, but I don't feel like
learning perl so I just used system. [yes, I'll put stty on the installation
boot floppy as necessary]
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/adduser/adduser.perl | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl index b205901a..c757898 100644 --- a/usr.sbin/adduser/adduser.perl +++ b/usr.sbin/adduser/adduser.perl @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: adduser.perl,v 1.15 1996/08/27 20:04:34 wosch Exp $ +# $Id: adduser.perl,v 1.16 1996/08/28 17:54:14 adam Exp $ # read variables @@ -520,7 +520,7 @@ sub new_users_ok { print <<EOF; Name: $name -Password: $password +Password: **** Fullname: $fullname Uid: $u_id Gid: $g_id ($group_login) @@ -645,9 +645,21 @@ sub new_users_password { local($password); while(1) { + system("stty -echo"); $password = &confirm_list("Enter password", 1, "", ""); - last if $password ne ""; - last if &confirm_yn("Use an empty password?", "yes"); + system("stty echo"); + print "\n"; + if ($password ne "") { + system("stty -echo"); + $newpass = &confirm_list("Enter password again", 1, "", ""); + system("stty echo"); + print "\n"; + last if $password eq $newpass; + print "They didn't match, please try again\n"; + } + elsif (&confirm_yn("Use an empty password?", "yes")) { + last; + } } return $password; |