[news.software.b] Vnews won't cancel articles

merlin@hqda-ai.UUCP (David S. Hayes) (10/19/87)

     Vnews doesn't seem able to cancel articles on behalf of a
normal user.

Repeat-by: 
     As a normal user (not a news administrative login),
post an article to misc.test, local distribution.  Run "vnews -n
misc.test", and try to cancel the article.  Results in "can't
cancel what you didn't write".

     I've traced this to the file "visual.c", function
"cancel_command".  Here's a portion of the function:

cancel_command()
{
	register char *poster, *r;
	int notauthor;
	char *senderof();

	poster = senderof(h);
	/* only compare up to '.' or ' ' */
	r = index(poster,'.');
	if (r == NULL)
		r = index(poster,' ');
	if (r != NULL)
		*r = '\0';
	tfilename = filename;
	notauthor = STRCMP(username, poster);
	if (uid != ROOTID && uid && notauthor) {
		msg("Can't cancel what you didn't write.");
		return;
	}


     As you can see, the check is against the username, compared
to the name of the author.  The check stops on reaching the first
dot or space.  In my case, this resulted in comparing "merlin",
the username, against "merlin@hqda-ai", the poster.

     It seems to me that the comparison is stopping in the wrong
place.  Should it stop at the '@' symbol?  I'd do that instead of
the dot, but I don't know if that would result in my users
cancelling articles written by people with similar names on other
machines.

     Any ideas gratefully accepted.  Thanks,
-- 
David S. Hayes, The Merlin of Avalon	PhoneNet:  (202) 694-6900
UUCP:  *!uunet!cos!hqda-ai!merlin	ARPA:  ai01@hios-pent.arpa