summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-06-19 00:42:05 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-06-19 00:42:05 +0000
commit59a867a89ace440ac875e5d4df4993f13fad8333 (patch)
tree9d56d4d3b7ade7463a56f6e13784293d0f5e0816 /distrib/miniroot
parentfcc34cc91b833983b66186433cc04304a8b671f0 (diff)
Don't create bogus hosts file entries if too few parameters are
passed to addhostent(). Noticed by sthen@ and jsing@. ok halex@ deraadt@
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sub4
1 files changed, 3 insertions, 1 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 25e9ef34c53..a3ab3683859 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.586 2009/06/12 08:25:57 halex Exp $
+# $OpenBSD: install.sub,v 1.587 2009/06/19 00:42:04 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -505,6 +505,8 @@ makedev() {
addhostent() {
local _addr=$1 _name=$2 _delim="."
+ [[ -z $_addr || -z $_name ]] && return
+
[[ $_addr == *:* ]] && _delim=":"
sed "/^[0-9a-fA-F]*[$_delim].*[ ]$_name\$/d" /tmp/hosts \