Thread View: news.software.nntp
17 messages
17 total messages
Started by Clifton Royston
Fri, 19 Nov 1999 00:00
Patch for Distribution header problem
Author: Clifton Royston
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
91 lines
3512 bytes
3512 bytes
I'm amazed INN hasn't run into this before. My news server was
coming up and going down for about 6 hours til I finally tracked this
down with gdb.
If you look at distributions, then this one could definitely bite
you; there are two careless assumptions made, one in innd.c and one in
art.c, which combine to give a probable SEGV on examining a certain
malformed Distribution: header.
A patch to fix this for INN 2.1 is supplied below. From quick
inspection, 2.2 appears to have the identical problem, and this same
patch would probably work.
-- Clifton
*** art.c 1999/11/18 22:55:09 1.1
--- art.c 1999/11/18 23:05:39
***************
*** 1,4 ****
! /* $Id: art.c,v 1.1 1999/11/18 22:55:09 cliftonr Exp $
**
** Article-processing.
*/
--- 1,4 ----
! /* $Id: art.c,v 1.2 1999/11/18 23:05:12 cliftonr Exp $
**
** Article-processing.
*/
***************
*** 2253,2258 ****
--- 2253,2266 ----
/* If we limit what distributions we get, see if we want this one. */
p = HDR(_distribution);
distributions = *p ? CommaSplit(p) : NULL;
+ /* CommaSplit can perfectly well return a null pointer for the first */
+ if (distributions && !distributions[0]) {
+ /* They just blew INN's next assumption out of the water... */
+ DISPOSE(distributions);
+ /* Treat an article with a null first distribution entry (e.g.
+ "Distribution: ,") as if it had no distribution line. */
+ distributions = NULL;
+ }
if (distributions) {
DISTparse(distributions, &Data);
if (ME.Distributions
*** innd.c 1999/11/18 22:51:27 1.1
--- innd.c 1999/11/18 22:54:42
***************
*** 1,4 ****
! /* $Id: innd.c,v 1.1 1999/11/18 22:51:27 cliftonr Exp $
**
** Variable definitions, miscellany, and main().
*/
--- 1,4 ----
! /* $Id: innd.c,v 1.2 1999/11/18 22:54:23 cliftonr Exp $
**
** Variable definitions, miscellany, and main().
*/
***************
*** 124,129 ****
--- 124,131 ----
** Return a short name that won't overrun our bufer or syslog's buffer.
** q should either be p, or point into p where the "interesting" part is.
*/
+ const char *NULL_STRING = "";
+
char *
MaxLength(p, q)
char *p;
***************
*** 132,137 ****
--- 134,142 ----
static char buff[80];
register int i;
+ if (NULL == p)
+ /* Uh-oh! */
+ return NULL_STRING;
/* Already short enough? */
i = strlen(p);
if (i < sizeof buff - 1)
--
Clifton Royston -- LavaNet Systems Architect -- cliftonr@lava.net
"An absolute monarch would be absolutely wise and good.
But no man is strong enough to have no interest.
Therefore the best king would be Pure Chance.
It is Pure Chance that rules the Universe;
therefore, and only therefore, life is good." - AC
Re: Patch for Distribution header problem
Author: Ray Rocker
Date: Thu, 18 Nov 1999 00:00
Date: Thu, 18 Nov 1999 00:00
25 lines
1411 bytes
1411 bytes
In article <8125rg$m5f$1@mochi.lava.net>, Clifton Royston <cliftonr@lava.net> wrote: > I'm amazed INN hasn't run into this before. My news server was >coming up and going down for about 6 hours til I finally tracked this >down with gdb. > > If you look at distributions, then this one could definitely bite >you; there are two careless assumptions made, one in innd.c and one in >art.c, which combine to give a probable SEGV on examining a certain >malformed Distribution: header. > > A patch to fix this for INN 2.1 is supplied below. From quick >inspection, 2.2 appears to have the identical problem, and this same >patch would probably work. Ahhhh. That is the same problem I alluded to in another post. inn-1.7.2+insync is vulnerable too. Thanks, saved me the trouble of writing a patch! -- Ray Rocker rocker@datasync.com
Re: Patch for Distribution header problem
Author: Miquel van Smoorenburg
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
15 lines
1217 bytes
1217 bytes
In article <8125rg$m5f$1@mochi.lava.net>, Clifton Royston <cliftonr@lava.net> wrote: > I'm amazed INN hasn't run into this before. My news server was >coming up and going down for about 6 hours til I finally tracked this >down with gdb. See http://www.miquels.cistron.nl/inn/ for a workaround using cleanfeed if you happen to run that. That way you won't have to recompile INN just yet. Mike. -- First things first, but not necessarily in that order.
Re: Patch for Distribution header problem
Author: Tuuli Tuominen
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
20 lines
1576 bytes
1576 bytes
On 19 Nov 1999 00:32:48 GMT, Clifton Royston wrote: > > A patch to fix this for INN 2.1 is supplied below. From quick >inspection, 2.2 appears to have the identical problem, and this same >patch would probably work. After reading these posts and the messages on the mailing list, I checked and found the article causing this on our 2.2 server. For some reason it did not crash the server, though. I'm definitely not complaining, but I'm kind of interested - why all you and not us? Something to do with our configuration then? Tuuli. -- In the midst of the word he was trying to say, In the midst of his laughter and glee He had softly and suddenly vanished away-- For the Snark _was_ a boojum, you see. --Lewis Carroll
Re: Patch for Distribution header problem
Author: Kai 'wusel' Siering
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
14 lines
1220 bytes
1220 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: % If your ME line in newsfeeds contains either no distribution % restrictions at all, or contains exclusion (negated) entries, then % you are immune, as far as I can tell. % Nope, "ME:*/!this,!that::" wasn't a safe bet either. I'd strongly suggest applying a NULL-test to MaxLength(), just to make sure you won't get hit again there. kai
Re: Patch for Distribution header problem
Author: Andrew Gierth
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
21 lines
1698 bytes
1698 bytes
>>>>> "Tuuli" == Tuuli Tuominen <tuuli.tuominen@helsinki.fi> writes: >> A patch to fix this for INN 2.1 is supplied below. From quick >> inspection, 2.2 appears to have the identical problem, and this >> same patch would probably work. Tuuli> After reading these posts and the messages on the mailing Tuuli> list, I checked and found the article causing this on our 2.2 Tuuli> server. For some reason it did not crash the server, Tuuli> though. I'm definitely not complaining, but I'm kind of Tuuli> interested - why all you and not us? Something to do with our Tuuli> configuration then? If your ME line in newsfeeds contains either no distribution restrictions at all, or contains exclusion (negated) entries, then you are immune, as far as I can tell. -- Andrew.
Re: Patch for Distribution header problem
Author: Andrew Gierth
Date: Fri, 19 Nov 1999 00:00
Date: Fri, 19 Nov 1999 00:00
44 lines
2418 bytes
2418 bytes
>>>>> "Clifton" == Clifton Royston <cliftonr@lava.net> writes:
Clifton> distributions = *p ? CommaSplit(p) : NULL;
Clifton> + /* CommaSplit can perfectly well return a null pointer for the first */
I don't believe that. If CommaSplit is called with a pointer to a
non-null character, then it will return a non-null pointer (which will
point to a null char if the original text started with a comma) as the
first pointer in the array.
Specifically, CommaSplit(",") should return { "", "", NULL }.
The bug, I suspect, is really here:
if (ME.Distributions
&& !DISTwantany(ME.Distributions, distributions)) {
(void)sprintf(buff, "%d Unwanted distribution \"%s\"",
NNTP_REJECTIT_VAL,
MaxLength(distributions[0], distributions[0]));
because DISTparse can cause distributions[0] to be NULL if all the
fields returned from CommaSplit are empty, and MaxLength (prior to
your other patch) explodes if passed a NULL pointer.
Notice that this only kicks in if ME.Distributions is set; if you have
no distributions on your ME line then nothing bad seems to happen.
I'd suggest either
if (ME.Distributions
+ && distributions[0]
&& !DISTwantany(ME.Distributions, distributions)) {
(void)sprintf(buff, "%d Unwanted distribution \"%s\"",
NNTP_REJECTIT_VAL,
MaxLength(distributions[0], distributions[0]));
which will treat an article with no non-empty distributions as a
wanted article, or just use your patch to MaxLength if you prefer
to reject such articles.
--
Andrew.
Re: Patch for Distribution header problem
Author: Andrew Gierth
Date: Sat, 20 Nov 1999 00:00
Date: Sat, 20 Nov 1999 00:00
15 lines
1391 bytes
1391 bytes
>>>>> "Kai" == Kai 'wusel' Siering <wusel@uu.org> writes: > Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: > % If your ME line in newsfeeds contains either no distribution > % restrictions at all, or contains exclusion (negated) entries, then > % you are immune, as far as I can tell. Kai> Nope, "ME:*/!this,!that::" wasn't a safe bet either. Oops, you're right. -- Andrew.
Re: Patch for Distribution header problem
Author: bill davidsen
Date: Tue, 23 Nov 1999 00:00
Date: Tue, 23 Nov 1999 00:00
40 lines
2673 bytes
2673 bytes
In article <1rln7p8mpp.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote: | [Russ Allbery] | | > And given that distribution restrictions aren't particularly | > useful (at least in my opinion) but have long been the default, | > that probably means that more inexperienced news admins were | > affected than experienced ones. Ugh.... | | Yeah. I'm a firm supporter of the Distribution-mechanism, but I don't | see the usefulness of distributions in ME. The Distribution selection | should be set on a peer to peer basis. Sorry, I think you are looking at this the wrong way. The distribution is not for feeding it is useful for "not feeding" certain articles. It gives a way to mark an article such that it does not go to the world. Used with the distributions file it can prevent accidental leakage of stuff which might be called spam in some places, or which might be offensive to some group of people. And if you want to be able to force an article to a peer which normally doesn't get it by group name, you can use a distribution type to do that. The days when most articles had a distribution are largely gone, and to tell the truth I don't recall that they ever existed to the point where I asked for a feed of a distribution. I do find it useful in some places to have the posting filter force a distribution on certain articles based on content, and it serves well to identify things to share. It's a useful solution to doing a bit of flow control which the user can override or invoke as desired. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
Re: Patch for Distribution header problem
Author: Kjetil Torgrim Homme
Date: Tue, 23 Nov 1999 00:00
Date: Tue, 23 Nov 1999 00:00
15 lines
1380 bytes
1380 bytes
[Russ Allbery] > And given that distribution restrictions aren't particularly > useful (at least in my opinion) but have long been the default, > that probably means that more inexperienced news admins were > affected than experienced ones. Ugh.... Yeah. I'm a firm supporter of the Distribution-mechanism, but I don't see the usefulness of distributions in ME. The Distribution selection should be set on a peer to peer basis. Kjetil T. (ME:!*:: -- no crash yet ;-)
Re: Patch for Distribution header problem
Author: Andrew Gierth
Date: Wed, 24 Nov 1999 00:00
Date: Wed, 24 Nov 1999 00:00
26 lines
1936 bytes
1936 bytes
>>>>> "Kjetil" == Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> writes: Kjetil> Yes, that's what I use it for. My server honours ifi, uio, Kjetil> uninett, norge, no, bofh and 4gh. The problem is that no two Kjetil> peers[1] has the same selection of these distribution, hence, Kjetil> using ME for distribution is not helpful, it just makes the Kjetil> file harder to follow. I think you misunderstand what the ME line does (not surprising, as it is difficult to imagine how it could have been made more confusing). The distributions parameter on ME controls what distributions you will _accept_. It doesn't affect outgoing feeds. The subscriptions parameter on ME is a default for _outgoing_ feeds, it doesn't affect incoming articles. The site aliases on ME affect _incoming_ articles, and have no effect on outgoing feeds. Confused? You will be.... -- Andrew.
Re: Patch for Distribution header problem
Author: Kjetil Torgrim Homme
Date: Wed, 24 Nov 1999 00:00
Date: Wed, 24 Nov 1999 00:00
28 lines
2002 bytes
2002 bytes
[bill davidsen]
> Sorry, I think you are looking at this the wrong way. The
> distribution is not for feeding it is useful for "not feeding"
> certain articles. It gives a way to mark an article such that it
> does not go to the world. Used with the distributions file it can
> prevent accidental leakage of stuff which might be called spam in
> some places, or which might be offensive to some group of people.
Yes, that's what I use it for. My server honours ifi, uio, uninett,
norge, no, bofh and 4gh. The problem is that no two peers[1] has the
same selection of these distribution, hence, using ME for distribution
is not helpful, it just makes the file harder to follow.
> And if you want to be able to force an article to a peer which
> normally doesn't get it by group name, you can use a distribution
> type to do that.
Are anyone running software which supports this anymore? (I'd love to
see an example of how it works.)
Kjetil T.
[1] Not completely true. The big hubs we peer with are outside all
these distributions.
Re: Patch for Distribution header problem
Author: Kjetil Torgrim Homme
Date: Thu, 25 Nov 1999 00:00
Date: Thu, 25 Nov 1999 00:00
27 lines
1838 bytes
1838 bytes
[Andrew Gierth] > I think you misunderstand what the ME line does (not surprising, > as it is difficult to imagine how it could have been made more > confusing). > > The distributions parameter on ME controls what distributions you > will _accept_. It doesn't affect outgoing feeds. > > The subscriptions parameter on ME is a default for _outgoing_ > feeds, it doesn't affect incoming articles. > > The site aliases on ME affect _incoming_ articles, and have no > effect on outgoing feeds. > > Confused? You will be.... Oh dear. So that's why it is so hard to stop inbound leaks in Usenet II with INN. Thank goodness I use Diablo for feeding, the DELDIST command affects both incoming and outgoing feeds, and I can set the list of accepted distributions by peer, not by server(!) Kjetil T.
Re: Patch for Distribution header problem
Author: Brad Knowles
Date: Thu, 25 Nov 1999 00:00
Date: Thu, 25 Nov 1999 00:00
18 lines
1773 bytes
1773 bytes
In article <1rn1s26cib.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme
<kjetilho@haey.ifi.uio.no> wrote:
> I think this should be fixed, though. Does anyone see a need for an
> asymmetric relationship? There is the old "Be liberal in what you
> accept, but conservative in what you send out", but I don't think that
> really applies here.
Agreed, this should affect inbound and outbound newsfeeds symmetrically.
--
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
Are you a USENET news server administrator outside of North America or
Western Europe? Would you like a newsfeed from a site in the Freenix
Top 65? If so, please contact me via private e-mail for details.
Re: Patch for Distribution header problem
Author: Kjetil Torgrim Homme
Date: Thu, 25 Nov 1999 00:00
Date: Thu, 25 Nov 1999 00:00
19 lines
1686 bytes
1686 bytes
[Kjetil Torgrim Homme] > Thank goodness I use Diablo for feeding, the DELDIST command > affects both incoming and outgoing feeds, and I can set the list > of accepted distributions by peer, not by server(!) Sorry, this is not correct. The DELDIST only affects the outgoing feed. Oops. Also, DELDIST sets the list of _not_ accepted distributions, of course. You use ADDDIST to list them explicitly. I think this should be fixed, though. Does anyone see a need for an asymmetric relationship? There is the old "Be liberal in what you accept, but conservative in what you send out", but I don't think that really applies here. Kjetil T.
Re: Patch for Distribution header problem
Author: Brad Knowles
Date: Wed, 01 Dec 1999 00:00
Date: Wed, 01 Dec 1999 00:00
21 lines
1807 bytes
1807 bytes
In article <823k8i$h3i$1@newssvr02.news.prodigy.com>, davidsen@tmr.com
(bill davidsen) wrote:
> | Agreed, this should affect inbound and outbound newsfeeds
> | symmetrically.
>
> Actually, no. You have separate means of controlling what you accept
> and what you send. Outgoing default is set by the ME line, and can be
> overridden if you want, on a per-host basis. This is good.
I believe that Kjetil was referring to whether this option should be
symmetric or asymmetric with respect to Diablo, not INN.
--
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
Are you a USENET news server administrator outside of North America or
Western Europe? Would you like a newsfeed from a site in the Freenix
Top 65? If so, please contact me via private e-mail for details.
Re: Patch for Distribution header problem
Author: bill davidsen
Date: Wed, 01 Dec 1999 00:00
Date: Wed, 01 Dec 1999 00:00
31 lines
2206 bytes
2206 bytes
In article <brad-2511991711450001@brad.techos.skynet.be>, Brad Knowles <brad@shub-internet.org> wrote: | In article <1rn1s26cib.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme | <kjetilho@haey.ifi.uio.no> wrote: | | > I think this should be fixed, though. Does anyone see a need for an | > asymmetric relationship? There is the old "Be liberal in what you | > accept, but conservative in what you send out", but I don't think that | > really applies here. | | Agreed, this should affect inbound and outbound newsfeeds symmetrically. Actually, no. You have separate means of controlling what you accept and what you send. Outgoing default is set by the ME line, and can be overridden if you want, on a per-host basis. This is good. Incoming is controlled by the active file (on a group basis). In recent INN you can set the acceptance of non-listed posts by setting the "wanttrash" in inn.conf. I believe that if you want to drop a newsgroup completely you can set the 'x' in active and any post with that group will be rejected. I haven't checked that it works, but that's the intent. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
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