diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-08-06 11:07:38 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-08-06 11:07:38 +0000 |
commit | fa603da22369d3c02b4e9abfe239c4513bd91156 (patch) | |
tree | 5c2754c9b7f53cbf55ccce91b79cdfe0f6996ef2 /usr.sbin/dhcpd | |
parent | bb0414af227b4bb81baa9dc300e3ddf48d1c7735 (diff) |
Use pw->pw_dir when chroot'ing, not _PATH_VAREMPTY.
Brings various dhcp related daemons into line with
the common idiom.
ok florian@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r-- | usr.sbin/dhcpd/dhcpd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c index 16d59222b91..b3562dce34f 100644 --- a/usr.sbin/dhcpd/dhcpd.c +++ b/usr.sbin/dhcpd/dhcpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.c,v 1.56 2017/02/16 00:24:43 krw Exp $ */ +/* $OpenBSD: dhcpd.c,v 1.57 2019/08/06 11:07:37 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org> @@ -48,7 +48,6 @@ #include <err.h> #include <netdb.h> -#include <paths.h> #include <pwd.h> #include <stdio.h> #include <stdlib.h> @@ -245,8 +244,8 @@ main(int argc, char *argv[]) icmp_startup(1, lease_pinged); - if (chroot(_PATH_VAREMPTY) == -1) - fatal("chroot %s", _PATH_VAREMPTY); + if (chroot(pw->pw_dir) == -1) + fatal("chroot %s", pw->pw_dir); if (chdir("/") == -1) fatal("chdir(\"/\")"); if (setgroups(1, &pw->pw_gid) || |