🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Karl Kleinpaste Fri, 05 May 2000 00:00
inn 2.3.0beta nnrpd ARTreadschema() wrongness
#46310
Author: Karl Kleinpaste
Date: Fri, 05 May 2000 00:00
68 lines
3272 bytes
Recent changes (0502) for intended improvement to nnrpd Xref schema
verification have broken it.

Consider this slice from nnrpd/article.c beginning line 243:

	if ((p = strchr(buff, ':')) != NULL) {
	    *p++ = '\0';
|	    fp->NeedsHeader = EQ(p, "full");
	    if (ARTfirstfullfield == 0)
	      ARTfirstfullfield = fp - ARTfields + 1;
	}
	else
	    fp->NeedsHeader = FALSE;
	fp->HasHeader = FALSE;
	fp->Header = COPY(buff);
	fp->Length = strlen(buff);
|	fp++;
	if (caseEQ(buff, "Xref")) {
	    foundxref = TRUE;
|	    foundxreffull = fp->NeedsHeader;
	    ARTxreffield = fp - ARTfields - 1;
	    fp->HasHeader = FALSE;
	    fp->Header = COPY("Newsgroups");
	    fp->Length = strlen("Newsgroups");
	    fp++;
	}
    }
    ARTfieldsize = fp - ARTfields;
    (void)fclose(F);
|   if (!foundxref || !foundxreffull) {
|	syslog(L_ERROR, "%s 'Xref:full' must be included in %s", ClientHost, SCHEMA);
	return FALSE;
    }
    return TRUE;

Please note the lines preceded with `|'.  NeedsHeader is figured on
the basis of comparison to "full".  Then we step past the current fp
into the next.  Then we determine foundxreffull on the basis of that
next fp...which is uninitialized.  Um?

The values I find in fp->NeedsHeader at the 3rd `|' line when nnrpd
starts vary all over the map.

Honestly, I'm not at all sure what was intended to be accomplished
here, because right this instant I see no reason to cobble up a fresh
Newsgroups overview entry out of air here.  So I haven't yet bothered
to debug farther than to determine the operational failure, when the
garbage value happens to be zero, leading to the "must be included"
diagnostic, confounding the heck outta me when I tried to install this
code on yet another new server today.  The obvious & trivial fix would
be to use "foundxreffull = (fp-1)->NeedsHeader" but that seems hackish.

Alternatively, this may be a little less disconcerting:
	fp->Length = strlen(buff);
	if (caseEQ(buff, "Xref")) {
	    foundxref = TRUE;
	    foundxreffull = fp->NeedsHeader;
	    fp++;
	    ARTxreffield = fp - ARTfields - 1;
	    fp->HasHeader = FALSE;
	    fp->Header = COPY("Newsgroups");
	    fp->Length = strlen("Newsgroups");
	}
	fp++;

0501 runs without incident; foundxreffull appeared in 0502.

Re: inn 2.3.0beta nnrpd ARTreadschema() wrongness
#46316
Author: Katsuhiro Kondou
Date: Fri, 05 May 2000 00:00
14 lines
1479 bytes
In article <vxk4s8d4o5a.fsf@mesquite.charcoal.com>,
	Karl Kleinpaste <karl@charcoal.com> wrote;

} Please note the lines preceded with `|'.  NeedsHeader is figured on
} the basis of comparison to "full".  Then we step past the current fp
} into the next.  Then we determine foundxreffull on the basis of that
} next fp...which is uninitialized.  Um?

Oops!  This was my mistake to ensure 'Xref:full' in
overview.fmt.  Just fixed.  Thanks.
-- 
Katsuhiro Kondou

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