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

Commit 679f34fb authored by Nick Kralevich's avatar Nick Kralevich
Browse files

DO NOT MERGE: dumpstate: execute procrank using su

procrank is a setuid binary which only exists on userdebug/eng
builds. Instead of executing the setuid binary, run the binary using
the su command. This eliminates one more setuid binary, and allows
the tightening of the SELinux policy.

Bug: 18342188

(cherry picked from commit 2b1f88b6)
Bug: 25951005

Change-Id: I90c86f89974b3878273a29277b2a5d5d7c4b81c7
parent 0fa1c5ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ static void dumpstate() {
    dump_files("UPTIME MMC PERF", mmcblk0, skip_not_stat, dump_stat_from_fd);
    dump_file("MEMORY INFO", "/proc/meminfo");
    run_command("CPU INFO", 10, "top", "-n", "1", "-d", "1", "-m", "30", "-t", NULL);
    run_command("PROCRANK", 20, "procrank", NULL);
    run_command("PROCRANK", 20, SU_PATH, "root", "procrank", NULL);
    dump_file("VIRTUAL MEMORY STATS", "/proc/vmstat");
    dump_file("VMALLOC INFO", "/proc/vmallocinfo");
    dump_file("SLAB INFO", "/proc/slabinfo");