[PATCH] Fix ruserok scalability with large ~/.rhosts file.

Carlos O'Donell carlos@redhat.com
Wed Jul 8 06:46:00 GMT 2015


On 07/08/2015 02:30 AM, Mike Frysinger wrote:
> On 18 Jun 2015 11:50, Carlos O'Donell wrote:
>> --- a/inet/rcmd.c
>> +++ b/inet/rcmd.c
>>
>> +	/* First check the user part.  This is an optimization, since
>> +	   one should always check the host first in order to detect
>> +	   negative host checks (which we check for later).  */
>> +	ucheck = __icheckuser (user, ruser);
> 
> the phrasing in this comment sounds confused, or maybe misleading ?

Rewritten as:

        /* First check the user part.  In a naive implementation we
           would check the host part first, then the user.  However,
           if we check the user first and reject the entry we will
           have saved doing any host lookups to normalize the comparison
           and that likely saves several DNS queries.  Therefore we
           check the user first.  */


>> +	    /* Next check host part */
> 
> style is incorrect (period/trailing space)

Fixed.

Given your review and no objections, and the testing we've done
on x86_64, i686, aarch64, s390, s390x, ppc64, and ppc64le I'm
considering this OK.

Checked in.

Cheers,
Carlos.



More information about the Libc-alpha mailing list