serenity
serenity copied to clipboard
LoginServer: Track user sockets by sid instead of uid
This PR moves user sockets to per login session instead of per user id. This has two important advantages:
- Commands run as root with
pls(1)
will use the correct servers - There can be multiple concurrent logged in sessions with the same user each running their own services.
Currently there is one major issue with this PR and that is that clients need to unveil /proc/all
and /etc/passwd
and pledge proc
. I can think of a few solutions to this:
- Remove or make optional the
process.username
field inProcessStatisticsReader
to get rid of the required/etc/passwd
unveil, which is the biggest security issue. - Add a
getrootsid(2)
to implementCore::session::root_session_id()
in the kernel. this would prevent any reads and be very simple to implement.
Hello!
One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits
CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.