[BACK]Return to auth-rhosts.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/auth-rhosts.c between version 1.4 and 1.5

version 1.4, 1999/09/30 05:43:33 version 1.5, 1999/10/03 20:09:18
Line 23 
Line 23 
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "uidswap.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  /* This function processes an rhosts-style file (.rhosts, .shosts, or
    /etc/hosts.equiv).  This returns true if authentication can be granted     /etc/hosts.equiv).  This returns true if authentication can be granted
    based on the file, and returns zero otherwise. */     based on the file, and returns zero otherwise. */
Line 138 
Line 117 
             continue;              continue;
         }          }
       else        else
         if (!casefold_equal(host, hostname) && strcmp(host, ipaddr) != 0)          if (strcasecmp(host, hostname) && strcmp(host, ipaddr) != 0)
           continue; /* Different hostname. */            continue; /* Different hostname. */
   
       /* Verify that user name matches. */        /* Verify that user name matches. */

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5