Commit 4dbce6bc authored by Daniel Graziotin's avatar Daniel Graziotin

Fixes #23

parent a729ab14
......@@ -24,6 +24,7 @@
#include "daemon.h"
#include "global.h"
#include "minunit.h"
#include <syslog.h>
int daemonize = 1;
int verbose = 0;
......@@ -74,6 +75,13 @@ int main(int argc, char *argv[])
}
}
uid_t uid=getuid(), euid=geteuid();
if (!(uid<0 || uid!=euid)) {
syslog(LOG_INFO, "Mbpfan not started with root privileges. Exiting.");
printf("Mbpfan not started with root privileges. Exiting.\n");
exit(0);
}
// pointer to mbpfan() function in mbpfan.c
void (*fan_control)() = mbpfan;
go_daemon(fan_control);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment