🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Mike Bird Thu, 14 Mar 1996 00:00
UNOFF4 breaks CTLINND
#5644
Author: Mike Bird
Date: Thu, 14 Mar 1996 00:00
20 lines
1230 bytes
Distribution: news.software.nntp, mmm, jefft, shermc

An undocumented change in INN1.4UNOFF4 removes the length prefix in
ctlinnd messages when HAVE_UNIX_DOMAIN is DONT.  This causes ctlinnd
messages to merge together and has broken a number of our scripts
which send multiple ctlinnd messages including occasional hangs in
news.daily.

The fix is to revert to the UNOFF3 versions of include/inndcomp.h,
innd/cc.c and lib/inndcomm.c and reinstall at least innd, ctlinnd, and
makehistory.

--Mike
----------------------------------------------------------
 Mike Bird          Tel: 209-742-5000   FAX: 209-966-3177
 President          POP: 209-742-5333   NOC: 209-742-9979 
 Iron Mtn Systems      http://www.ims.mariposa.ca.us/


UNOFF4 breaks CTLINND
#5671
Author: Mike Bird
Date: Fri, 15 Mar 1996 00:00
23 lines
1359 bytes
This message replaces a previous version which omitted EXPIRE.

Distribution: news.software.nntp, mmm, jefft, shermc

An undocumented change in INN1.4UNOFF4 removes the length prefix in
ctlinnd messages when HAVE_UNIX_DOMAIN is DONT.  This causes ctlinnd
messages to merge together and has broken a number of our scripts
which send multiple ctlinnd messages including occasional hangs in
news.daily.

The fix is to revert to the UNOFF3 versions of include/inndcomp.h,
innd/cc.c and lib/inndcomm.c and reinstall at least innd, ctlinnd, and
makehistory AND EXPIRE.

--Mike

----------------------------------------------------------
 Mike Bird          Tel: 209-742-5000   FAX: 209-966-3177
 President          POP: 209-742-5333   NOC: 209-742-9979 
 Iron Mtn Systems      http://www.ims.mariposa.ca.us/


Re: UNOFF4 breaks CTLINND
#5727
Author: Dave Barr
Date: Sun, 17 Mar 1996 00:00
18 lines
1179 bytes
In article <4ibd21$ha0@news.ims.mariposa.ca.us>,
Mike Bird <mgb@ims.mariposa.ca.us> wrote:
>An undocumented change in INN1.4UNOFF4 removes the length prefix in
>ctlinnd messages when HAVE_UNIX_DOMAIN is DONT.

Wrong.  There was no length prefix there in the first place.

You're using a local patched version of unoff3.

The real fix is to use unoff4 and re-apply your local patch.

(A patch I disagree with on religious reasons, mostly because it
addresses what IMHO is an OS bug.  The normal DONT HAVE_UNIX_DOMAIN
should and does work for most people.)

--Dave

Re: UNOFF4 breaks CTLINND
#5873
Author: Mike Bird
Date: Thu, 21 Mar 1996 00:00
118 lines
4184 bytes
Dave is right.  I was wrong.  The change did not occur in unoff4.

I'm guessing the fix came from some unacknowledged genius at
Slackware.  Here it is for those that may have lost it.

Dave, since it fixes Linux installations and is otherwise harmless,
please consider it for inclusion in unoff5.

IMHO the unpatched version relies on behavior which is not part of
any Unix standard (I look forward to being corrected again).

--Mike

===========================
Patch to prevent ctlinnd/expire etc messages being joined together
(and lost):

--- ../inn1.4unoff4/lib/inndcomm.c	Thu Mar 18 13:04:36 1993
+++ lib/inndcomm.c	Thu Mar 14 15:01:03 1996
@@ -169,7 +169,18 @@
 
 /*
 **  Send an arbitrary command to the server.
+**  Note that for those systems without Unix Domain Sockets,
+**  the command format is different. There is a two byte
+**  length code on the front of the message. This is a
+**  direct mapped integer. Note that sending and receiving
+**  architectures *must* be the same as we are on the same
+**  machine.
 */
+#if defined(DO_HAVE_UNIX_DOMAIN)
+#define BUFF_OFFSET 0
+#else
+#define BUFF_OFFSET sizeof(ICC_MSGLENTYPE)
+#endif
 int
 ICCcommand(cmd, argv, replyp)
     char		cmd;
@@ -203,7 +214,7 @@
 	bufsiz += 1 + strlen(p);
     if (bufsiz < MIN_BUFFER_SIZE)
 	bufsiz = MIN_BUFFER_SIZE;
-    buff = malloc((unsigned int)bufsiz);
+    buff = malloc((unsigned int)bufsiz + BUFF_OFFSET);
     if (buff == NULL) {
 	ICCfailure = "malloc";
 	return -1;
@@ -211,6 +222,8 @@
     if (replyp)
 	*replyp = NULL;
 
+    buff += BUFF_OFFSET;	/* Advance to leave space for length */
+
     /* Format the message. */
     (void)sprintf(buff, "%s%c%c", ICCsockname, SC_SEP, cmd);
     for (p = buff + strlen(buff), i = 0; (q = argv[i]) != NULL; i++) {
@@ -221,6 +234,10 @@
     /* Send message. */
     ICCfailure = NULL;
     len = p - buff;
+
+    buff -= BUFF_OFFSET;	/* Not strictly required - could be inside
+				 * #else clause below */
+
 #if	defined(DO_HAVE_UNIX_DOMAIN)
     if (sendto(ICCfd, buff, len, 0,
 	    (struct sockaddr *)&ICCserv, AF_UNIX_SOCKSIZE(ICCserv)) < 0) {
@@ -234,6 +251,8 @@
 	ICCfailure = "open";
 	return -1;
     }
+    *(ICC_MSGLENTYPE *) buff = len;
+    len += BUFF_OFFSET;
     if (write(fd, buff, len) != len) {
 	i = errno;
 	DISPOSE(buff);

--- ../inn1.4unoff4/innd/cc.c	Thu Mar 18 13:04:22 1993
+++ innd/cc.c	Thu Mar 14 15:00:21 1996
@@ -1314,6 +1314,7 @@
     struct sockaddr_un	client;
 #else
     int			written;
+    ICC_MSGLENTYPE	bufflen;
 #endif	/* defined(DO_HAVE_UNIX_DOMAIN) */
     int			i;
     char		buff[BUFSIZ + 2];
@@ -1329,7 +1330,21 @@
     }
 
     /* Get the message. */
+#if !defined(DO_HAVE_UNIX_DOMAIN)
+    i = RECVorREAD(CCchan->fd, (char *) &bufflen, sizeof(bufflen));
+    if (i != sizeof(bufflen) 
+	|| bufflen < 1 || bufflen >= (sizeof buff - 1)) {
+	syslog(L_ERROR, "%s cant recv CCreader length %m", LogName);
+	return;
+    }
+    i = RECVorREAD(CCchan->fd, buff, bufflen);
+    if (i > 0 && i != bufflen) {
+	syslog(L_ERROR, "%s cant recv CCreader data %m", LogName);
+	return;
+    }
+#else
     i = RECVorREAD(CCchan->fd, buff, sizeof buff - 1);
+#endif
     if (i < 0) {
 	syslog(L_ERROR, "%s cant recv CCreader %m", LogName);
 	return;


----------------------------------------------------------
 Mike Bird          Tel: 209-742-5000   FAX: 209-966-3177
 President          POP: 209-742-5333   NOC: 209-742-9979 
 Iron Mtn Systems      http://www.ims.mariposa.ca.us/


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads