LibIPC: Add setters for overriding the client/server PID if needed

Since SO_PEERCRED can only tell us who originally accepted the socket
on the other side, we'll sometimes need to negotiate PID info manually.
This commit is contained in:
Andreas Kling 2020-06-21 21:20:36 +02:00
parent 6bc40b20b8
commit ed351c7493
Notes: sideshowbarker 2024-07-19 05:28:05 +09:00
2 changed files with 4 additions and 0 deletions

View file

@ -198,7 +198,9 @@ public:
}
int client_id() const { return m_client_id; }
pid_t client_pid() const { return m_client_pid; }
void set_client_pid(pid_t pid) { m_client_pid = pid; }
virtual void die() = 0;

View file

@ -75,6 +75,8 @@ public:
virtual void handshake() = 0;
pid_t server_pid() const { return m_server_pid; }
void set_server_pid(pid_t pid) { m_server_pid = pid; }
void set_my_client_id(int id) { m_my_client_id = id; }
int my_client_id() const { return m_my_client_id; }