summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* tests: make / private after creating a mount namespaceEvegeny Vereshchagin2018-06-28
| | | | | | so that the test never affects the root namespace. (cherry picked from commit c58fd466a313a1f93df1792822e358c67990bcdf)
* core: ignore errors from cg_create_and_attach() in test mode (#8401)Michal Sekletar2018-06-28
| | | | | | | | | | | | | | | | | | | | | | | | Reproducer: $ meson build && cd build $ ninja $ sudo useradd test $ sudo su test $ ./systemd --system --test ... Failed to create /user.slice/user-1000.slice/session-6.scope/init.scope control group: Permission denied Failed to allocate manager object: Permission denied Above error message is caused by the fact that user test didn't have its own session and we tried to set up init.scope already running as user test in the directory owned by different user. Let's try to setup cgroup hierarchy, but if that fails return error only when not running in the test mode. Fixes #8072 (cherry picked from commit aa77e234fce7413b7dd64f99ea51450f2e2e9dbd)
* basic/cgroup-util: remove unused variableZbigniew Jędrzejewski-Szmek2018-06-28
| | | | (cherry picked from commit eef03d70c1bedb3aabd4e2bcf10ab1f2678443bf)
* core: do not free heap-allocated strings (#8391)Yu Watanabe2018-06-28
| | | | | | Fixes #8387. (cherry picked from commit 5cbaad2f6795088db56063d20695c6444595822f)
* sd-bus: do not try to close already closed fd (#8392)Yu Watanabe2018-06-28
| | | | | | Fixes #8376, which is introduced by 2b33ab0957f453a06b58e4bee482f2c2d4e100c1. (cherry picked from commit 280029d18f470a64403d68717eef1be5274ff8af)
* Add locale.h header, needed by freelocale()Danilo Spinella2018-06-22
| | | | | Without locale.h, there is an implicit declaration of function `freelocale`, which is reported as error by -Werror=implicit-function-declaration.
* Prep v238: Make a real distinction between 'halt' and 'poweroff'.Sven Eden2018-06-12
|
* Prep v238: Fix cg_path_decode_unit() to understand elogind session naming.Sven Eden2018-06-11
| | | | (cherry picked from commit d8949c3072a4b984d6fa964178a2d8d945ecbcb6)
* Prep v238: Fix elogind_daemonize(), it failed due to some misunderstandings ↵Sven Eden2018-06-08
| | | | | | on my side. (cherry picked from commit 1c9629692145891f10a36227749470d87979dd0b)
* logind-user.c: As we need special.h elsewhere now, use it here, too.Sven Eden2018-06-08
| | | | (cherry picked from commit a96cb75c17b008312fca8f81bc2a126f8a87850c)
* pam_elogind.c: Remove renames by mask, check_tree.pl can handle this now.Sven Eden2018-06-08
| | | | (cherry picked from commit 6964ec46218d41d699690ed590026249969b2257)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/test (6/6)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/shared (5/6)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/login (4/6)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/libelogind (3/6)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/core (2/6)
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/basic (1/6)
* Prep v238: Remove obsolete sources and add missing new ones.Sven Eden2018-06-05
|
* Prep v238: Fixed meson.build files in src/shared and src/testSven Eden2018-06-04
|
* Prep v238: Applied some upstream updates to src/libelogind (5/5)Sven Eden2018-06-04
|
* Prep v238: Applied some upstream updates to src/core (4/5)Sven Eden2018-06-04
|
* Prep v238: Applied some upstream updates to src/basic (3/5)Sven Eden2018-06-04
|
* login: remember that fds received from PID1 need to be removed eventuallyAlan Jenkins2018-05-30
| | | | | Remember to set sd->pushed_fd when we receive an fd from PID1 on startup, the same as we set it when we send an fd to PID1.
* login: fix FDNAME in call to sd_pid_notify_with_fds()Alan Jenkins2018-05-30
| | | | | | | | | | | | | | | $ git grep FDNAME logind-session-device.c: ... "FDNAME=session-", sd->session->id); logind-session-device.c: ... "FDNAME=session", sd->session->id); Oops. Fixes #8343. Or at least a more minimal reproducer. Xorg still dies when logind is restarted, but the Xorg message says this is entirely deliberate. (This could also be the reason I hit #8035, instead of the race condition I originally suggested).
* fd-util: drop stdio_unset_cloexec(), it's not used anymoreLennart Poettering2018-05-30
|
* sd-bus: let's better not invade stdio territory when duplicating fdsLennart Poettering2018-05-30
|
* tree-wide: port various places over to use new rearrange_stdio()Lennart Poettering2018-05-30
|
* terminal-util: port some generic code over to rearrange_stdio()Lennart Poettering2018-05-30
|
* fd-util: add new call rearrange_stdio()Lennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | Quite often we need to set up a number of fds as stdin/stdout/stderr of a process we are about to start. Add a generic implementation for a routine doing that that takes care to do so properly: 1. Can handle the case where stdin/stdout/stderr where previously closed, and the fds to set as stdin/stdout/stderr hence likely in the 0..2 range. handling this properly is nasty, since we need to first move the fds out of this range in order to later move them back in, to make things fully robust. 2. Can optionally open /dev/null in case for one or more of the fds, in a smart way, sharing the open file if possible between multiple of the fds. 3. Guarantees that O_CLOEXEC is not set on the three fds, even if the fds already were in the 0..2 range and hence possibly weren't moved.
* coccinelle: add reallocarray() coccinelle scriptLennart Poettering2018-05-30
| | | | | Let's systematically make use of reallocarray() whereever we invoke realloc() with a product of two values.
* Organize the ANSI codes and add missing colorsAlexander F Rødseth2018-05-30
| | | | For consistency.
* logind: fix typo in commentLennart Poettering2018-05-30
|
* logind: open device if neededLennart Poettering2018-05-30
| | | | Fixes: #8291
* logind: cast away return value we don't care aboutLennart Poettering2018-05-30
|
* logind: voidify a function we never check the return value ofLennart Poettering2018-05-30
|
* mount-setup: change bpf mount mode to 0700 (#8334)Lennart Poettering2018-05-30
| | | | | After discussing with the kernel folks, we agreed to default to 0700 for this. Better safe than sorry.
* Remove /sbin from paths if split-bin is false (#8324)Zbigniew Jędrzejewski-Szmek2018-05-30
| | | | Follow-up for 157baa87e4.
* procfs-util: drop unnecessary zero initializations (#8321)Lennart Poettering2018-05-30
| | | | Follow-up for #8149.
* basic/cgroup-util: simplify cg_get_keyed_attribute(), add testZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | I didn't like the nested loop where we'd count what we have acquired already, since we should always know that.
* core: turn on memory/cpu/tasks accounting by default for the root sliceLennart Poettering2018-05-30
| | | | | | | | The kernel exposes the necessary data in /proc anyway, let's expose it hence by default. With this in place "systemctl status -- -.slice" will show accounting data out-of-the-box now.
* core: hook up /proc queries for the root slice, tooLennart Poettering2018-05-30
| | | | | Do what we already prepped in cgtop for the root slice in PID 1 too: consult /proc for the data we need.
* cgroup-util: rework cg_get_keyed_attribute() a bitLennart Poettering2018-05-30
| | | | | | | | | | | | | Let's make sure we don't clobber the return parameter on failure, to follow our coding style. Also, break the loop early if we have all attributes we need. This also changes the keys parameter to a simple char**, so that we can use STRV_MAKE() for passing the list of attributes to read. This also makes it possible to distuingish the case when the whole attribute file doesn't exist from one key in it missing. In the former case we return -ENOENT, in the latter we now return -ENXIO.
* procfs-util: add APIs to get consumed CPU time and used memory from /procLennart Poettering2018-05-30
| | | | | | This is preparation for emulating the "usage_usec" keyed attribute of the "cpu.stat" property of the root cgroup from data in /proc. Similar, for emulating the "memory.current" attribute.
* core: don't process dbus unit and job queue when there are already too many ↵Lennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | messages pending We maintain a queue of units and jobs that we are supposed to generate change/new notifications for because they were either just created or some of their property has changed. Let's throttle processing of this queue a bit: as soon as > 1K of bus messages are queued for writing let's skip processing the queue, and then recheck on the next iteration again. Moreover, never process more than 100 units in one go, return to the event loop after that. Both limits together should put effective limits on both space and time usage of the function, delaying further operations until a later moment, when the queue is empty or the the event loop is sufficiently idle again. This should keep the number of generated messages much lower than before on busy systems or where some client is hanging. Note that this also means a bad client can slow down message dispatching substantially for up to 90s if it likes to, for all clients. But that should be acceptable as we only allow trusted bus clients, anyway. Fixes: #8166
* sd-bus: add APIs to query the current read and write queue sizeLennart Poettering2018-05-30
|
* process-util: don't install atfork() handler more than onceLennart Poettering2018-05-30
|
* util: add new safe_close_above_stdio() wrapperLennart Poettering2018-05-30
| | | | | | At various places we only want to close fds if they are not stdin/stdout/stderr, i.e. fds 0, 1, 2. Let's add a unified helper call for that, and port everything over.
* doc: add a new doc/ directory, and move two markdown docs into themLennart Poettering2018-05-30
| | | | | | | | | I figure sooneror later we'll have more of these docs, hence let's give them a clean place to be. This leaves NEWS and README/README.md as well as the LICENSE texts in the root directory of the project since that appears to be customary for Free Software projects.
* rules: add a missing comma in 70-uaccess.rules since it improves readabilityFranck Bui2018-05-30
| | | | | | | | | | | rule-syntax-check.py failed with the following error: $ ./test/rule-syntax-check.py ./src/login/70-uaccess.rules Invalid line ./src/login/70-uaccess.rules:31: SUBSYSTEM=="sound", TAG+="uaccess" OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq" clause: TAG+="uaccess" OPTIONS+="static_node=snd/timer" The comma is actually optional but the script makes it mandatory which seems a good thing since it improves readability.
* missing_syscall: add pkey_mprotect for ppc (#8292)Zbigniew Jędrzejewski-Szmek2018-05-30
| | | | Accurate for both ppc and ppc64 according to https://fedora.juszkiewicz.com.pl/syscalls.html.