Subject: Re: lib/10638: vacation doesn't do case insensitive mailalias comparisons
To: None <Thilo.Manske@HEH.Uni-Oldenburg.DE>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 07/20/2000 12:27:31
[ On Thursday, July 20, 2000 at 14:30:14 (+0200), Thilo.Manske@HEH.Uni-Oldenburg.DE wrote: ]
> Subject: lib/10638: vacation doesn't do case insensitive mailalias comparisons
>
> >Fix:
> 
> Looks like a small typo to me:
> 
> --- vacation.c.orig	Sun Dec 20 13:18:40 1998
> +++ vacation.c	Thu Jul 20 14:23:45 2000
> @@ -275,7 +275,7 @@
>  	size_t len;
>  
>  	for (len = strlen(name); *str; ++str)
> -		if (*str == *name && !strncasecmp(name, str, len))
> +		if (*str == *name || !strncasecmp(name, str, len))
>  			return(1);
>  	return(0);
>  }

Your fix is definitely wrong.  It will result in matches when only the
first letter is identical.

The correct fix is to either remove the first term of the expression, or
to fix the "optimisation" to do a case-insensitive comparison of the
first letter.  I prefer removing the questionable optimisation....

Of course that's not the only bug in the distributed version of
vacation!  The above bug and many others are fixed in my version:

	ftp://ftp.weird.com/pub/local/vacation.shar

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>