summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbitblt <bitblt@cvs.openbsd.org>1998-02-16 16:04:42 +0000
committerbitblt <bitblt@cvs.openbsd.org>1998-02-16 16:04:42 +0000
commit6665f6b98c6c6963f728a0d11c8d346c331762ec (patch)
treeb92890ae1665265d4a1c8747d32a840e4aca0df7 /usr.sbin
parent0501c762bb0df77208d895fbe91a5dea44f4e863 (diff)
Shell metacharacters are now ok in user passwords, as per the first half
of PR 402
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/adduser/adduser.perl9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index c1a52edfd14..5d360e28a0d 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/adduser/adduser.perl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# $OpenBSD: adduser.perl,v 1.5 1997/05/29 04:26:56 gene Exp $
+# $OpenBSD: adduser.perl,v 1.6 1998/02/16 16:04:41 bitblt Exp $
#
# Copyright (c) 1995-1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
# All rights reserved.
@@ -921,6 +921,7 @@ sub salt {
sub encrypt {
local($pass, $salt) = ($_[0], $_[1]);
local $args, $crypt;
+ local $goodpass;
if ($encryptionmethod eq "des") {
$args = "-s $salt";
@@ -930,7 +931,9 @@ sub encrypt {
$args = "-b $salt";
}
- $crypt = `encrypt $args $pass`;
+ $pass =~ s/(.)/\\$1/g;
+
+ $crypt = `/usr/bin/encrypt $args $pass`;
chop $crypt;
return($crypt);
}
@@ -1440,7 +1443,7 @@ sub config_write {
print C <<EOF;
#
-# $OpenBSD: adduser.perl,v 1.5 1997/05/29 04:26:56 gene Exp $
+# $OpenBSD: adduser.perl,v 1.6 1998/02/16 16:04:41 bitblt Exp $
# $config - automatic generated by adduser(8)
#
# Note: adduser read *and* write this file.