aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Tan <samueltan@google.com>2015-10-19 14:38:10 -0700
committerSamuel Tan <samueltan@google.com>2015-10-20 15:49:54 -0700
commite8e1f37493e07922bcb8be22ab9e2fe76e861b05 (patch)
tree1ce81818a5e912d8532ef2c65f2ee88f5d0ebfa7
parent163504716e7aae6d481e209c88c70ac8a20f45ed (diff)
downloaddhcpcd-6.8.2-brillo-m8-release.tar.gz
dhcpcd-6.8.2: do not use switch_user() in Brillo buildsbrillo-m8-releasebrillo-m8-devbrillo-m7-releasebrillo-m7-mr-devbrillo-m7-dev
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.
-rw-r--r--dhcpcd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index e0908cf..28a472c 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -53,7 +53,7 @@ const char dhcpcd_copyright[] = "Copyright (c) 2006-2015 Roy Marples";
#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 @@ switch_user(void)
cap.inheritable = 0;
capset(&header, &cap);
}
-#endif /* __ANDROID__ */
+#endif /* __ANDROID__ */
int
main(int argc, char **argv)
@@ -1447,9 +1447,9 @@ main(int argc, char **argv)
#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) {