trivial ciped.c patch

Anatoly Pugachev <[email protected]> Sun, 12 Jun 2005 04:35:43 +0400
Newsgroups gmane.comp.encryption.cipe
Message-ID <[email protected]>
--w/VI3ydZO+RcZ3Ux
Content-Type: multipart/mixed; boundary="QXO0/MSS4VvK6f+D"
Content-Disposition: inline


--QXO0/MSS4VvK6f+D
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello.
Small patch to make broken options and help to shown before we check for us=
er
privileges. Please apply.
--=20
Anatoly P. Pugachev

--QXO0/MSS4VvK6f+D
Content-Type: text/plain; charset=koi8-r
Content-Disposition: attachment; filename="cipe-usage-before.diff"
Content-Transfer-Encoding: quoted-printable

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=3Dargv[0];
=20
+    while ((i=3Dgetopt(argc, argv, "is:S:o:"))!=3DEOF) {
+        switch(i) {
+        case 'i': inetd=3D1; break;
+	case 's': usesock=3Datoi(optarg); break;
+	case 'S': sd=3Datoi(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=3Dgetopt(argc, argv, "is:S:o:"))!=3DEOF) {
-        switch(i) {
-        case 'i': inetd=3D1; break;
-	case 's': usesock=3Datoi(optarg); break;
-	case 'S': sd=3Datoi(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)=3D8; /* compatibility */

--QXO0/MSS4VvK6f+D--

--w/VI3ydZO+RcZ3Ux
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCq4NdoubiDytudlARArbBAJ40+1vuyUAQu2PZ+f6M97wVnwEnwgCfRJ8b
PWTdCBxTYKiBlgXYU3BDXfY=
=DcPR
-----END PGP SIGNATURE-----

--w/VI3ydZO+RcZ3Ux--

--
Message sent by the [email protected] mailing list.
Unsubscribe: mail [email protected], "unsubscribe cipe-l" in body
Other commands available with "help" in body to the same address.
CIPE info and list archive: <URL:http://sites.inka.de/~bigred/devel/cipe.html>