[news.software.b] bogus

steve@nuchat.UUCP (Steve Nuchia) (04/29/87)

Something's fishy here.... ulall() in expire.c attempts to
disect the list of names by which a condemned article is
known, then it executes a body of code that correctly
disposes of that article.

However, there seems to be a sepcial case that circumvents
most of the processing, including archiving.  Observe:

/* Unlink (using unwound tail recursion) all the articles in 'artlist'. */
ulall(artlist, hp)
{
[...]
    do {
[...]
	while (*artlist == ' ' || *artlist == '\n' || *artlist == ',')
	    artlist++;
	if (*artlist == '\0') return;
	p = index(artlist, ' ');
	if (p == NULL) {
		last = 1;
		p = index(artlist, '\n');
	}
[this looks REAL fishy -- it seems to happen to the last name]
	if (p == NULL) {
	    last = 1;
	    fn = dirname(artlist);
[look, ma! no verbose, no archive!]
	    if (UNLINK(fn) < 0 && errno != ENOENT)
				perror(fn);
	    return;
	}
[end of fishy part]
	if (p) *p = 0;

[beginning of normal destruction sequence]
[...]
	if (ngmatch(newname, ngpat)) {
		if (doarchive)
[archive code here [...]]
		if (verbose)
[etc...]
		if (UNLINK(fn) < 0 && errno != ENOENT)
			perror(fn);
	}
[...]
	artlist = p + 1;
    } while (!last);
}

---------------

Ok, on another inspection I see that it only happens if the  list
of  names is not terminated with a newline.  But WHY? I don't see
how things would work any less well  without  the  fishy  code...
unless  its  the "artlist = p + 1" you're worried about... That's
easy enough to fix... in fact it is fixed, since last has already
been  set.   Useless  and  dangerous  code.   Or  have  I  missed
something?  I'm running with the  fishy  section  commented  out,
although I see now that this probably isn't the reason my oldnews
directory wasn't growing.  I probably need to rebuild my  history
files.  sigh.

This is a lot of lines for such a  small  problem,  but  I'll  go
ahead and post it anyway... Tailbone (vestigal) code like this is
best exposed and removed as soon as possible.

        steve