Commit graph

142 commits

Author SHA1 Message Date
Jelle Raaijmakers 9510425845 Shell: Add TMPDIR environment variable
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/
V1_chap08.html

  TMPDIR  This variable shall represent a pathname of a directory made
          available for programs that need a place to create temporary
          files.

Ports like PHP benefit from having this environment variable set, and
there exist a lot of scripts that assume the presence of such an
environment variable.
2021-06-04 23:44:59 +02:00
Andreas Kling 33f2eeea4a pls: Drastically simplify this program
Since this program is setuid-root, it should be as simple as possible.

To that end, remove `/etc/plsusers` and use filesystem permissions to
achieve the same thing. `/bin/pls` is now only executable by `root` or
members of the `wheel` group.

Also remove all the logic that went to great lengths to `unveil()` a
minimal set of filesystem paths that may be used for the command.
The complexity-to-benefit ratio did not seem justified, and I think
we're better off keeping this simple.

Finally, remove pledge promises the moment they are no longer needed.
2021-05-30 23:09:37 +02:00
Jesse Buhagiar d44e2c9ad9 Userland: Check sudoers file perms and owner in pls
As per comment found in #6319 by @bcoles, `pls` should check the
permissions and owner of the sudoers file to ensure that it hasn't
been compromised.
2021-05-29 22:33:12 +04:30
Jesse Buhagiar 82b48d867d Userland: Implement pls, a sudo clone 2021-05-29 22:33:12 +04:30
Ali Mohammad Pur 27572c9d34 Base: Document the Shell's new termios allow-list
Also add `stty` to that list by default.
2021-05-24 23:26:49 +04:30
Andreas Kling 9c2786b872 Userland: Remove SymbolServer and the "symbol" user+group 2021-05-22 18:54:22 +02:00
Andreas Kling 59fd1f40ce WindowServer: Store system font queries in WindowServer.ini :^)
Changes to the system font settings are now persisted in /etc.
Note that you still need to restart the system for changes to fully
apply in all programs.
2021-05-21 20:15:51 +02:00
Andreas Kling 58d73ea36c Userland: Rename QuickShow => Image Viewer
The old name was a bit too ambiguous. This one is crystal clear. :^)
2021-05-14 18:34:44 +02:00
Andreas Kling 3d3a5b431f Services: Add InspectorServer to reverse the direction of Inspector
This service daemon will act as an intermediary between the Inspector
program and the inspectable programs it wants to inspect.

Programs can make themselves available for inspection by connecting
to /tmp/portal/inspectables using the Core::EventLoop RPC protocol.
2021-05-13 23:28:40 +02:00
Ali Mohammad Pur a527256356 Shell: Add an option to autosave history every N ms
...and set it to 10 seconds by default.
2021-05-11 10:19:07 +01:00
Valtteri Koskivuori 4d01183f5c Userland: Implement a magnifier app
This utility is useful for making sure those UI elements are pixel
perfect. A simple 2x/4x magnification around the mouse cursor, shown in
a window.
2021-05-11 10:18:29 +01:00
Ömer Kurttekin d922c2f5f3
Userland: Preserve keyboard mapping preference on reboot (#6955) 2021-05-09 15:56:03 +02:00
Andreas Kling a7e44d8b3c Base: Remove unnecessary UID separation of multi-process Browser
After looking closely at this, I realized that we've been running
all the service processes under separate user accounts even though
there's actually no need to.

Since we already use pledge() and unveil() to limit the scope and
access of these programs, separating them to another UID doesn't
achieve anything meaningful. So let's bring them back to the "anon"
user account and simplify things.

Programs affected:

- ImageDecoder
- RequestServer
- WebContent
- WebSocket

Longer term, I'd like for all of these to get spawned for the current
desktop user somehow, possibly by some kind of session manager, or
perhaps by the Browser program itself. But for now they remain under
SystemServer's control.
2021-05-06 13:33:08 +02:00
Sergey Bugaev 37a59f7f40 Base: Start LookupServer on boot
I can't say I like starting yet another thing on boot... but now that
LookupServer provides mDNS (and optionaly DNS) services to other hosts,
we have to start it on boot, not when the first local client connects.
2021-05-05 21:16:17 +02:00
Gunnar Beutner e69b729733 Ports: Use sendfd()/recvfd() for mm_send_fd()/mm_receive_fd() 2021-05-01 12:40:12 +02:00
Gunnar Beutner 302f9798ee LibC: Implement support for getspnam() and friends 2021-05-01 12:40:12 +02:00
Andreas Kling def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Linus Groh 649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +02:00
DexesTTP 71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP 62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
Andrew Kaster 89ee38fe5c Tests: Add environment variable for tests only
This is useful for CI where we don't want to spend a minute and a half
benchmarking Vector::append, and we don't have a good way to pass
test-specific arguments yet. :)
2021-04-25 09:36:49 +02:00
sin-ack aa56f9a1e0 LibGUI+WindowServer: Separate window manager IPC from regular IPC
With this patch the window manager related functionality is split out
onto a new endpoint pair named WindowManagerServer/Client.  This allows
window manager functionality to be potentially privilege separated in
the future.  To this end, a new client named WMConnectionClient
is used to maintain a window manager connection.  When a process
connects to the endpoint and greets the WindowServer as a window manager
(via Window::make_window_manager(int)), they're subscribed to the events
they requested via the WM event mask.

