This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #15374] Make getent services compliant with RFC 6335 section 5.1
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Thu, 31 Oct 2013 21:56:24 +0100
- Subject: Re: [PATCH][BZ #15374] Make getent services compliant with RFC 6335 section 5.1
- Authentication-results: sourceware.org; auth=none
- References: <20131020180745 dot GA18200 at domone dot podge> <527256A2 dot 40902 at redhat dot com> <20131031133244 dot GA19495 at domone dot podge> <52725CB7 dot 30300 at redhat dot com> <20131031150144 dot GA20903 at domone dot podge> <20131031202848 dot 6F4B274699 at topped-with-meat dot com>
On Thu, Oct 31, 2013 at 01:28:48PM -0700, Roland McGrath wrote:
> A leading - is not valid. So use strtoul.
This is guarded by
+ if (0 <= port && port <= 65535)
+ serv = getservbyport (htons (port), proto);
so negative numebers will not be matched. User still can specify -0 to
get port 0 which is bit questionable.