ssh-keygen -R is case-sensitive, but should not be

Griff Miller II griff.miller at oplink.net
Sat Apr 16 08:32:24 AEST 2016


Here is a better patch. Somehow I pasted an older version of my edits:

-------------------------------------------------------
% diff ./match.c /home/millerig/osrc/openssh-7.2p2/match.c
121a122
> 	char *low_string = 0;
156,159c157,168
< 		if (match_pattern(string, sub)) {
< 			if (negated)
< 				return -1;		/* Negative */
< 			else
---
> 		if (dolower) {
> 			u_int j;
> 			if (low_string) free(low_string);
> 			low_string = malloc(strlen(string) + 1);
> 			for (j = 0; j < strlen(string); ++j) low_string[j] = tolower(string[j]);
> 			low_string[j] = 0;
> 		}
> 		if (match_pattern((dolower ? low_string : string), sub)) {
> 			if (negated) {
> 				got_positive = -1;		/* Negative */
> 				break;
> 			} else
165,166c174,175
< 	 * Return success if got a positive match.  If there was a negative
< 	 * match, we have already returned -1 and never get here.
---
> 	 * Return success if there was a positive match;
> 	 * return -1 if there was a negative match.
167a177
> 	if (low_string) free(low_string);
-------------------------------------------------------



More information about the openssh-unix-dev mailing list