<< | Thread Index | >> ]    [ << | Date Index | >> ]

To: majordomo,AT,inka,DOT,de
Subject: trivial ciped.c patch
From: Anatoly Pugachev <a.pugachev,AT,pcs-net,DOT,net>
Date: Sun, 12 Jun 2005 04:35:43 +0400

Hello.
Small patch to make broken options and help to shown before we check for user
privileges. Please apply.
-- 
Anatoly P. Pugachev
Only in cipe-1.6.0/: 2.6.9-5.EL-i386-cb
diff -ru cipe-1.6.0.orig/cipe/ciped.c cipe-1.6.0/cipe/ciped.c
--- cipe-1.6.0.orig/cipe/ciped.c        2004-01-18 17:57:51.000000000 +0300
+++ cipe-1.6.0/cipe/ciped.c     2005-06-12 04:29:27.949491296 +0400
@@ -934,6 +934,16 @@
     else
        pn=argv[0];
 
+    while ((i=getopt(argc, argv, "is:S:o:"))!=EOF) {
+        switch(i) {
+        case 'i': inetd=1; break;
+       case 's': usesock=atoi(optarg); break;
+       case 'S': sd=atoi(optarg); break;
+        case 'o': if (setopt_file(optarg, 1)<0) exit(1); break;
+        default: usage(pn);
+        }
+    }
+
     if (getuid() || geteuid()) {
        fprintf(stderr, "This program must be run by root.\n");
        exit(1);
@@ -952,15 +962,6 @@
     /* Snarf options from: standard options file, user-supplied file and
        finally, command line */
     setopt_file(CTLDIR "/options", 0);
-    while ((i=getopt(argc, argv, "is:S:o:"))!=EOF) {
-        switch(i) {
-        case 'i': inetd=1; break;
-       case 's': usesock=atoi(optarg); break;
-       case 'S': sd=atoi(optarg); break;
-        case 'o': if (setopt_file(optarg, 1)<0) exit(1); break;
-        default: usage(pn);
-        }
-    }
     setopt_cmdline(argc-optind, argv+optind);
     if (!OI(maxerr))
        OI(maxerr)=8; /* compatibility */

Attachment: pgp00000.pgp
Description: PGP signature


<< | Thread Index | >> ]    [ << | Date Index | >> ]