James Carlson wrote:

<SNIP>
>>  The ident daemon knows the remote end of a TCP connection, but needs
>> to find the local endpoint of that connection, in order to identify the UID 
>> of the local process.  Is there
>> an official way to do this?  Utilities like `lsof' have a similar 
>> requirement.  I don't think that `pfiles' has
>> this ability.  `netstat' seems to use the MIB interface to list TCP 
>> connections.  Could that be used by
>> the ident daemon?
>>     
>
> No, because that interface tells you nothing about which process(es)
> are using a given socket, which is exactly the information needed.
>   
There is some limited information that can be extracted from the MIBs. 
You can find out the PID of the process that _created_ a particular 
TCP/UDP endpoint, however, it does not necessarily reflect who is 
currently using the socket (as pointed out below).

Anders
> (One of the obvious difficulties here is that it's not just a simple
> 1-1 mapping, so the usual RFE to provide a function to get "the" PID
> for a socket won't work.  A given socket may be open in multiple
> processes due to fork() and descriptor passing.)
>
> I believe lsof would need a lot of surgery to pass by our usual design
> and architectural reviews.  Not sure about pident, but the same may
> well be true.
>
>   


Reply via email to