1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00

Kernel: Add getsockopt(SO_PEERCRED) for local sockets

This sockopt gives you a struct with the PID, UID and GID of a socket's
peer process.
This commit is contained in:
Andreas Kling 2019-12-06 18:38:36 +01:00
parent 6e6e0b9de8
commit 23e802518d
10 changed files with 72 additions and 12 deletions

View file

@ -432,7 +432,11 @@ Optional<KBuffer> procfs$net_local(InodeIdentifier)
auto obj = array.add_object();
obj.add("path", String(socket.socket_path()));
obj.add("origin_pid", socket.origin_pid());
obj.add("origin_uid", socket.origin_uid());
obj.add("origin_gid", socket.origin_gid());
obj.add("acceptor_pid", socket.acceptor_pid());
obj.add("acceptor_uid", socket.acceptor_pid());
obj.add("acceptor_gid", socket.acceptor_pid());
});
array.finish();
return builder.build();