Commit graph

9 commits

Author SHA1 Message Date
Andreas Kling
5dd5d5ca4e MenuApplets: Use unveil()
The Clock and Audio applets really only need ("/res", "r") for LibGUI.

The CPUGraph applet also needs ("/proc/all", "r") for reading the CPU
usage data. Somewhat surprisingly, this also adds ("/etc/passwd", "r")
since CProcessStatisticsReader does username lookups.
2020-01-21 15:52:48 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Andreas Kling
26a31c7efb 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.
2020-01-17 11:19:06 +01:00
Andreas Kling
f813bb52a2 Applications+DevTools+MenuApplets: Drop "unix" pledge when possible
Now that the "unix" pledge is no longer required for socket I/O, we can
drop it after making the connections we need in a program.

In most GUI program cases, once we've connected to the WindowServer by
instantiating a GApplication, we no longer need "unix" :^)
2020-01-12 12:03:57 +01:00
Andreas Kling
7b6b1bae02 MenuApplets: Use pledge() 2020-01-11 21:33:12 +01:00
Shannon Booth
7557251fac WindowServer: Move menu related code from WindowManager to MenuManager
Menus are now owned by menu manager instead of being split between the
window manager and menu manager. If the window server wants to change
a menu, or call menu related functionality, this will need to be done
through the menu manager.

Further refactoring is likely needed, but this seems like a good start
for seperating menu logic from window logic.
2020-01-05 09:02:24 +01:00
Andreas Kling
8721d54f24 Clock.MenuApplet: Only wake up once per second
This avoids an issue where we'd sometimes go longer than a whole second
between updates. Thanks to Roman May for the suggestion! :^)
2019-12-29 21:18:07 +01:00
Conrad Pankoff
04cbdb2e6f MenuApplets: Add gitignore for clock applet 2019-12-28 00:24:56 +01:00
Hüseyin ASLITÜRK
3d4dddd111 MenuApplets: Add Clock applet, move code from WindowServer to the applet. 2019-12-27 22:47:31 +01:00