From: tedu Date: Sat, 14 Jan 2017 18:51:24 +0000 (+0000) Subject: add a geteuid check to make sure we're root before plowing into setauth. spare some... X-Git-Tag: v6.6~66 X-Git-Url: https://git.armaanb.net/?p=opendoas.git;a=commitdiff_plain;h=97d12a583b38551d7cdcb301f984988eab766256 add a geteuid check to make sure we're root before plowing into setauth. spare some debugging effort in case doas is not installed setuid. --- diff --git a/doas.c b/doas.c index 0a23595..d30f73d 100644 --- a/doas.c +++ b/doas.c @@ -412,6 +412,9 @@ main(int argc, char **argv) exit(1); /* fail safe */ } + if (geteuid()) + errx(1, "not installed setuid"); + parseconfig("/etc/doas.conf", 1); /* cmdline is used only for logging, no need to abort on truncate */