(fixing bug in my last commit)
authorAndrew Bartlett <abartlet@samba.org>
Sat, 21 Jun 2003 23:35:12 +0000 (23:35 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 21 Jun 2003 23:35:12 +0000 (23:35 +0000)
This isn't C++ - start your code *after* all the variables are declared...

Andrew Bartlett
(This used to be commit b7760faedc2181538ffc325e727808e6df8f943f)

source3/utils/net_groupmap.c

index c9c37a68c27a408e08cfc22f535bed2c7c46c84d..590a005e17628c1ca51994b6e42c72eb6f4fd1d2 100644 (file)
@@ -486,12 +486,6 @@ int net_help_groupmap(int argc, const char **argv)
  **********************************************************/
 int net_groupmap(int argc, const char **argv)
 {
-       /* we shouldn't have silly checks like this */
-       if (getuid() != 0) {
-               d_printf("You must be root to edit group mappings.\nExiting...\n");
-               return -1;
-       }
-       
        struct functable func[] = {
                {"add", net_groupmap_add},
                {"modify", net_groupmap_modify},
@@ -501,6 +495,12 @@ int net_groupmap(int argc, const char **argv)
                {NULL, NULL}
        };
 
+       /* we shouldn't have silly checks like this */
+       if (getuid() != 0) {
+               d_printf("You must be root to edit group mappings.\nExiting...\n");
+               return -1;
+       }
+       
        return net_run_function(argc, argv, func, net_help_groupmap);
        if ( 0 == argc )
                return net_help_groupmap( argc, argv );