This patch also removes the hardcoding of the Taskbar WindowType to
receive WM events automatically.  However, being a window manager still
requires having an active window, at the moment.
2021-04-17 13:06:25 +02:00
Andreas Kling 9f4e37e342 Applications: Rename Serendipity => Welcome
Let's stick to the theme of "the most obvious name possible"
2021-04-15 20:50:24 +02:00
Andreas Kling 66a27f37db Base: Minor cleanups in SystemServer.ini
Fix up an outdated comment and remove some unnecessary Executable
values (since those are implied by the group name anyway.)
2021-04-04 20:13:55 +02:00
Andreas Kling 436a1dce34 ResourceGraph.Applet: Host both CPU and memory applet in one process
No reason we can't host these in the same process, and then we have
one less process to dynamically link at boot. :^)
2021-04-04 20:13:55 +02:00
Andreas Kling 23cc88f83b Userland: Rename *.MenuApplet => *.Applet
These are no longer displayed in the menu, so it doesn't make sense to
call them menu applets. :^)
2021-04-04 16:29:55 +02:00
Andreas Kling ee7693afa0 Base: Tweak default shell prompt 2021-04-04 09:03:16 +02:00
Andreas Kling 87b2725b1f Base: Tweak applet window order 2021-03-30 23:43:24 +02:00
Andreas Kling e94e94becc Base: Remove SystemMenu from SystemServer.ini 2021-03-26 08:20:53 +01:00
Andreas Kling 11e190b323 Base: Remove clock and username applets from startup
The clock has moved to the taskbar, and let's see how we feel without
the username being on screen all the time.
2021-03-25 22:40:51 +01:00
Andreas Kling 822d7da6cc Base: Make the default prompt a different color for root 2021-03-11 18:55:16 +01:00
Brendan Coles 6ac2d3e1bd Base: Add egrep and rgrep aliases to /etc/shellrc 2021-03-06 09:43:13 +01:00
Andreas Kling 2119c9e801 Base: Remove two outdated aliases from /etc/shellrc 2021-03-04 10:28:46 +01:00
Andreas Kling 157af93d69 Base: Set a nice PROMPT in /etc/shellrc :^) 2021-03-03 20:37:23 +01:00
thankyouverycool 71a123148a Serendipity: A new welcome app
Provides the basic Help+ReadMe care package to new users and some
interesting tips to get started. Feel free to add more!
2021-03-02 11:57:27 +01:00
Andrew Kaster 611bbc43be Base/CI: Boot serenity in CI in a mode that runs tests on target
Build a new version of Serenity in CI that doesn't have all the debug
symbols on, or we'd be waiting a very long time to boot.

