Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=1e587104d919cd0b6ae29a11431b650f5d14e9cf

commit 1e587104d919cd0b6ae29a11431b650f5d14e9cf
Author: James Buren <[email protected]>
Date:   Thu Oct 18 08:46:54 2012 -0500

add check for if we're run through sudo or root

diff --git a/src/main.c b/src/main.c
index ebaf2d8..b6432ff 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,13 +6,20 @@ extern int main(int argc,char **argv)
{
int code = 0;

+  if(geteuid() != 0)
+  {
+    printf("You must run this as root.\n");
+
+    return EXIT_FAILURE;
+  }
+
logfile = fopen(LOGFILE,"w");

if(logfile == 0)
{
perror("main");

-    return 1;
+    return EXIT_FAILURE;
}

setbuf(logfile,0);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to