summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2014-01-17 23:11:43 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2014-01-17 23:11:43 +0000
commit3d8af209b5eeacc2b0349d46f2f4a6e5a4345e1d (patch)
tree326c5d1be0a1bb560aecf3f1cf398a778269727a /sbin/dhclient/dhclient.c
parentefe37d4f67fca115749074bf82371666bc511b3c (diff)
Do not follow symlinks for -l and -L arguments.
ok krw@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 684d19c5ea4..fc3af8f4b4b 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.282 2014/01/16 21:41:22 tobias Exp $ */
+/* $OpenBSD: dhclient.c,v 1.283 2014/01/17 23:11:42 tobias Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -563,7 +563,8 @@ main(int argc, char *argv[])
error("no memory for unpriv_ibuf");
imsg_init(unpriv_ibuf, socket_fd[1]);
- if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1)
+ if ((fd = open(path_dhclient_db,
+ O_RDONLY|O_EXLOCK|O_CREAT|O_NOFOLLOW, 0)) == -1)
error("can't open and lock %s: %s", path_dhclient_db,
strerror(errno));
read_client_leases();
@@ -1729,7 +1730,7 @@ rewrite_option_db(struct client_lease *offered, struct client_lease *effective)
warning("cannot make effective lease into string");
write_file(path_option_db,
- O_WRONLY | O_CREAT | O_TRUNC | O_SYNC | O_EXLOCK,
+ O_WRONLY | O_CREAT | O_TRUNC | O_SYNC | O_EXLOCK | O_NOFOLLOW,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, 0, 0, db, strlen(db));
}