Commit graph

52327 commits

Author SHA1 Message Date
Christoph Anton Mitterer a2142fa60d meson: minor cleanup
The file itself is already only included when HAVE_MICROHTTPD is set.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2021-07-11 18:00:28 +02:00
Christoph Anton Mitterer 564761fcae sysusers: split up systemd.conf
This makes it easier have the respective users/groups only created when their
respective packages are installed.

Fixes #20044.
2021-07-11 18:00:25 +02:00
James Hilliard d6d1fd995f Disable non-explicit sbatvars autodetection for cross builds.
Since autodetection is unlikely to work reliably for cross builds
disable it unless explicitly enabled.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-07-10 23:46:26 +01:00
Ben Stockett 4226dfafba Updated manpage for sd_bus_set_property
Updated manpage for sd_bus_set_property and sd_bus_set_propertyv. In the old manpage, these functions included the parameter sd_bus_message **reply when the actual function had no such argument.
2021-07-10 13:19:50 +01:00
nassir90 a814eae728
Fixed typo (#20187)
* Fixed typo

Before, the file claimed that some systemd units are created "from other
configuration". It should have read "from other configuration files".

Co-authored-by: Nozz <nozolo90@gmail.com>
2021-07-09 21:16:02 +01:00
Luca Boccassi af55491028
Merge pull request #20186 from keszybz/coverity-fixes
Coverity fixes
2021-07-09 21:15:08 +01:00
Frantisek Sumsal 2f0927626a tree-wide: coccinelle fixes
Yet another batch of Coccinelle fixes.
2021-07-09 20:54:22 +01:00
Frantisek Sumsal 0de0ba573b
Merge pull request #20185 from mrc0mmand/ci-tweaks
test: assorted test tweaks to address flakiness
2021-07-09 20:21:59 +02:00
Luca Boccassi 5c8cf104e7
Merge pull request #20157 from keszybz/numerical-uids-in--M
Allow numerical UIDs in systemctl -M uid@ and similar
2021-07-09 16:58:45 +01:00
Zbigniew Jędrzejewski-Szmek d1829af943 creds: fix leak of arg_tpm2_device
IIUC, "auto" is the same as NULL. There is no need to strdup() anything.

Coverity CID#1458113.
2021-07-09 15:29:47 +02:00
Frantisek Sumsal 7e8cfa4bb6 test: make the strace check a bit more clever
We still sometimes try to grep an empty strace log because strace is not
yet properly initialized. Let's make the check a bit clever and wait
until strace is attached to PID 1 by checking the `TracerPid` field in
`/proc/1/status`.
2021-07-09 15:26:07 +02:00
Zbigniew Jędrzejewski-Szmek 89fa9a6b7b networkd: add shared parser for mud urls
The same buggy code was triplicated…
2021-07-09 15:13:12 +02:00
Zbigniew Jędrzejewski-Szmek bc1f27ff55 creds: drop unnecessary initialization
Coverity also thinks a leak happens here, CID #1458112.
This seems wrong, but let's add an assert, maybe that'll help.
2021-07-09 15:13:12 +02:00
Zbigniew Jędrzejewski-Szmek 1421705d9a core: drop unnecessary initialization
cunescape() sets output on success, so initialization is not necessary. There
was no comment, but I think they may have been added because the compiler
wasn't convinced that the return value is non-negative on success. It could
have been confused by the int return type on escape*(), which was changed by
the one of preceeding commits to ssize_t, or by the length calculation, so add
an assert to help the compiler.

For some reason coverity thinks the output can be leaked here (CID #1458111).
I don't see how.
2021-07-09 15:12:18 +02:00
Zbigniew Jędrzejewski-Szmek 2744c7bb01 xdg-autostart: minor refactoring
We can't say free_and_replace(exec_split[n++], quoted), because the the
argument is evaluated multiple times. But I think that this form is
still easier to read.
2021-07-09 15:07:40 +02:00
Zbigniew Jędrzejewski-Szmek 12d729b2ec nspawn: inline one iterator variable declaration 2021-07-09 15:07:40 +02:00
Zbigniew Jędrzejewski-Szmek e437538f35 tree-wide: make cunescape*() functions return ssize_t
Strictly speaking, we are returning the size of a memory chunk of
arbitrary size, so ssize_t is more appropriate than int.
2021-07-09 15:07:40 +02:00
Zbigniew Jędrzejewski-Szmek ddedf7ca69 basic/escape: use _cleanup_ in one more place
Also, let's not use 'r' for a char*.
2021-07-09 15:07:13 +02:00
Frantisek Sumsal e68e473ba2 test: strip binaries by default
Since 23f8e01 we always kept binaries unstripped, since $STRIP_BINARIES
is unset by default.
2021-07-09 14:59:11 +02:00
Frantisek Sumsal 7fb4ee7aa5 test: bump the test timeout to give ldconfig.service enough time to finish
Sometimes the ldconfig.service might take a bit longer to finish,
causing spurious test timeouts:

```
[ 1025.858923] systemd[24]: ldconfig.service: Executing: /sbin/ldconfig -X
...
[ 1043.883620] systemd[1]: ldconfig.service: Main process exited, code=exited, status=0/SUCCESS (success)
...
Trying to halt container. Send SIGTERM again to trigger immediate
termination.
Container TEST-52-HONORFIRSTSHUTDOWN terminated by signal KILL.
E: Test timed out after 20s
```
2021-07-09 14:47:29 +02:00
nl6720 250db1bf02 docs: improve wording when mentioning the acronym "ESP"
"ESP" is "EFI system partition", so "ESP partition" is redundant.
2021-07-09 13:41:00 +02:00
Zbigniew Jędrzejewski-Szmek fe819f569a shared/format-table: fix invalid free
Coverity CID#1458108.
2021-07-09 13:17:16 +02:00
Zbigniew Jędrzejewski-Szmek 2da7d0bc92 sd-bus: allow numerical uids in -M user@.host
UIDs don't work well over ssh, but locally or with containers they are OK.
In particular, user@.service uses UIDs as identifiers, and it's nice to be
able to copy&paste that UID for interaction with the user's managers.
2021-07-09 11:18:21 +02:00
Zbigniew Jędrzejewski-Szmek 0c201ca945 sd-bus: print debugging information if bus_container_connect_socket() fails
We would return the errno, but there are many steps, and without some
debugging info it's hard to figure out what exactly failed.
2021-07-09 11:18:21 +02:00
Zbigniew Jędrzejewski-Szmek 87fa2e21dd sd-bus: print quoted commandline when in bus_socket_exec()
The arguments are where the interesting part is:
src/libsystemd/sd-bus/bus-socket.c:965: sd-bus: starting bus with systemd-run...
↓
src/libsystemd/sd-bus/bus-socket.c:972: sd-bus: starting bus with systemd-run -M.host -PGq --wait -pUser=1000 -pPAMName=login systemd-stdio-bridge "-punix:path=\${XDG_RUNTIME_DIR}/bus"
2021-07-09 11:18:21 +02:00
Zbigniew Jędrzejewski-Szmek 8a62620ebe core: use the new quoting helper 2021-07-09 11:18:21 +02:00
Zbigniew Jędrzejewski-Szmek eeb91d29b0 basic/escape: add helper for quoting command lines 2021-07-09 11:18:21 +02:00
Yu Watanabe d0e18bb4b0
Merge pull request #20166 from poettering/fsync-more
various tweaks to existing fsync() helpers, and some new apis
2021-07-09 07:32:01 +09:00
Yu Watanabe 452a07cfd6
Merge pull request #20168 from poettering/signal-util-tweak
generalize SIGINT handling in copy.c
2021-07-09 07:24:43 +09:00
Yu Watanabe f1ee01e342
Merge pull request #20167 from poettering/format-table-tweaks
format-table: three new features
2021-07-09 07:20:49 +09:00
Lennart Poettering 6a24c995f0 dirent-util: no need to bother with fstatat() for "." and ".." to figure out if these are dirs 2021-07-09 04:18:09 +09:00
Lennart Poettering bcf8fc267f blockdev-util: add fd-based APIs for getting backing block device for file 2021-07-08 14:49:02 +02:00
Lennart Poettering 1053967781 path-util: make path_compare() accept NULL 2021-07-08 13:56:06 +02:00
Yegor Alexeyev a520bb6654 logind: allow binding different operation to reboot key long presses 2021-07-08 13:08:20 +02:00
Lennart Poettering 949162552d conf-files: rename return parameters ret_xyz 2021-07-08 13:06:58 +02:00
Lennart Poettering c860665ef3
Merge pull request #20163 from poettering/repart-root-fix
repart: drop duplicate handling of /sysroot/ prefix
2021-07-08 13:06:41 +02:00
Lennart Poettering 19755bca19
Merge pull request #19995 from poettering/cred-tool
Add support for encrypted credentials
2021-07-08 12:59:59 +02:00
Lennart Poettering 14a4c4edc7 repart: when we can't fit the partitions in, report needed disk size current disk size
This improves error output in repart if we can't fit the defined
partitions into the disk image. With this change we'll now show not only
the disk size we need (as before), but also the current one, as well as
the largest free area on disk.

This should make it a bit easier to debug disk space issues that repart
runs into.
2021-07-08 11:46:35 +02:00
Hugo Osvaldo Barrera 8859b8f77a Mount encrypted swap partitions via gpt-auto
If the auto-discovered swap partition is LUKS encrypted, decrypt it
automatically.

This aligns with the Discoverable Partitions Specification, though I've
also updated it to explicitly mention that LUKS is now supported here.

Since systemd retries any key already in the kernel keyring, if the swap
partition has the same passphrase as the root partition, the user won't
be prompted a second time for a second passphrase.

See https://github.com/systemd/systemd/issues/20019
2021-07-08 11:46:20 +02:00
Lennart Poettering 215b64b2ad copy: port over to pop_pending_signal() 2021-07-08 10:38:09 +02:00
Lennart Poettering 0178ff292b signal-util: add helper pop_pending_signal() 2021-07-08 10:33:38 +02:00
Lennart Poettering 2c177b30e3 format-table: teach table_hide_column_from_display() to accept multiple arguments
In case we want to hide multiple columns in one go, make that easy.
2021-07-08 10:29:43 +02:00
Lennart Poettering 21fbf095b8 format-table: add cell type for outputting 64bit values in hex 2021-07-08 10:29:43 +02:00
Lennart Poettering bc773fcb35 format-table: add cell type for "mode_t" values 2021-07-08 10:29:43 +02:00
Lennart Poettering 4050625e5b fs-util: teach syncfs_path() handle with empty path argument 2021-07-08 10:22:34 +02:00
Lennart Poettering 32a3041656 fs-util: add fsync_path_and_parent_at() 2021-07-08 10:22:34 +02:00
Lennart Poettering 814a7e0345 fs-util: add API for fsync()ing parent dir of path 2021-07-08 10:22:34 +02:00
Lennart Poettering 427c934fdb fs-util: make sure fsync_directory_of_file() does something useful on O_PATH fds
When handling O_PATH fds it's safe to use the parent of
/proc/self/fd/<fd> for any kind of inode. Hence do so.
2021-07-08 10:22:34 +02:00
Lennart Poettering e2e13bddcf repart: drop spurious whitespace 2021-07-08 10:10:39 +02:00
Lennart Poettering 6bbae9f8b3 repart: don't prefix /sysroot/ twice
For some reason I first commited
a73b2ad041 and then
8f47e32a3e. But the latter makes the
former obsolete and causes us to suffix paths twice.

Let's hence revert a73b2ad041 and stick to
8f47e32a3e as the latter is the ore
generic solution of the two.
2021-07-08 10:10:39 +02:00