Merge "adbd: unconditionally call setgroups"
This commit is contained in:
commit
4e6aa6a227
1 changed files with 18 additions and 18 deletions
10
adb/adb.c
10
adb/adb.c
|
|
@ -1344,11 +1344,6 @@ int adb_main(int is_daemon, int server_port)
|
||||||
" unchanged.\n");
|
" unchanged.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* don't listen on a port (default 5037) if running in secure mode */
|
|
||||||
/* don't run as root if we are running in secure mode */
|
|
||||||
if (should_drop_privileges()) {
|
|
||||||
drop_capabilities_bounding_set_if_needed();
|
|
||||||
|
|
||||||
/* add extra groups:
|
/* add extra groups:
|
||||||
** AID_ADB to access the USB driver
|
** AID_ADB to access the USB driver
|
||||||
** AID_LOG to read system logs (adb logcat)
|
** AID_LOG to read system logs (adb logcat)
|
||||||
|
|
@ -1367,6 +1362,11 @@ int adb_main(int is_daemon, int server_port)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* don't listen on a port (default 5037) if running in secure mode */
|
||||||
|
/* don't run as root if we are running in secure mode */
|
||||||
|
if (should_drop_privileges()) {
|
||||||
|
drop_capabilities_bounding_set_if_needed();
|
||||||
|
|
||||||
/* then switch user and group to "shell" */
|
/* then switch user and group to "shell" */
|
||||||
if (setgid(AID_SHELL) != 0) {
|
if (setgid(AID_SHELL) != 0) {
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue