]> git.ipfire.org Git - thirdparty/systemd.git/commit
Enforce per-user quota on /tmp/ and /dev/shm/ as user logs in (#36010)
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Jan 2025 11:52:27 +0000 (12:52 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Jan 2025 11:52:27 +0000 (12:52 +0100)
commitd6b008b01ee07180dab067597736622616b8e97f
treeae0acb5b924e408b6c2ca86712ab23df299bf03a
parent8dab59e610720c022f962311069c95fd8569f82a
parent0054b7dce986b73e6cb10bf4ae51a1dd5ef57191
Enforce per-user quota on /tmp/ and /dev/shm/ as user logs in (#36010)

There's finally quota on tmpfs, hence let's use it to make it harder for
users to DoS the system by consuming all disk space in /tmp/ and
/dev/shm/.

This enforces a default limit of 80% quota of the backing fs for these
two dirs for users, but this can be overriden in the user record, if
desired.

This also adds two other interesting features:

1. mount units gain GracefulOptions= which takes optional mount options
that are added only if supported by the kernel. (this is used to enable
usrquota on /tmp/, if available.)
2. The PAM logic in service management now supports reading passwords
from service credentials and via the askpw logic. This used for make
testing easy (so that we can run0 into a homed user which strictly
requires a password).
TODO
src/shared/user-record.c