Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4224edf5 authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am 89e4fad0: am 4e6aa6a2: Merge "adbd: unconditionally call setgroups"

* commit '89e4fad0':
  adbd: unconditionally call setgroups
parents 2757d76c 89e4fad0
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -1344,11 +1344,6 @@ int adb_main(int is_daemon, int server_port)
          " 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:
    ** AID_ADB to access the USB driver
    ** AID_LOG to read system logs (adb logcat)
@@ -1367,6 +1362,11 @@ int adb_main(int is_daemon, int server_port)
        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" */
        if (setgid(AID_SHELL) != 0) {
            exit(1);