From 0130c9137cea61e3309279b1ce04b5018ad92e83 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 16 Jun 2006 16:17:17 +0000 Subject: 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@ --- sbin/dhclient/dhclient.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin') 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 @@ -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); -- cgit v1.2.3