lists.arthurdejong.org
RSS feed

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



On Mon, 2010-07-26 at 11:50 -0700, Ted C. Cheng wrote:
> Please find attached source code for testgetservbyname.c.

I'm afraid the problem is in your test code. Attached is a patch.

The getservbyname(3) manual page says about s_port: "The port number for
the service given in network byte order." so any client application
should use ntohs() before use. Check it with an entry from /etc/services
(e.g. www).

With the patch it works on Debian Gnu/Linux squeeze (Glibc 2.11.2 on
i386 but it was originally developed and tested on Glibc 2.3.2). Glibc
has been known [1] to change byte order around for some internals but I
don't think that is the case here.

Anyway, thanks for testing nss-pam-ldapd.

[1] http://sourceware.org/ml/glibc-cvs/2009-q3/msg00000.html

-- 
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org --

Attachment: testgetservbyname.c.patch
Description: Text Data

--
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users