summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/dhclient-script
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2006-01-26 21:05:39 +0000
committerbrooks <brooks@FreeBSD.org>2006-01-26 21:05:39 +0000
commit7ba1cf1d5431763a5b0bcdca837d494731aefd4b (patch)
tree9ef9e2766937467dbbd95e238c92d3036bfa3e13 /sbin/dhclient/dhclient-script
parent998c2ee892689a421b718d82f1773f89f0c0043e (diff)
downloadFreeBSD-src-7ba1cf1d5431763a5b0bcdca837d494731aefd4b.zip
FreeBSD-src-7ba1cf1d5431763a5b0bcdca837d494731aefd4b.tar.gz
Fix rev 1.12.
/tmp may not be writeable yet when dhclient is first run via /etc/rc.d/netif so using it may not work. Also, writing to a predictable file in /tmp as root is a really bad idea since a malicious user may be able to win a race and insert a symlink which will allow them to cause any file to be overwritten. To solve these problems, create the tempory file in /var/run which will exist this early and is writable only by root. Security: Local risk if users can cause dhclient to run on demand (such as by unplugging and replugging the network cable).
Diffstat (limited to 'sbin/dhclient/dhclient-script')
-rw-r--r--sbin/dhclient/dhclient-script2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script
index da2a99b..ced527d 100644
--- a/sbin/dhclient/dhclient-script
+++ b/sbin/dhclient/dhclient-script
@@ -135,7 +135,7 @@ add_new_resolv_conf() {
# thus broke the script. This code creates the resolv.conf if either
# are provided.
- local tmpres=${TMPDIR:-/tmp}/resolv.conf.std
+ local tmpres=/var/run/resolv.conf.${interface}
rm -f $tmpres
if [ -n "$new_domain_name" ]; then
OpenPOWER on IntegriCloud