Insert a TestRunner entry into SystemServer.ini that will run a shell
script that runs tests in /bin and /usr/Tests and shuts down the system
in the new self-test boot mode. Also make sure enough basic services are
started in self-test such that the tests will actually run properly.
2021-02-28 18:19:37 +01:00
thankyouverycool 42717b5b79 Base: Add new icons for fonts and File Manager 2021-02-25 08:08:26 +01:00
Sergey Bugaev 373d135e74 LookupServer: Implement a DNS server :^)
LookupServer can now itself server as a DNS server! To service DNS clients, it
uses the exact same lookup logic as it does for LibIPC clients. Namely, it will
synthesize records for data from /etc/hosts on its own (you can use this to
configure host names for your domain!), and forward other questions to
configured upstream DNS servers. On top of that, it implements its own caching,
so once a DNS resource record has been obtained from an upstream server,
LookupServer will cache it locally for faster future lookups.

The DNS server part of LookupServer is disabled by default, because it requires
you to run it as root (for it to bind to the port 53) and on boot, and we don't
want either by default. If you want to try it, modify SystemServer.ini like so:

[LookupServer]
Socket=/tmp/portal/lookup
SocketPermissions=666
Priority=low
KeepAlive=1
User=root
BootModes=text,graphical

and enable server mode in LookupServer.ini like so:

[DNS]
Nameservers=...
EnableServer=1

If in the future we implement socket takeover for IP sockets, these limitations
may be lifted.
2021-02-15 09:14:42 +01:00
Andreas Kling aefd206038 SymbolServer: Add symbolication service for out-of-process ELF parsing
This patch adds SymbolServer, a service daemon that provides
symbolication of ELF binaries. It has a very simple IPC API at the
moment that only turns addresses into symbol names.

This can be used to implement symbolication without having to do
in-process ELF parsing yourself. :^)
2021-02-04 23:19:08 +01:00
Ben Wiederhake d24e287f8c Base: Make /www read-write by default
Since it is owned by root anyway, there is no need for 'additional security' to prevent
modification of that directory. This makes it easier to quickly export files from
Serenity. Fixes #5152.
2021-02-03 21:23:15 +01:00
Andreas Kling 47a4a5ac1d Base: Add root to the /etc/shadow file
The password is still empty by default, but being present in the shadow
file is now a requirement for authentication.
2021-01-21 11:35:32 +01:00
Nico Weber 362bde4a86 SystemServer.ini: Default to not showing network change notifications
Until someone has time to implement something for not showing the
very first network change at boot, let's turn off notifications for
network changes by default altogether. Having to dismiss this
notification at every boot gets old fast.
2021-01-20 21:01:21 +01:00
Nico Weber ca264030a2 WindowServer: Put default ScaleFactor in ini file
No behavior change. Matches Width and Height which also explicitly
have their default value in the ini file.
2021-01-17 08:06:12 +01:00
Nico Weber 699ba84bea DisplaySettings: Rename wallpaper setting "scaled" to "stretch"
I want to add a scale factor for picking pixel density, and using
the same terminology for wallpaper handling would be confusing.
2021-01-15 19:13:46 +01:00
Emanuele Torre a330f37f06 Base: Change anon's default password from "foo\n" to just "foo". 2021-01-10 16:40:05 +01:00
Andreas Kling 9a688af4b1 LibCore+passwd+su+Base: Add /etc/shadow to hide hashes from users :^)
This patch moves the user account password hashes from /etc/passwd,
where they were world-readable, to /etc/shadow, where only root can
access them.

The Core::Account class is extended to support both authentication
against, and modification of /etc/shadow.

The default password for "anon" as of this commit is "foo" :^)
2021-01-09 19:41:12 +01:00
Andreas Kling 78fbfd7795 Meta: Update project copyright dates (2018-2021) :^) 2021-01-01 01:14:16 +01:00
AnotherTest e7e5a5e677 Base: Add Amazon's intermediate root certificate (Server CA 1B) 2020-12-30 13:31:55 +01:00
Idan Horowitz db409db4e9 WindowServer: Added configurable mouse acceleration and scroll length
The settings are also saved to the config file to survive reboots.
2020-12-30 11:58:52 +01:00
Liav A 247517cd4a Kernel: Introduce the DevFS
The DevFS along with DevPtsFS give a complete solution for populating
device nodes in /dev. The main purpose of DevFS is to eliminate the
need of device nodes generation when building the system.

Later on, DevFS will assist with exposing disk partition nodes.
2020-12-27 23:07:44 +01:00