[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [leafnode-list] Multi-level Local Newsgroups Name Bugs
Stefan Wiens <s.wi@xxxxxxx> writes:
> "Bulgrien, Dennis" <Dennis.Bulgrien@xxxxxxxxxxxxxxxxxx> writes:
>
> > Given Local Newsgroups:
> > x
> > x.y
>
> I'd avoid that, although Leafnode should cope with it.
Why should it? There's no such thing in real life, if x is to be split,
it is renamed x.misc and the new group x.y added.
> > Jun 25 11:33:07 arendi leafnode[8252]: wrote
> > /var/spool/news/x.y/.overview
-----
Something's really broken there.
> @@ -662,7 +663,7 @@
> /* count articles in group */
> i = 0;
> if ( (d = opendir( "." )) != NULL ) {
> - while ( ( de = readdir(d) ) != NULL ) {
> + while ((g->first+i < g->last) && (de=readdir(d)) != NULL) {
> if ( de->d_name[0] != '.' )
> i++;
> }
readdir is fast, don't bother.
> @@ -798,9 +799,11 @@
> }
> }
>
> -void dolist( char *arg ) {
> +void dolist( char *oarg ) {
> char * p = NULL;
>
> + char *arg = strdup(oarg);
> +
> if ( !strcasecmp(arg, "extensions") ) {
> nntpprintf("202 extensions supported follow");
> printf( " OVER\r\n"
Wow. Crash here in OOM condition, the same bug you just reported against
my getxoverline() :-) You need to check arg against the 0 pointer.
> It would also be legitimate to simply estimate article count doing:
> g->count = ((g->last > g->first) ? (g->last - g->first) : 0)
> and forget about readdir().
Yup, but I'd write it differently:
g->count = g->last - g->first + 1;
if (g->count < 0) g->count = 0;
> There is still a small problem: leafnode will only update the
> groupinfo file (and add new local groups) if an article is posted.
>
> The above patches should eliminate the flaws you reported.
I will take most of them into my "ma" tree and torture them.
--
Matthias Andree
--
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list