summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-11-28 11:47:29 +0000
committerRoy Marples <roy@marples.name>2019-11-28 11:47:29 +0000
commitb75c7a3fb31198da2b983a58220e2fe163a66eb1 (patch)
treec37f816f514f84750e850a68bf17ca20c06df01d /src/dhcpcd.c
parent0cb41c71bc45ed90aa50f10d191948c9e9065eef (diff)
downloaddhcpcd-b75c7a3fb31198da2b983a58220e2fe163a66eb1.tar.xz
build: Move rundir from /var/run to /var/run/dhcpcd
This will allow dhcpcd to create and unlink pidfiles and sockets which it could otherwise not if dropped priviledges. Downstream packages such as dhcpcd-ui will need to be adjusted.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 11e81980..94c27780 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -1640,6 +1640,12 @@ main(int argc, char **argv)
#ifdef INET
ctx.udp_fd = -1;
#endif
+#ifdef INET6
+ ctx.nd_fd = -1;
+#endif
+#ifdef DHCP6
+ ctx.dhcp6_fd = -1;
+#endif
rt_init(&ctx);
logopts = LOGERR_ERR|LOGERR_LOG|LOGERR_LOG_DATE|LOGERR_LOG_PID;
@@ -1807,7 +1813,7 @@ printpidfile:
per = "";
}
snprintf(ctx.pidfile, sizeof(ctx.pidfile),
- PIDFILE, "-", ifname, per);
+ PIDFILE, ifname, per, ".");
} else {
snprintf(ctx.pidfile, sizeof(ctx.pidfile),
PIDFILE, "", "", "");
@@ -1982,7 +1988,8 @@ printpidfile:
if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
if (pid == -1)
- logerr("%s: pidfile_lock", __func__);
+ logerr("%s: pidfile_lock: %s",
+ __func__, ctx.pidfile);
else
logerrx(PACKAGE
" already running on pid %d (%s)",