Re: Incorrect service port handling in nss/services.c
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
Re: Incorrect service port handling in nss/services.c
- From: Arthur de Jong <arthur [at] arthurdejong.org>
- To: nss-pam-ldapd-users <nss-pam-ldapd-users [at] lists.arthurdejong.org>
- Subject: Re: Incorrect service port handling in nss/services.c
- Date: Tue, 27 Jul 2010 08:29:38 +0200
On Mon, 2010-07-26 at 17:24 -0700, Ted C. Cheng wrote:
> Thank you for the clarification. I think I am confused by the read_servent
> routine under nss/services.c:
>
> static enum nss_status read_servent(
> TFILE *fp,struct servent *result,
> char *buffer,size_t buflen,int *errnop)
> {
> ...
> /* store port number in network byte order */
> READ_TYPE(fp,tmpint32,int32_t);
> result->s_port=ntohs((uint16_t)tmpint32); <---
> ...
> return NSS_STATUS_SUCCESS;
> }
>
> The comment mentioned that network byte order is used to store port number.
> But "ntohs" is called for s_port, which seems to do the opposite.
> PADL implementation uses "htons", instead.
It should have been htons() in that function indeed. Thanks for pointing
it out (fixed now). The reason things still worked correctly is that
ntohs() and htons() do exactly the same thing.
--
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org --
--
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users
- Re: Incorrect service port handling in nss/services.c, (continued)
Re: Losing users & groups from Active Directory 2008r2,
Emmanuel Lesouef