Is it possible to get a PID out of a QLocalSocket connection?

时间:2016-10-13 06:52:51

标签: linux qt unix-socket qlocalsocket qlocalserver

I'm building a client/server architecture where a client process can connect to a server using local Unix domain sockets.

The server process is implemented in Qt and uses QLocalServer and QLocalSocket to maintain the connection at the server end.

Is there a way to obtain the PID of the connecting client process from the connection information directly? I don't want to trust the client to tell me its PID over the socket connection as there's a risk the client may try to spoof another process's PID.

0 个答案:

没有答案