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

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

am 9a430d8c: am 62d0970c: Merge "allow dumpstate to work for non-root users." into gingerbread

Merge commit '9a430d8c'

* commit '9a430d8c':
  allow dumpstate to work for non-root users.
parents a35827a8 9a430d8c
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ int main(int argc, char *argv[]) {
        fclose(cmdline);
    }

    if (getuid() == 0) {
        /* switch to non-root user and group */
        gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT };
        if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) {
@@ -253,6 +254,7 @@ int main(int argc, char *argv[]) {
            LOGE("Unable to setuid, aborting: %s\n", strerror(errno));
            return -1;
        }
    }

    char path[PATH_MAX], tmp_path[PATH_MAX];
    pid_t gzip_pid = -1;