Fixes #23
This commit is contained in:
parent
a729ab146b
commit
4dbce6bcb3
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue