From b5c6cf87342bedeb67fbbc4f3f512af1603a461c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 19 Feb 2011 14:20:00 +0100 Subject: main: refuse --test as root --- src/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 96a282a34f..d1be83d44f 100644 --- a/src/main.c +++ b/src/main.c @@ -1012,6 +1012,11 @@ int main(int argc, char *argv[]) { if (parse_argv(argc, argv) < 0) goto finish; + if (arg_action == ACTION_TEST && geteuid() == 0) { + log_error("Don't run test mode as root."); + goto finish; + } + /* If Plymouth is being run make sure we show the status, so * that there's something nice to see when people press Esc */ if (access("/dev/.systemd/plymouth", F_OK) >= 0) -- cgit v1.2.3-54-g00ecf