diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-06-16 16:17:17 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-06-16 16:17:17 +0000 |
commit | 0130c9137cea61e3309279b1ce04b5018ad92e83 (patch) | |
tree | ca002c6fa2ffe406a9774042a0794d734afecb10 /sbin | |
parent | 8a1b6c09c8dec181f68518b1e2554a8297fc01f6 (diff) |
always change the working directory of the priv child to the root
directory ("/"). this fixes a problem when dhclient was called in a
working directory like "/mnt" and the user tried to unmount this
directory while dhclient was still running. umount failed because the
device for "/mnt" was still busy and blocked by the running priv child
of dhclient.
ok henning@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 6482582bd47..fcd364d5794 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.85 2006/06/01 16:37:54 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.86 2006/06/16 16:17:16 reyk Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -2276,6 +2276,9 @@ fork_privchld(int fd, int fd2) return (0); } + if (chdir("/") == -1) + error("chdir(\"/\")"); + setproctitle("%s [priv]", ifi->name); dup2(nullfd, STDIN_FILENO); |