From 55a81dcfbfd47114c9aef5dfad57bf2859681973 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 14 Oct 2015 17:58:13 +0200 Subject: [PATCH] mxqd: require compiletime flag to run as non-root --- mxqd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mxqd.c b/mxqd.c index 32fbf29..cda23e8 100644 --- a/mxqd.c +++ b/mxqd.c @@ -407,7 +407,12 @@ int server_init(struct mxq_server *server, int argc, char *argv[]) } if (getuid()) { +#ifdef RUNASNORMALUSER mx_log_notice("Running mxqd as non-root user."); +#else + mx_log_err("Running mxqd as non-root user is not supported at the moment."); + exit(EX_USAGE); +#endif } res = mx_read_first_line_from_file("/proc/sys/kernel/random/boot_id", &str_bootid);