This patch fixes a "misindentation", and also enables non-superusers to at
least query --help or --version. GoboHide still checks if the user can
execute past this point, so the behavior is kept.
Patch generated with "cvs diff" from tools/ module base, like the previous.
Review is greatly appreciated. :)
ps: sorry for not commiting directly, but I don't want to break things 1 hour
after fetching the sources.
--
Ricardo Nabinger Sanchez <[EMAIL PROTECTED],wait4.org}>
Powered by FreeBSD
"Left to themselves, things tend to go from bad to worse."
Index: GoboHide/src/gobohide.c
===================================================================
RCS file: /sources/goboscripts/tools/GoboHide/src/gobohide.c,v
retrieving revision 1.4
diff -u -p -r1.4 gobohide.c
--- GoboHide/src/gobohide.c 23 Aug 2006 18:51:23 -0000 1.4
+++ GoboHide/src/gobohide.c 21 Oct 2006 19:29:56 -0000
@@ -256,7 +256,7 @@ purge_list ()
}
free (hide->stats.hidden_list);
- free (hide);
+ free (hide);
}
int
@@ -266,13 +266,6 @@ main (int argc, char **argv)
int a = -1, purge = 0;
const char *dir = NULL;
-
- /* Only the superuser is allowed to execute this */
- if (getuid () != 0) {
- fprintf (stderr, "Must be superuser\n");
- exit (EXIT_SUCCESS);
- }
-
program_name = argv[0];
while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1) {
switch (c) {
@@ -293,6 +286,13 @@ main (int argc, char **argv)
usage (1);
if (show_version)
usage (0);
+
+ /* Only the superuser is allowed to execute further */
+ if (getuid () != 0) {
+ fprintf (stderr, "Must be superuser\n");
+ exit (EXIT_SUCCESS);
+ }
+
if (purge) {
purge_list ();
exit (EXIT_SUCCESS);
_______________________________________________
gobolinux-devel mailing list
[email protected]
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel