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

Commit 62d0970c authored by Nick Kralevich's avatar Nick Kralevich Committed by Android (Google) Code Review
Browse files

Merge "allow dumpstate to work for non-root users." into gingerbread

parents 7dc08fb0 77d87aa7
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -216,6 +216,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) {
@@ -230,6 +231,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;