=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth-rhosts.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/usr.bin/ssh/auth-rhosts.c 1999/09/30 05:43:33 1.4 +++ src/usr.bin/ssh/auth-rhosts.c 1999/10/03 20:09:18 1.5 @@ -16,34 +16,13 @@ */ #include "includes.h" -RCSID("$Id: auth-rhosts.c,v 1.4 1999/09/30 05:43:33 deraadt Exp $"); +RCSID("$Id: auth-rhosts.c,v 1.5 1999/10/03 20:09:18 deraadt Exp $"); #include "packet.h" #include "ssh.h" #include "xmalloc.h" #include "uidswap.h" -/* Returns true if the strings are equal, ignoring case (a-z only). */ - -static int casefold_equal(const char *a, const char *b) -{ - unsigned char cha, chb; - for (; *a; a++, b++) - { - cha = *a; - chb = *b; - if (!chb) - return 0; - if (cha >= 'a' && cha <= 'z') - cha -= 32; - if (chb >= 'a' && chb <= 'z') - chb -= 32; - if (cha != chb) - return 0; - } - return !*b; -} - /* This function processes an rhosts-style file (.rhosts, .shosts, or /etc/hosts.equiv). This returns true if authentication can be granted based on the file, and returns zero otherwise. */ @@ -138,7 +117,7 @@ continue; } else - if (!casefold_equal(host, hostname) && strcmp(host, ipaddr) != 0) + if (strcasecmp(host, hostname) && strcmp(host, ipaddr) != 0) continue; /* Different hostname. */ /* Verify that user name matches. */