aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2013-07-03 22:19:43 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2013-07-03 22:19:43 +0000
commitfe5c7163949407d331a122214b4aea12c09db48d (patch)
tree6c65d2cd9ed36c774bd6004d1ae854d1ca7f0528 /sbin
parentf73ac8b9deb031a5f6a2a762910fe0f627d5dfe5 (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 34ff85300a7e..ead20b42fbda 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1842,6 +1842,11 @@ rewrite_client_leases(void)
leaseFile = fopen(path_dhclient_db, "w");
if (!leaseFile)
error("can't create %s: %m", path_dhclient_db);
+ if (cap_rights_limit(fileno(leaseFile), CAP_FSTAT | CAP_FSYNC |
+ CAP_FTRUNCATE | CAP_SEEK | CAP_WRITE) < 0 &&
+ errno != ENOSYS) {
+ error("can't limit lease descriptor: %m");
+ }
} else {
fflush(leaseFile);
rewind(leaseFile);