summaryrefslogtreecommitdiffstats
path: root/adduser
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-09-11 08:36:54 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-09-11 08:36:54 +0000
commit819957f7ea299822251a135b822473764e0d2191 (patch)
tree1a47ea5d474654a244cb741d993135a0843cc241 /adduser
parent2403205018d063ee7d1dce72c3485da15dc97dcb (diff)
downloadpw-darwin-819957f7ea299822251a135b822473764e0d2191.tar.gz
pw-darwin-819957f7ea299822251a135b822473764e0d2191.tar.zst
pw-darwin-819957f7ea299822251a135b822473764e0d2191.zip
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 'adduser')
-rw-r--r--adduser/adduser.perl20
1 files changed, 16 insertions, 4 deletions
diff --git a/adduser/adduser.perl b/adduser/adduser.perl
index b205901..c757898 100644
--- a/adduser/adduser.perl
+++ b/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;