[PATCH] Fix dhcpcd running as a regular user.
Cherry-picked from
https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/
master/net-misc/dhcpcd/files/patches/dhcpcd-6.8.2-Fix-dhcpcd-running-as-a-
regular-user.patch.
Update the lease file permission to 0600 to prevent other
users from reading the lease file.
Moreover, also soften the log message shown when not running as root,
since by using Linux capabilities dhcpcd can run fine as a regular user.
BUG: 22956197
Change-Id: Ib6f4ae4a892c6f5697cd03e79e3aa018b80712fe
Reviewed-on: https://gerrit.chromium.org/gerrit/22644
diff --git a/dhcpcd.c b/dhcpcd.c
index 2ffdac1..9528dc8 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1641,8 +1641,8 @@
#endif
if (geteuid())
- logger(&ctx, LOG_WARNING,
- PACKAGE " will not work correctly unless run as root");
+ logger(&ctx, LOG_NOTICE,
+ PACKAGE " is running with reduced privileges");
#ifdef USE_SIGNALS
if (sig != 0) {