getpeercred() on kfreebsd?

View: New views
4 Messages — Rating Filter:   Alert me  

getpeercred() on kfreebsd?

by Arthur de Jong-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello list (I'm not subscribed so please keep me in Cc).

I'm the maintainer of nss-ldapd. There is a slight problem on
kfreebsd-i386 and kfreebsd-amd64.

What is the best way on these architectures to get information about
clients that connect through a named socket?

I currently use this code:
http://arthurenhella.demon.nl/viewcvs/nss-ldapd/nss-ldapd/compat/getpeercred.c?view=markup
which works on a number of platforms but uses the fallthrough code at
the end on kfreebsd ports:
http://buildd.debian-ports.org/fetch.php?pkg=nss-ldapd&ver=0.6.2&arch=kfreebsd-i386&stamp=1210083229&file=log&as=raw
http://buildd.debian-ports.org/fetch.php?pkg=nss-ldapd&ver=0.6.2&&arch=kfreebsd-amd64&stamp=1209995009&file=log&as=raw

Also, the nss-ldapd test suite seems to fail on io.debian.org but not on
asdfasdf.debian.net. I haven't yet investigates this further though.

--
-- arthur - adejong@... - http://people.debian.org/~adejong --


signature.asc (204 bytes) Download Attachment

Re: getpeercred() on kfreebsd?

by Petr Salinger-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I'm the maintainer of nss-ldapd. There is a slight problem on
> kfreebsd-i386 and kfreebsd-amd64.
>
> What is the best way on these architectures to get information about
> clients that connect through a named socket?

It looks like a problem in our headers. On plain FreeBSD <sys/un.h> contains

/* Socket options. */
#define LOCAL_PEERCRED          0x001   /* retrieve peer credentials */
#define LOCAL_CREDS             0x002   /* pass credentials to receiver */
#define LOCAL_CONNWAIT          0x004   /* connects block until accepted */

We do not have it anywhere. It might be suitable for existing kfreebsd
specific <bits/socket.h> or for new kfreebsd specific <bits/sockaddr.h>.

> I currently use this code:
> http://arthurenhella.demon.nl/viewcvs/nss-ldapd/nss-ldapd/compat/getpeercred.c?view=markup
> which works on a number of platforms but uses the fallthrough code at
> the end on kfreebsd ports:
> http://buildd.debian-ports.org/fetch.php?pkg=nss-ldapd&ver=0.6.2&arch=kfreebsd-i386&stamp=1210083229&file=log&as=raw
> http://buildd.debian-ports.org/fetch.php?pkg=nss-ldapd&ver=0.6.2&&arch=kfreebsd-amd64&stamp=1209995009&file=log&as=raw
>
> Also, the nss-ldapd test suite seems to fail on io.debian.org but not on
> asdfasdf.debian.net. I haven't yet investigates this further though.

Please, could you test (on io.debian.org and asdfasdf.debian.net) whether
adding above mentioned defines directly in getpeercred.c really works ?

Many thanks

Petr


--
To UNSUBSCRIBE, email to debian-bsd-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: getpeercred() on kfreebsd?

by Arthur de Jong-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2008-06-06 at 22:10 +0200, Petr Salinger wrote:

> It looks like a problem in our headers. On plain FreeBSD <sys/un.h> contains
>
> /* Socket options. */
> #define LOCAL_PEERCRED          0x001   /* retrieve peer credentials */
> #define LOCAL_CREDS             0x002   /* pass credentials to receiver */
> #define LOCAL_CONNWAIT          0x004   /* connects block until accepted */
>
> We do not have it anywhere. It might be suitable for existing kfreebsd
> specific <bits/socket.h> or for new kfreebsd specific <bits/sockaddr.h>.
>
> Please, could you test (on io.debian.org and asdfasdf.debian.net) whether
> adding above mentioned defines directly in getpeercred.c really works?
I have added the above defined in the top my getpeercred.c and have
written a simple test and it seems to work.

For more information on the test:
http://arthurenhella.demon.nl/viewcvs/nss-ldapd/nss-ldapd/tests/test_getpeercred.c?view=markup

--
-- arthur - adejong@... - http://people.debian.org/~adejong --


signature.asc (204 bytes) Download Attachment

Re: getpeercred() on kfreebsd?

by Petr Salinger-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> Please, could you test (on io.debian.org and asdfasdf.debian.net) whether
>> adding above mentioned defines directly in getpeercred.c really works?
>
> I have added the above defined in the top my getpeercred.c and have
> written a simple test and it seems to work.

I added defines into our svn in <bits/socket.h>,
it have to propagate into glibc package.

Many thanks for pointing this out.

Petr


--
To UNSUBSCRIBE, email to debian-bsd-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...