Associating Local Port Number to PID

Pete Wenzel pete at stc.com
Wed Jan 24 22:16:07 PST 1996


"Karl A. Siil" <karl at cosmos.cosmos.att.com> writes:

> I'm working on a program for UNIX (SVR4, Solaris 2.4) systems that needs to
> associate PID with local TCP/IP port number, so as to pass session keys
> accordingly to already running processes. This sounds like such an obviously
> needed association that someone must have done it already.

Take a look at how implementations of identd (RFC 1413) do it.  This daemon
associates a TCP port with its UID, but I'm sure the PID is very close by
in the netstat data structures.  It might actually find the PID first, then
look up its owner's UID.

Anyway, look at the pidentd stuff at ftp://ftp.lysator.liu.se/pub/ident/.

--Pete
 ======= Pete Wenzel === Senior Member, Technical Staff and DNRC =======
 == Software Technologies Corp.,  P. O. Box 661090, Arcadia, CA 91066 ==
 == Phone: 818-445-7000 x311 = http://www.stc.com = FAX: 818-447-0879 ==
http://PGP.ai.mit.edu/htbin/pks-extract-key.pl?op=get&search=pete@stc.com






More information about the cypherpunks-legacy mailing list