How to get caller pid in zmq (local socket)

Im new to zmq. I am using the same for local IPC on Linux based OS (socket is type AF_UNIX) But I couldn't find a way to get the process ID of the invocation (client). Is there a way to find the same with zmq? (Find the caller pid is necessary for my access control requirement and if zmq does not give the same then I have to switch to dbus) Please help me.

0


source to share


1 answer


Forget most of the low-level socket constructs and worries. Think higher in the sky. ZeroMQ is a higher level messaging concept. Thus, you will have problems with most socket-io problems.

Read more about these ZMQ principles in Pieter Hintjens' Design Styles and his resource-rich book "Code Connected, Vol.1".

However, the decision is completely under your control .

Decision



Create a task specific multi-zmq-socket / multi-zmq-pattern (multiple zmq primitives used and organized by your application layer logic) as a formal task-specific communication conversation.

Make sure to <sender>

add it PID

to your post.

Repeat / authorize via a different register / auth-socket-template pre-registered sender

from the outside receiver

to avoid a fake attack under a fake / stolen PID

identity.

Tailor your access control policy to suit your needs, use and implement any level of formal security handshake protocols for authentication or key exchange to increase the security of your access control policy to sufficient strengths (including MIL-STD).

+1


source







All Articles