1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00

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]
This commit is contained in:
Jordan K. Hubbard 1996-09-11 08:36:54 +00:00
parent 99892d2317
commit 79b69435d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18243

View File

@ -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;