summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* pam: do not attempt to close sd-bus after fork in pam_end()Luca Boccassi2023-04-251-0/+11
| | | | | | | When pam_end() is called after a fork, and it cleans up caches, it sets PAM_DATA_SILENT in error_status. FDs will be shared with the parent, so we do not want to attempt to close them from a child process, or we'll hit assertions. Complain loudly and skip.
* man: /usr/lib/systemd/random-seed -> /usr/lib/systemd/systemd-random-seedVitaly Kuznetsov2023-04-251-1/+1
| | | | | | /usr/lib/systemd/random-seed is not a thing. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
* logind: always use 64bit session IDsLennart Poettering2023-04-252-4/+4
| | | | | | | | | | it's a bit confusing that on 32bit systems we'd risk session IDs overruns like this. Let's expose the same behaviour everywhere and stick to 64bit ids. Since we format the ids as strings anyway this doesn't really change anything performance-wise, it just pushes out collisions by overrun to basically never happen.
* docs: fix LoadCredentialEncrypted example (#27387)Lawrence Thorpe2023-04-251-1/+1
| | | | Embedded credential name 'ciphertext.cred' does not match filename 'foobar', refusing.
* sd-login: add SetTTY session object #26611Thorsten Kukuk2023-04-256-0/+106
|
* doc: say in CODING_STYLE that AT_EMPTY_PATH should be implied on openat() ↵Lennart Poettering2023-04-251-0/+9
| | | | | | | | style APIs (and NULL path is OK) As discussed here: https://github.com/systemd/systemd/pull/27397#issuecomment-1521630044
* user-record-nss: make return values optionalLennart Poettering2023-04-251-14/+12
| | | | | If we only want to know if some user ID/user name is already allocated, we don't care for the returned data.
* mountpoint-util: make path_get_mnt_id_at() work with a NULL pathLennart Poettering2023-04-252-3/+49
|
* Merge pull request #27261 from keszybz/test-cleanupFrantisek Sumsal2023-04-2530-291/+260
|\ | | | | Cleanup syntax and use idiomatic bash in test scripts
| * test: use idiomatic bash loop iterationZbigniew Jędrzejewski-Szmek2023-04-2411-35/+33
| | | | | | | | | | In a few cases, also avoid a sleep in the last (failed) iteration of the loop. It doesn't matter too much, but it's still ugly.
| * testsuite-54: drop unnecessary pipeZbigniew Jędrzejewski-Szmek2023-04-241-1/+1
| |
| * testsuite-70: drop unnecessary envZbigniew Jędrzejewski-Szmek2023-04-241-9/+8
| |
| * test: drop uses of "&& { echo 'unexpected success'; exit 1; }"Zbigniew Jędrzejewski-Szmek2023-04-2421-243/+219
| | | | | | | | Brief is sweet.
| * testsuite-04: remove unnecessary conditionalZbigniew Jędrzejewski-Szmek2023-04-241-5/+1
| |
| * testsuite-04: remove redirection, drop whitespace after redirection opZbigniew Jędrzejewski-Szmek2023-04-241-2/+2
| |
* | fs-util: make sure open_mkdir_at() does something roughly sensible when ↵Lennart Poettering2023-04-252-13/+24
| | | | | | | | invoked with '/'
* | Merge pull request #27380 from poettering/bpf-meson-tweaksYu Watanabe2023-04-253-122/+118
|\ \ | | | | | | two bpf build system changes
| * | pid1: simplify bpf meson importLennart Poettering2023-04-241-7/+6
| | |
| * | meson: move bpf hookup into main meson build fileLennart Poettering2023-04-243-115/+112
| | | | | | | | | | | | This way we can use it in systemd-userdbd later on, too.
* | | mkosi: Update fedora to release 38Daan De Meyer2023-04-251-1/+1
| | |
* | | Merge pull request #27388 from poettering/assert-fdLennart Poettering2023-04-252-20/+17
|\ \ \ | | | | | | | | add ASSERT_FD() similar to ASSERT_PTR(), but for fds
| * | | loop-util: port some code over to ASSERT_FD()Lennart Poettering2023-04-241-20/+9
| | | |
| * | | fd-util: add ASSERT_FD() that is similar to ASSERT_PTR() but for fdsLennart Poettering2023-04-241-0/+8
| | | |
* | | | Drop log level of header limits log messageDaan De Meyer2023-04-251-4/+3
| | | | | | | | | | | | | | | | | | | | Especially when using in-memory logging, these are too noisy so let's drop them back to debug level.
* | | | Merge pull request #27386 from dtardon/test-cleanupLuca Boccassi2023-04-2511-155/+65
|\ \ \ \ | | | | | | | | | | More automatic cleanup in tests
| * | | | test-hashmap-plain: use _cleanup_David Tardon2023-04-241-57/+22
| | | | |
| * | | | test-set: use _cleanup_David Tardon2023-04-241-4/+2
| | | | |
| * | | | test-calendarspec: use _cleanup_David Tardon2023-04-241-11/+5
| | | | |
| * | | | test: use _cleanup_ for temp. filesDavid Tardon2023-04-217-72/+31
| | | | |
| * | | | test-fdset: use _cleanup_David Tardon2023-04-211-5/+2
| | | | |
| * | | | test: shorten a bitDavid Tardon2023-04-211-6/+3
| | | | |
* | | | | cryptsetup-fido2: Depend on libcryptsetupWolfgang Müller2023-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crypsetup-fido2 always depended on both libfido2 and libcryptsetup, but 0a8e026e825dda142a8f1552a4b45815cbfd0b48 forgot to make the then implicit dependency on libcryptsetup explicit when moving it from cryptsetup/ to shared/. This breaks builds when libfido2 is autodetected but the system is missing libcryptsetup. Introduce an explicit check for HAVE_LIBCRYPTSETUP such that cryptsetup-fido2 is only built when both libraries are available. Fixes #27374.
* | | | | homed: rename make_userns() to avoid name conflict with mount-util.[ch]Lennart Poettering2023-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't really matter too much as both are static functions. But it's confusing as hell both when debugging and reading code, given that homed actually uses mount-util.c Hence, let's just rename one of the two, to minimize confusion. No actual change in behaviour. (and sooner or later we might want to export mount-util.c's version of the function, since it's generically useful)
* | | | | Merge pull request #27113 from keszybz/variable-expansion-reworkZbigniew Jędrzejewski-Szmek2023-04-2412-315/+635
|\ \ \ \ \ | | | | | | | | | | | | Rework serialization of command lines in pid1 and make run not expand variables
| * | | | | run: expand variables also with --scopeZbigniew Jędrzejewski-Szmek2023-04-242-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes syntax be the same for commands which are started by the manager and those which are spawned directly (when --scope is used). Before: $ systemd-run -q -t echo '$TERM' xterm-256color $ systemd-run -q --scope echo '$TERM' $TERM Now: $ systemd-run -q --scope echo '$TERM' xterm-256color Previous behaviour can be restored via --expand-environment=no: $ systemd-run -q --scope --expand-environment=no echo '$TERM' $TERM Fixes #22948. At some level, this is a compat break. Fortunately --scope is not very widely used, so I think we can get away with this. Having different syntax depending on whether --scope was used or not was bad UX. A NEWS entry will be required.
| * | | | | man/systemd-run: add examples explaining how variable expansion is performedZbigniew Jędrzejewski-Szmek2023-04-241-0/+36
| | | | | |
| * | | | | run: add --expand-environment=no to disable server-side envvar expansionZbigniew Jędrzejewski-Szmek2023-04-242-52/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses StartExecEx to get the equivalent of ExecStart=:. StartExecEx was added in b3d593673c5b8b0b7d781fd26ab2062ca6e7dbdb, so this will not work with older systemds. A hint is emitted if we get an error indicating lack of support. PID1 returns SD_BUS_ERROR_PROPERTY_READ_ONLY, but I'm checking for SD_BUS_ERROR_UNKNOWN_PROPERTY too for safety.
| * | | | | run: split out creation of unit creation messagesZbigniew Jędrzejewski-Szmek2023-04-241-86/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just refactoring, in preparation for future changes. (Though I think it'd be reasonable to do anyway, those functions were awfully long.) 'git diff' displays this badly. The middle part of start_transient_service() is moved to make_transient_service_unit(), and the middle part of start_transient_trigger() is moved to make_transient_trigger_unit().
| * | | | | run: simplify returning of statusZbigniew Jędrzejewski-Szmek2023-04-241-32/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | start_transient_service() would return two ints: one normally and one via *retval. We can just return one int and propagate it directly, because we use DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE().
| * | | | | core: fix writing of ExecStartEx and friendsZbigniew Jędrzejewski-Szmek2023-04-242-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The property name is called ExecStartEx, but we have to write it as ExecStart= in the unit file. :( Bug introduced in b3d593673c5b8b0b7d781fd26ab2062ca6e7dbdb when ex-properties were initially added. In addition, we cannot escape $ as $$, because when ":" is used, we wouldn't unescape $$ back to $.
| * | | | | core/unit: add UNIT_ESCAPE_EXEC_SYNTAXZbigniew Jędrzejewski-Szmek2023-04-243-26/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately we can't escape $ when ':' is used to prohibit variable expansion: ExecStart=:echo $$ is not the same as ExecStart=:echo $ This just adds the functionality and the unittests, without using it anywhere for real yet.
| * | | | | core/unit: rename UNIT_ESCAPE_EXEC_SYNTAX → *_ENVZbigniew Jędrzejewski-Szmek2023-04-244-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | In preparation for future changes.
| * | | | | core/unit: fix shell-escaping of stringsZbigniew Jędrzejewski-Szmek2023-04-242-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our escaping of '$' is '$$', not '\$'. We would write unit files that were not valid: $ systemd-run --user bash -c 'echo $$; sleep 1000' Running as unit: run-r1c7c45b5b69f487c86ae205e12100808.service $ systemctl cat --user run-r1c7c45b5b69f487c86ae205e12100808 # /run/user/1000/systemd/transient/run-r1c7c45b5b69f487c86ae205e12100808.service ... ExecStart="/usr/bin/bash" "-c" "echo \$\$\; sleep 1000" $ systemd-analyze verify /run/user/1000/systemd/transient/run-r1c7c45b5b69f487c86ae205e12100808.service /run/user/1000/systemd/transient/run-r1c7c45b5b69f487c86ae205e12100808.service:7: Ignoring unknown escape sequences: "echo \$\$\; sleep 1000" Similarly, ';' cannot be escaped as '\;'. Only a handful of characters listed in "Supported escapes" is allowed. Escaping of "'" can be done, but it's not useful because we use double quotes around the string anyway whenever we do escaping. unit_write_setting() is called all over the place. In a great majority of places we write either fixed strings or something that we generate ourselves, so no escaping or quoting is needed. (And it's not allowed, e.g. 'Type="oneshot"' would not work.) But if we forgot to add escaping or quoting for a free-style string, it would probably allow writing a unit file that would be read completely wrong. I looked over various places where unit_write_setting() is called, and I couldn't find any place where quoting/escaping was forgotten. But trying to figure out the full ramifications of this change is not easy.
| * | | | | basic/logarithm: add popcount() wrapperZbigniew Jędrzejewski-Szmek2023-04-244-7/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __builtin_popcount() is a bit of a mouthful, so let's provide a helper. Using _Generic has the advantage that if a type other then the ones on the list is given, compilation will fail. This is nice, because if by any change we pass a wider type, it is rejected immediately instead of being truncated. log.h is also needed. It is included transitively, but let's include it directly. macro.h is *not* needed.
| * | | | | test-core-unit: add new test file for unit_escape_setting() and friendsZbigniew Jędrzejewski-Szmek2023-04-042-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of the existing test files fit very well. test-unit-serialize is pretty close, but it does special cgroup setup, which we don't need in this case. I hope we can add more tests in the future for this basic functionality, so I'm adding a brand new file names after the source file it's testing.
| * | | | | meson: redo grouping of tests under src/test/Zbigniew Jędrzejewski-Szmek2023-04-041-122/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the tests that link to libcore into a separate subgroup. They are special and it makes sense to keep them together. While at it, make the list alphabetical. Also, merge the list additions into one. No idea why it was like that.
* | | | | | parse-util: allow parse_pid() to work with NULL return parameterLennart Poettering2023-04-241-2/+2
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | That way the function becomes useful for validating pids formatted as strings.
* | | | | mkosi: Update to latestDaan De Meyer2023-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This pulls in a fix for Debian rpmdb locations, which results in a substantial speedup for centos/fedora builds.
* | | | | nspawn: Don't follow /etc/resolv.conf symlinksDaan De Meyer2023-04-241-1/+1
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | When we're checking if /etc/resolv.conf exists so we can bind mount on top of it, we care about whether the symlink itself exists if /etc/resolv.conf exists and not the file it points to, so add CHASE_NOFOLLOW to make sure we check existence of the symlink and not the file it points to.
* | | | man: fix LogControl1 manpage exampleLuca Boccassi2023-04-241-8/+8
| | | | | | | | | | | | | | | | Follow-up for c6b8fffdfaf1f7c9a1dac73e1e54993a06c766c0