[Frugalware-git] fwife: check for root first

2009-02-16 Thread Elentir
Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=8fb25153827fff11af102aedde4468f6c51f4c1b

commit 8fb25153827fff11af102aedde4468f6c51f4c1b
Author: crazy cr...@frugalware.org
Date:   Mon Feb 16 05:34:59 2009 +0100

check for root first

diff --git a/src/fwife.c b/src/fwife.c
index 1c8ef82..7bffaf5 100644
--- a/src/fwife.c
+++ b/src/fwife.c
@@ -21,6 +21,7 @@
*/

#include stdlib.h
+#include unistd.h
#include gtk/gtk.h
#include glib.h
#include dirent.h
@@ -270,6 +271,12 @@ int main (int argc, char *argv[])

gtk_init (argc, argv);

+  if (getuid() != 0)
+  {
+   fwife_error(_(Insuffecient privileges. Fwife must be run as root.));
+   exit(1);
+  }
+
ask_language();

/* Create a new assistant widget with no pages. */
___
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git


Re: [Frugalware-git] fwife: check for root first

2009-02-16 Thread Russell Dickenson
On Tue, Feb 17, 2009 at 5:11 AM, Elentir elen...@mailoo.org wrote:
 Git-Url: 
 http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=8fb25153827fff11af102aedde4468f6c51f4c1b

 commit 8fb25153827fff11af102aedde4468f6c51f4c1b
 Author: crazy cr...@frugalware.org
 Date:   Mon Feb 16 05:34:59 2009 +0100

 check for root first

 diff --git a/src/fwife.c b/src/fwife.c
 index 1c8ef82..7bffaf5 100644
 --- a/src/fwife.c
 +++ b/src/fwife.c
 @@ -21,6 +21,7 @@
 */

 #include stdlib.h
 +#include unistd.h
 #include gtk/gtk.h
 #include glib.h
 #include dirent.h
 @@ -270,6 +271,12 @@ int main (int argc, char *argv[])

 gtk_init (argc, argv);

 +  if (getuid() != 0)
 +  {
 +   fwife_error(_(Insuffecient privileges. Fwife must be run as root.));
 +   exit(1);
 +  }
 +
 ask_language();

 /* Create a new assistant widget with no pages. */
 ___
 Frugalware-git mailing list
 Frugalware-git@frugalware.org
 http://frugalware.org/mailman/listinfo/frugalware-git



I noticed a spelling error above - fwife_error(_(Insuffecient
privileges. Fwife must be run as root.));

Insuffecient should read Insufficient


May you always be Frugal,

Russell Dickenson (AKA phayz)
___
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git