summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-06-03 18:59:45 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-06-03 18:59:45 +0000
commit358a087edc42851bcd9fa6f72ba0a78dbde8f2c2 (patch)
tree4f6c99b42462f8c20fca8b1077b7046a09846a48
parentaccbe40d0762bc7853cc30c5d7dc8e45ebfb2d17 (diff)
fall back to "nobody" when the _dhcp user is not available, theo bob ok
-rw-r--r--sbin/dhclient/dhclient.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index cfb4bb7d888..5540fafafa4 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.52 2004/05/13 07:19:32 henning Exp $ */
+/* $OpenBSD: dhclient.c,v 1.53 2004/06/03 18:59:44 henning Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -283,8 +283,11 @@ main(int argc, char *argv[])
if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
error("cannot open %s: %m", _PATH_DEVNULL);
- if ((pw = getpwnam("_dhcp")) == NULL)
- error("no such user: _dhcp");
+ if ((pw = getpwnam("_dhcp")) == NULL) {
+ warning("no such user: _dhcp, falling back to \"nobody\"");
+ if ((pw = getpwnam("nobody")) == NULL)
+ error("no such user: nobody");
+ }
if (pipe(pipe_fd) == -1)
error("pipe");