Project

General

Profile

Actions

Feature #5182

open

Easier identification of the process at the other end of a UnixStream face

Added by Davide Pesavento over 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Category:
Faces
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Currently the remote FaceUri of a Unix face contains the file descriptor number of the NFD-side socket, e.g.: fd://42. This is not very useful to quickly determine which application is at the other end of an NFD face, or, conversely, which face corresponds to a given application.

We can do better by using (on Linux) the SO_PEERCRED socket option and extracting the pid field of the returned structure. I tested this on Ubuntu 21.04 and it seems to work as expected. A similar mechanism is available on macOS (LOCAL_PEERPID) and on recent versions of FreeBSD (LOCAL_PEERCRED).

Of course the PID value would need to be exposed somehow. For instance, we could define a new pid:// FaceUri scheme for this purpose. I'm open to suggestions on this point.

Actions

Also available in: Atom PDF