added permission error report if not run as root, removed redundant sanity check...
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 23 Feb 2001 17:27:33 +0000 (17:27 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 23 Feb 2001 17:27:33 +0000 (17:27 +0000)
comedi_config/comedi_config.c

index 9671446b5d7c9c31c9d428c1201ea4648a7002fa..54517a27169a340a320a1db6d168d36c1dd2164d 100644 (file)
@@ -103,6 +103,13 @@ int main(int argc,char *argv[])
        int remove=0;
        int index;
 
+       if(getuid() != 0)
+       {
+               errno = EPERM;
+               perror(argv[0]);
+               exit(1);
+       }
+
        while(1){
                c=getopt_long(argc, argv, "rvVqi:", options, &index);
                if(c==-1)break;
@@ -187,8 +194,6 @@ int main(int argc,char *argv[])
                                do_help(1);
                        }
                }
-               if(argc-optind > 3)
-                       do_help(1);
 
                ret=stat(fn,&statbuf);
                if(ret<0){