This is just insanely dangerous: with the addition of the CTF_DEBUGDIR
info it reads almost arbitrary DWARF. elfutils is not root-rated and
frankly neither is dwarf2ctf, valgrind or no valgrind. It's just too
complicated to risk that way.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
Orabug:
25815362
trace = getenv("DWARF2CTF_TRACE");
+ if (getuid() == 0 || geteuid() == 0) {
+ fprintf(stderr, "dwarf2ctf: run as a regular user, not root.\n");
+ exit(1);
+ }
+
if ((argc != 4 && argc != 8) ||
(argc == 4 && strcmp(argv[2], "-e") != 0)) {
fprintf(stderr, "Syntax: dwarf2ctf output-file srcdir "