summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-22 12:00:10 +0000
committerRoy Marples <roy@marples.name>2020-01-22 12:00:10 +0000
commit730ce26da503f523748c7910558fc769131779ac (patch)
treef3120fdc353d45f5dbfa9d04805b46500ec386d4 /src/privsep.c
parenteed9c74e6c37ed1ddb549e9894fb21aee5704209 (diff)
downloaddhcpcd-730ce26da503f523748c7910558fc769131779ac.tar.xz
logging: Always log to syslog(3).
--logfile may not work that well in a chroot on receipt of SIGUSR2 because the path is of course different. Might have to drop this option soon as I have no good ideas on how to resolve it :(
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/privsep.c b/src/privsep.c
index f0fd444f..79547295 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -119,6 +119,10 @@ ps_init(struct dhcpcd_ctx *ctx)
chmod(path, 0755) == -1)
logerr("%s: %s", __func__, path);
+ /* Ensure we have a localtime to correctly format dates. */
+ if (ps_root_docopychroot(ctx, "/etc/localtime") == -1 && errno!=ENOENT)
+ logerr("%s: %s", __func__, "/etc/localtime");
+
ctx->options |= DHCPCD_PRIVSEP;
return 0;
}