dhcpcd-6.8.2: do not use switch_user() in Brillo builds
Brillo builds can use minijail to change dhcpcd-6.8.2 uid and
gid, so do not use switch_user() in these builds.
BUG: 25083940
Change-Id: I175191142015298db1909ee660d2a67672a4508c
TEST: dhcpcd-6.8.2 runs as expected during weaved setup in brillo build.
diff --git a/dhcpcd.c b/dhcpcd.c
index e0908cf..28a472c 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -53,7 +53,7 @@
#include <sys/capability.h>
#include <sys/prctl.h>
#include <private/android_filesystem_config.h>
-#endif /* __ANDROID__ */
+#endif /* __ANDROID__ */
#include "config.h"
#include "arp.h"
@@ -1426,7 +1426,7 @@
cap.inheritable = 0;
capset(&header, &cap);
}
-#endif /* __ANDROID__ */
+#endif /* __ANDROID__ */
int
main(int argc, char **argv)
@@ -1447,9 +1447,9 @@
#endif
char ifn[IF_NAMESIZE];
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) && !defined(__BRILLO__)
switch_user();
-#endif // __ANDROID__
+#endif /* __ANDROID__ && !__BRILLO__ */
/* Test for --help and --version */
if (argc > 1) {