summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | tests: add a helper that dumps /run/utmp in detailZbigniew Jędrzejewski-Szmek2022-05-312-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | utmpdump doesn't print all the details. Looking at the list if useful when trying to tweak the wall filtering logic. This doesn't do much, but at least it serves as a smoke test for the cleanup functions.
| * | | | shared/utmp-wtmp: pass information if entry is local to filter functionZbigniew Jędrzejewski-Szmek2022-05-315-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This just adds an unused parameter for future use. No change in behaviour.
| * | | | tty-ask-password-agent: drop unnecessary code for non-absolute pathsZbigniew Jędrzejewski-Szmek2022-05-311-2/+1
| |/ / / | | | | | | | | | | | | | | | | utmp_wall() always prepends /dev/, so we don't need to do this a second time here.
* | | | src: The return value of server_vacuum () is not used and could be modified ↵Li kunyu2022-06-012-4/+2
| | | | | | | | | | | | | | | | to void type
* | | | Merge pull request #23531 from yuwata/sd-bus-drop-version-2Yu Watanabe2022-06-0118-2355/+422
|\ \ \ \ | | | | | | | | | | sd-bus: drop version 2 format support
| * | | | sd-bus: drop constant argument for message_extend_fields()Yu Watanabe2022-05-311-5/+5
| | | | |
| * | | | sd-bus: drop D-Bus version 2 format supportYu Watanabe2022-05-318-2263/+367
| | | | | | | | | | | | | | | | | | | | It seems the format is used only by kdbus.
| * | | | sd-bus: merge message_peek_fields() and buffer_peek()Yu Watanabe2022-05-311-32/+25
| | | | |
| * | | | sd-bus: make several functions staticYu Watanabe2022-05-312-24/+6
| | | | | | | | | | | | | | | | | | | | And drop 'bus_' prefix from them.
| * | | | sd-bus: use UINT32_MAXYu Watanabe2022-05-313-4/+4
| | | | |
| * | | | sd-bus: drop unnecessary castYu Watanabe2022-05-311-1/+1
| | | | |
| * | | | sd-bus: drop redundant conditionYu Watanabe2022-05-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | By the previous commit, ALIGN8() is always equal to or greater than the argument.
| * | | | sd-bus: use ALIGN8()Yu Watanabe2022-05-311-1/+1
| | | | |
| * | | | boot: use ALIGN4()Yu Watanabe2022-05-312-5/+5
| | | | |
| * | | | macro: make ALIGN4() and ALIGN8() also return SIZE_MAX on overflowYu Watanabe2022-05-312-19/+8
| | | | | | | | | | | | | | | | | | | | This also drops unused ALIGN4_PTR(), ALIGN8_PTR(), and ALIGN_TO_PTR().
| * | | | tree-wide: use ALIGN_PTR()Yu Watanabe2022-05-314-8/+8
| | |/ / | |/| |
* | | | Merge pull request #23512 from medhefgo/efi-clangYu Watanabe2022-05-3122-261/+885
|\ \ \ \ | |/ / / |/| | | boot: Add string functions
| * | | boot: Use xstrdup8/16Jan Janssen2022-05-313-23/+22
| | | | | | | | | | | | | | | | | | | | Note that xstrdup is now safe to call with a NULL pointer and will just return NULL in that case.
| * | | boot: Add xstrdup8/16Jan Janssen2022-05-316-23/+124
| | | |
| * | | boot: Use memcmp/memcpy/memsetJan Janssen2022-05-3115-42/+42
| | | |
| * | | boot: Add memcmp/memcpy/memsetJan Janssen2022-05-313-1/+127
| | | |
| * | | boot: Use strsize8/16Jan Janssen2022-05-314-8/+8
| | | |
| * | | boot: Add strsize8/16Jan Janssen2022-05-312-0/+26
| | | |
| * | | boot: Use strchr8/16Jan Janssen2022-05-314-19/+6
| | | |
| * | | boot: Add strchr8/16Jan Janssen2022-05-313-0/+42
| | | |
| * | | boot: Use strcpy8/16Jan Janssen2022-05-311-2/+2
| | | |
| * | | boot: Add strcpy8/16Jan Janssen2022-05-313-0/+52
| | | |
| * | | boot: Use strtolower8/16Jan Janssen2022-05-311-2/+2
| | | |
| * | | boot: Add strtolower8/16Jan Janssen2022-05-313-0/+40
| | | |
| * | | boot: Use strcmp16 for cpio sortingJan Janssen2022-05-313-4/+4
| | | |
| * | | boot: Use strcmp8/16Jan Janssen2022-05-316-98/+63
| | | | | | | | | | | | | | | | | | | | | | | | This also replaces streq and similar functions for consistency. Note that streq16 is null pointer safe, so streq_ptr can be safely replaced too.
| * | | boot: Add strcmp8/16Jan Janssen2022-05-313-0/+204
| | | |
| * | | boot: Use strlen8/16Jan Janssen2022-05-319-48/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The casts in this and the next few commits are curently necessary because CHAR8 is defined as uint8_t in gnu-efi, while char is signed. Once we switch from gnu-efi typedefs to stdint types, the casts will be dropped.
| * | | boot: Add strlen8/16Jan Janssen2022-05-314-0/+98
| | | |
| * | | boot: Use stddef.h offsetofJan Janssen2022-05-311-2/+1
| | | |
* | | | portable: fix command option in commentYu Watanabe2022-05-311-4/+4
|/ / / | | | | | | | | | Follow-up for edea370222eec3d185dd84a7d9e942ec5933af63.
* | | seccomp: fix a typo in error messageFrantisek Sumsal2022-05-311-1/+1
| | |
* | | Merge pull request #23558 from msekletar/issue-20329-followupYu Watanabe2022-05-312-3/+4
|\ \ \ | | | | | | | | Actually delay running of mount start jobs when /p/s/mountinfo is rate limited
| * | | unit: check for mount rate limiting before checking active stateMichal Sekletar2022-05-302-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having this check as part of mount_can_start() is too late because UNIT(u)->can_start() virtual method is called after checking the active state of unit in unit_start(). We need to hold off running mount start jobs when /p/s/mountinfo monitor is rate limited even when given mount unit is already active. Fixes #20329
* | | | Simplify random number selectionJason A. Donenfeld2022-05-3120-203/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have a convoluted and complex selection of which random numbers to use. We can simplify this down to two functions that cover all of our use cases: 1) Randomness for crypto: this one needs to wait until the RNG is initialized. So it uses getrandom(0). If that's not available, it polls on /dev/random, and then reads from /dev/urandom. This function returns whether or not it was successful, as before. 2) Randomness for other things: this one uses getrandom(GRND_INSECURE). If it's not available it uses getrandom(GRND_NONBLOCK). And if that would block, then it falls back to /dev/urandom. And if /dev/urandom isn't available, it uses the fallback code. It never fails and doesn't return a value. These two cases match all the uses of randomness inside of systemd. I would prefer to make both of these return void, and get rid of the fallback code, and simply assert in the incredibly unlikely case that /dev/urandom doesn't exist. But Luca disagrees, so this commit attempts to instead keep case (1) returning a return value, which all the callers already check, and fix the fallback code in (2) to be less bad than before. For the less bad fallback code for (2), we now use auxval and some timestamps, together with various counters representing the invocation, hash it all together and provide the output. Provided that AT_RANDOM is secure, this construction is probably okay too, though notably it doesn't have any forward secrecy. Fortunately, it's only used by random_bytes() and not by crypto_random_bytes().
* | | | Merge pull request #23533 from yuwata/portable-remove-drop-in-configsZbigniew Jędrzejewski-Szmek2022-05-312-18/+23
|\ \ \ \ | | | | | | | | | | portable: remove drop-in configs
| * | | | portable: remove drop-in configs even if the main unit file does not existYu Watanabe2022-05-301-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we run `portablectl detach --enable --runtime`, then it triggers `DisableUnitFilesWithFlags` DBus method and the main unit file is removed, but its drop-ins are not. Hence, portable_detach() failed to list existing portable units. This makes the loop for listing portable units also accept drop-in directories. So, all remaining drop-in directories are correctly removed. Before: ``` testsuite-29.sh[600]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0 portablectl[1391]: (Matching unit files with prefixes 'minimal-app0'.) portablectl[1391]: Queued /org/freedesktop/systemd1/job/1812 to call StopUnit on portable service minimal-app0-foo.service. portablectl[1391]: Removed "/run/systemd/system.attached/minimal-app0-foo.service". portablectl[1391]: Queued /org/freedesktop/systemd1/job/1813 to call StopUnit on portable service minimal-app0.service. portablectl[1391]: Removed "/run/systemd/system.attached/minimal-app0.service". portablectl[1391]: Got result done/Success for job minimal-app0-foo.service portablectl[1391]: Got result done/Success for job minimal-app0.service portablectl[1391]: DetachImage failed: No unit files associated with '/tmp/rootdir' found attached to the system. Image not attached? ``` After: ``` testsuite-29.sh[508]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0 portablectl[1076]: (Matching unit files with prefixes 'minimal-app0'.) portablectl[1076]: Queued /org/freedesktop/systemd1/job/1946 to call StopUnit on portable service minimal-app0-foo.service. portablectl[1076]: Removed "/run/systemd/system.attached/minimal-app0-foo.service". portablectl[1076]: Queued /org/freedesktop/systemd1/job/1947 to call StopUnit on portable service minimal-app0.service. portablectl[1076]: Removed "/run/systemd/system.attached/minimal-app0.service". portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d/10-profile.conf. portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d/20-portable.conf. portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d. portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d/10-profile.conf. portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d/20-portable.conf. portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d. portablectl[1076]: Removed /run/portables/rootdir. portablectl[1076]: Removed /run/systemd/system.attached. ```
| * | | | portable: try to remove unit files even in a spurious stateYu Watanabe2022-05-291-7/+0
| | | | |
| * | | | test: drop redundant log messageYu Watanabe2022-05-291-2/+0
| | | | |
* | | | | Merge pull request #23564 from yuwata/core-unit-add-depYu Watanabe2022-05-311-19/+22
|\ \ \ \ \ | | | | | | | | | | | | core: fix notification about unit dependency change
| * | | | | core: make unit_add_two_dependencies() or friends return 1 on changedYu Watanabe2022-05-301-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | Follow-up for f971def3c23d780aab99d988bd71b94931d74be6.
| * | | | | core/unit: fix notification about unit dependency changeYu Watanabe2022-05-301-10/+9
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | This also makes unit_add_dependency() return 1 only when a dependency is added.
* | | | | cgroup-util: Properly handle conditions where cgroup.threads is empty after ↵msizanoen12022-05-301-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SIGKILL but processes still remain After sending a SIGKILL to a process, the process might disappear from `cgroup.threads` but still show up in `cgroup.procs` and still remains in the cgroup and cause migrating new processes to `Delegate=yes` cgroups to fail with `-EBUSY`. This is especially likely for heavyweight processes that consume more kernel CPU time to clean up. Fix this by only returning 0 when both `cgroup.threads` and `cgroup.procs` are empty.
* | | | | Merge pull request #23560 from mrc0mmand/coccinelleYu Watanabe2022-05-302-5/+4
|\ \ \ \ \ | |/ / / / |/| | | | A couple of tweaks suggested by Coccinelle
| * | | | journal: return & log in one statementFrantisek Sumsal2022-05-301-4/+3
| | | | |