summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2002-07-01 14:58:42 +0000
committerkrw <krw@openbsd.org>2002-07-01 14:58:42 +0000
commite74b59e8f7b596a7f5096df548a2a88857e5fe0c (patch)
treebc76f7993f5e9abd3f17ee78165a16ce78362a68
parentKNF + ansi; from zyrnix (only the easy part of his diffs) (diff)
downloadwireguard-openbsd-e74b59e8f7b596a7f5096df548a2a88857e5fe0c.tar.xz
wireguard-openbsd-e74b59e8f7b596a7f5096df548a2a88857e5fe0c.zip
Prevent passwords of the form '-X' from being (mis)interpreted as an
option to encrypt, by terminating option list with '--'. This generated an error during install and left root with a blank password. Mentioned a couple of months ago by Adrian Close, and dhartmei@ prodded me again today.
-rw-r--r--distrib/miniroot/install.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index fe184358517..ed9d6996b0a 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sh,v 1.104 2002/06/29 20:01:34 krw Exp $
+# $OpenBSD: install.sh,v 1.105 2002/07/01 14:58:42 krw Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -331,7 +331,7 @@ echo "...done."
remount_fs
-_encr=`/mnt/usr/bin/encrypt -b 7 "$_password"`
+_encr=`/mnt/usr/bin/encrypt -b 7 -- "$_password"`
echo "1,s@^root::@root:${_encr}:@
w
q" | ed /mnt/etc/master.passwd 2> /dev/null