diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 11:12:06 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 11:19:06 +0100 |
commit | 26a31c7efbb62e2836a2199a27e6377c50cc1896 (patch) | |
tree | f00732a2acd59eaa5a99858db8732d4b4c5e7001 /Applications/FontEditor | |
parent | a9b24ebbe86e2d3e98631454922ec08f4119c64b (diff) | |
download | serenity-26a31c7efbb62e2836a2199a27e6377c50cc1896.zip |
Kernel: Add "accept" pledge promise for accepting incoming connections
This patch adds a new "accept" promise that allows you to call accept()
on an already listening socket. This lets programs set up a socket for
for listening and then dropping "inet" and/or "unix" so that only
incoming (and existing) connections are allowed from that point on.
No new outgoing connections or listening server sockets can be created.
In addition to accept() it also allows getsockopt() with SOL_SOCKET
and SO_PEERCRED, which is used to find the PID/UID/GID of the socket
peer. This is used by our IPC library when creating shared buffers that
should only be accessible to a specific peer process.
This allows us to drop "unix" in WindowServer and LookupServer. :^)
It also makes the debugging/introspection RPC sockets in CEventLoop
based programs work again.
Diffstat (limited to 'Applications/FontEditor')
-rw-r--r-- | Applications/FontEditor/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Applications/FontEditor/main.cpp b/Applications/FontEditor/main.cpp index b143f3835e..f18ec99dc1 100644 --- a/Applications/FontEditor/main.cpp +++ b/Applications/FontEditor/main.cpp @@ -9,14 +9,14 @@ int main(int argc, char** argv) { - if (pledge("stdio shared_buffer unix rpath cpath wpath fattr", nullptr) < 0) { + if (pledge("stdio shared_buffer rpath accept unix cpath wpath fattr", nullptr) < 0) { perror("pledge"); return 1; } GApplication app(argc, argv); - if (pledge("stdio shared_buffer rpath cpath wpath", nullptr) < 0) { + if (pledge("stdio shared_buffer rpath accept cpath wpath", nullptr) < 0) { perror("pledge"); return 1; } |