]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Don't read control_group in privsep
authorRoy Marples <roy@marples.name>
Sat, 1 Aug 2020 19:32:34 +0000 (20:32 +0100)
committerRoy Marples <roy@marples.name>
Sat, 1 Aug 2020 19:32:34 +0000 (20:32 +0100)
There is no need as it's a global option and it will have already
been read in by this point.
Also means we don't need to pledge getpw.

src/if-options.c

index 62fe7ede5bf064494f01a89c7ac01759b5aa21e9..917025d299449e410c3cd62f29e78f750747e908 100644 (file)
@@ -2090,6 +2090,12 @@ invalid_token:
                break;
        case O_CONTROLGRP:
                ARG_REQUIRED;
+#ifdef PRIVSEP
+               /* Control group is already set by this point.
+                * We don't need to pledge getpw either with this. */
+               if (IN_PRIVSEP(ctx))
+                       break;
+#endif
 #ifdef _REENTRANT
                l = sysconf(_SC_GETGR_R_SIZE_MAX);
                if (l == -1)