Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fw32.git;a=commitdiff;h=bcf253fe521c7c049eaf0ac3c2a0415b5f77e829

commit bcf253fe521c7c049eaf0ac3c2a0415b5f77e829
Author: James Buren <r...@frugalware.org>
Date:   Thu Nov 3 02:51:05 2011 -0500

fw32.c: rewrite main function

diff --git a/fw32.c b/fw32.c
index e087316..e3793f8 100644
--- a/fw32.c
+++ b/fw32.c
@@ -326,8 +326,25 @@ fw32_create(void)
extern int
main(int argc,char **argv)
{
-  personality(PER_LINUX32);
+  char *cmd, **args;

+  cmd = argv[0];
+
+  args = argv + 1;
+
+  if(!strcmp(cmd,"fw32-run"))
+  {
+    if(!getuid() || geteuid())
+      error("This must be run as non-root, be SETUID, and owned by root.\n");
+  }
+  else if(getuid() || geteuid())
+    error("This must be run as root.\n");
+
+  if(personality(PER_LINUX32))
+    error("Failed to enable 32 bit emulation.\n");
+
+  if(!strcmp(cmd,"fw32-create"))
+    fw32_create();

return EXIT_SUCCESS;
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to