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
commit4521a1ce27fa351513fad279228994f89caefe7f (patch)
tree6247fc3b4ee32aaa52fb751b650b26701bd1140c /adduser
parentd664473d0879712041d27892016371dcef1d2600 (diff)
downloadpw-darwin-4521a1ce27fa351513fad279228994f89caefe7f.tar.gz
pw-darwin-4521a1ce27fa351513fad279228994f89caefe7f.tar.zst
pw-darwin-4521a1ce27fa351513fad279228994f89caefe7f.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;