summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-02-08 18:12:18 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-02-08 18:12:18 +0000
commit3f429afd845f8e311ef9f094b08294a456b0f479 (patch)
tree1e4e889883a689b7b094b63078c5320160cd135c /sbin/dhclient/dhclient.c
parent5888968b5f6ade5a4b1c69470e8d2061f3813642 (diff)
Create dhclient lease files and dhcpd lease files with permissions 0640,
rather than 0000 and 0664 respectively. ok kettenis@ tedu@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 16053f9dc28..e8eb8a93f1f 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.291 2014/02/07 18:42:17 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.292 2014/02/08 18:12:17 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -563,7 +563,7 @@ main(int argc, char *argv[])
imsg_init(unpriv_ibuf, socket_fd[1]);
if ((fd = open(path_dhclient_db,
- O_RDONLY|O_EXLOCK|O_CREAT|O_NOFOLLOW, 0)) == -1)
+ O_RDONLY|O_EXLOCK|O_CREAT|O_NOFOLLOW, 0640)) == -1)
error("can't open and lock %s: %s", path_dhclient_db,
strerror(errno));
read_client_leases();
@@ -1733,7 +1733,7 @@ rewrite_option_db(struct client_lease *offered, struct client_lease *effective)
write_file(path_option_db,
O_WRONLY | O_CREAT | O_TRUNC | O_SYNC | O_EXLOCK | O_NOFOLLOW,
- 0, 0, 0, db, strlen(db));
+ S_IRUSR | S_IWUSR | S_IRGRP, 0, 0, db, strlen(db));
}
char *