Commit graph

59829 commits

Author SHA1 Message Date
Frantisek Sumsal 615fc2c3ce test: zone-set requires TTL for the first record in the rrset
I'm not sure why this worked previously.
2022-09-05 17:42:52 +02:00
Frantisek Sumsal e4050ff41e test: mark knot.conf tmpfiles config as optional
Since it got removed in the recent knot release.

See: a6971a4025
2022-09-05 17:27:48 +02:00
Lennart Poettering 6019fa1c87
Merge pull request #24404 from thatguystone/socket-jobs
job: Don't discard propagated restart jobs when unit is activating
2022-09-05 17:20:50 +02:00
Quentin Deslandes 1aa18710af nspawn: rename RemountIdmapFlags enum to RemountIdmapping
This enum should be used to define various idmapping modes for bind
mounts which might be incompatible. Changing its name and the values
name to reflect that.
2022-09-05 15:49:26 +01:00
Daan De Meyer 11749b6108 repart: Add support for setting a partition's UUID to zero
This is useful when we need to fill in the UUID later, such as when
using verity partitions.
2022-09-05 23:19:41 +09:00
Lennart Poettering d3d2dd5e4f units: prolong the stop timeout for homed
Let's give IO/resizing/… more time then usual.

Fixes: #22901
2022-09-05 15:22:53 +02:00
Lennart Poettering f8f621821a homed: don't wait indefinitely for workers on exit
Let's put some time-limit on it.

Fixes: #22901
2022-09-05 15:20:48 +02:00
Daan De Meyer b8c0f58c19
Merge pull request #24561 from yuwata/loop-util-follow-ups
loop-util: several follow ups for recent changes
2022-09-05 11:21:29 +02:00
Yu Watanabe e42270b6a6 loop-util: lock_fd must be closed before calling LOOP_CLR_FD
Follow-up for 7f52206a2b.

C.f. 87862cc2b4.
2022-09-05 04:31:47 +09:00
Yu Watanabe 9bf8600774 loop-util: drop unnecessary initializations 2022-09-05 04:31:29 +09:00
Yu Watanabe 1996ad2854 loop-util: use loop_device_open_full() when whole block device is passed to loop_device_make()
This also fixes a leak of lock_fd, which introduced by
7f52206a2b, when fd is for a block device,
and size or offset is non-zero.

Fixes another issue in #24147.
2022-09-05 03:50:05 +09:00
Yu Watanabe a8d8a61980 loop-util: introduce loop_device_open_full() 2022-09-05 03:29:06 +09:00
Yu Watanabe 9b5626d67a loop-util: fix LoopDevice.devno assigned by loop_device_open() 2022-09-05 03:29:06 +09:00
Yu Watanabe ffcb33241e loop-util: also set LoopDevice.diskseq when created with loop_device_open() 2022-09-05 03:29:06 +09:00
Yu Watanabe b6ca2b281e mount-util: fix error code
If multiple service is starting simultaneously with a shared image,
then one of the service may fail to create a mount node:

systemd[695]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[696]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[695]: Failed to mount /usr/lib/os-release (type n/a) on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC ""): No such file or directory
systemd[696]: Failed to mount /usr/lib/os-release (type n/a) on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC ""): No such file or directory
systemd[695]: Bind-mounting /usr/lib/os-release on /run/systemd/unit-root/run/host/os-release (MS_BIND|MS_REC "")...
systemd[696]: Failed to create destination mount point node '/run/systemd/unit-root/run/host/os-release': Operation not permitted
systemd[695]: Successfully mounted /usr/lib/os-release to /run/systemd/unit-root/run/host/os-release

The function apply_one_mount() in src/core/namespace.c gracefully
handles -EEXIST from make_mount_point_inode_from_path(), but it erroneously
returned -EPERM previously. This fixes the issue.

Fixes one of the issues in #24147, especially reported at
https://github.com/systemd/systemd/issues/24147#issuecomment-1236194671.
2022-09-05 03:28:47 +09:00
Jade Bilkey bc33789a06 man: fix static bridge example
A NetDev is needed to create the bridge in order to match the example's description "This creates a bridge..."
2022-09-04 11:19:14 +09:00
Frantisek Sumsal 0de5f18e2e test: actually set SYSTEMD_DISSECT_VERITY_TIMEOUT_SEC=30
Without the section header the assignments were effectively ignored.

Follow-up to 9fff8e1fdd.
2022-09-04 03:28:49 +09:00
Yu Watanabe 7903fcbb7c
Merge pull request #24550 from yuwata/bootspec
bootspec: do not build too many json object at once
2022-09-04 03:00:22 +09:00
Yu Watanabe b488c59c9f test: check returned values are always initialized on success 2022-09-04 00:02:38 +09:00
Yu Watanabe 28340719f2 bootspec: shorten code a bit 2022-09-04 00:01:09 +09:00
Yu Watanabe 69a34a4fd4 fuzz: add a test case for fuzz-bootspec
This adds a testcase for the issue oss-fuzz#50949
(https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50949).
2022-09-03 23:32:54 +09:00
Yu Watanabe 4d49d19e9d bootspec: do not build two many json object at once
This is a workaround for an issue in the memory sanitizer.
If a function is called with too many arguments, then the sanitizer
triggers the following false-positive warning:

==349==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f8b247134a7 in json_buildv /work/build/../../src/systemd/src/shared/json.c:3213:17
    #1 0x7f8b24714231 in json_build /work/build/../../src/systemd/src/shared/json.c:4117:13
    #2 0x7f8b24487fa5 in show_boot_entries /work/build/../../src/systemd/src/shared/bootspec.c:1424:29
    #3 0x4a6a1b in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-bootspec.c:119:16
    #4 0x4c6693 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #5 0x4c5e7a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #6 0x4c7ce4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7
    #7 0x4c7f19 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3
    #8 0x4b757f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #9 0x4e0bd2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #10 0x7f8b23ead082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #11 0x41f69d in _start (build-out/fuzz-bootspec+0x41f69d)

Follow-up for #24541.
Fixes #24551.
2022-09-03 23:32:50 +09:00
Yu Watanabe 41dceb91dd json: introduce json_append() 2022-09-03 23:13:47 +09:00
Yu Watanabe d12c0f4cfe loop-util: fix memleak when fd is for a block device with non-zero offset or size 2022-09-03 09:47:53 +09:00
Yu Watanabe 8ba24727c5 tmpfile-util: truncate original filename if the result filename is too long
This also verify that the extra string does not contain '/'.
2022-09-03 09:47:31 +09:00
Daniel Braunwarth d8d2039c0a test: extend ConditionFirmware tests 2022-09-03 00:18:06 +01:00
Luca Boccassi 2b970ccee6
Merge pull request #24538 from mrc0mmand/TEST-13-tweaks
test: forward nspawn logs to journal
2022-09-03 00:16:36 +01:00
Luca Boccassi 1e7fbbd4e1
Merge pull request #24546 from mrc0mmand/test-exec-deserialization-tweaks
A couple of tweaks for test-exec-deserialization
2022-09-03 00:15:45 +01:00
Frantisek Sumsal 729292d9dd test: suppress not-found errors for selinuxenabled
if the binary is not available.
2022-09-02 22:09:29 +02:00
Frantisek Sumsal d1f6c3857e test: forward nspawn logs to journal
Dumping everything to console slows the test quite considerably on
slower machines, so let's forward nspawn logs to the journal to still
have them available in case something goes south.

This should, hopefully, help with TEST-13 timeouts in Ubuntu CI and
maybe with CPU soft lockups in CentOS CI.
2022-09-02 22:09:29 +02:00
Yu Watanabe 1055172804 udev: cleanup stack directory /run/udev/links when all workers exited
By the previous commit, the stack directories are not removed even if
it is empty. To reduce the inode usage of /run, let's cleanup the
directories.
2022-09-03 05:01:52 +09:00
Yu Watanabe 57a272902a udev: use flock() when updating device node symlinks
By locking the stack directory, we can safely determine the device node
with the highest priority for a symlink. So, the multiple try-and-wait
loops can be dropped, and the code becomes quite simple.
2022-09-03 05:01:52 +09:00
Yu Watanabe 541a463fd5 udev: make node_symlink() accept NULL devname 2022-09-03 05:01:52 +09:00
Yu Watanabe d6595c5ced udev: use path_make_relative_parent() 2022-09-03 05:01:52 +09:00
Yu Watanabe 6b01e2905c udev: rename link_find_prioritized() and variables
Also shorten code a bit.

Just for consistency with other part and readability of the code.
2022-09-03 05:01:52 +09:00
Yu Watanabe faadf97500 udev: use readlinkat_malloc()
And try to read it only when the file is symlink.
2022-09-03 05:01:52 +09:00
Yu Watanabe d4f60bdc11 path-util: introduce path_make_relative_parent() 2022-09-03 05:01:51 +09:00
Yu Watanabe a28d67a903 udev: do not remove stack directory even if it is empty
Then, we can always assume the directory exists, and the code become
slightly simpler.

Note, unused directories are removed by the main udevd process in a
later commit.
2022-09-03 05:01:51 +09:00
Yu Watanabe 7e7c36fbbb udev: split link_update() and introduce stack_directory_get_name()
No functionality is changed.
2022-09-03 05:01:51 +09:00
Yu Watanabe b9168275c3 udev: move udev_node_escape_path()
No functionality is changed.
2022-09-03 05:01:51 +09:00
Lennart Poettering d96c7550a0
Merge pull request #24541 from poettering/bootspec-tweaks
bootspec: slightly stricter validation + process tries-left/tries-done counters in filenames
2022-09-02 21:29:31 +02:00
Luca Boccassi 31ed4b9147 mkosi: update to latest commit
Required to fix Debian testing/unstable builds, as resolved is
now in its own package
2022-09-02 19:46:54 +01:00
Frantisek Sumsal fda00958bb test: make pylint happy 2022-09-02 20:19:38 +02:00
Lennart Poettering f1ee066840 log: don't attempt to duplicate closed fd
if the console fd is not open we shouldn#t try to move it out of the 0…2
range.

Fixes: #24535
Alternative-for: #24537
2022-09-03 03:06:18 +09:00
Frantisek Sumsal 4aa84ef9a3 test: check for the output file in a loop
This should make the test faster on fast machines and more reliable on
slower/under-load machines, where the 4 sec sleep wasn't sometimes enough.

Spotted on C8S machines under load:

```
test_added_after (__main__.ExecutionResumeTest) ... FAIL
test_added_before (__main__.ExecutionResumeTest) ... ok
test_interleaved (__main__.ExecutionResumeTest) ... ok
test_issue_6533 (__main__.ExecutionResumeTest) ... ok
test_no_change (__main__.ExecutionResumeTest) ... ok
test_removal (__main__.ExecutionResumeTest) ... ok
test_swapped (__main__.ExecutionResumeTest) ... ok

======================================================================
FAIL: test_added_after (__main__.ExecutionResumeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./test/test-exec-deserialization.py", line 101, in check_output
    with open(self.output_file, 'r') as log:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpjnec1dj4'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./test/test-exec-deserialization.py", line 150, in test_added_after
    self.check_output(expected_output)
  File "./test/test-exec-deserialization.py", line 104, in check_output
    self.fail()
AssertionError: None

----------------------------------------------------------------------
Ran 7 tests in 44.270s
```
2022-09-02 20:06:12 +02:00
Yu Watanabe 9fe6ce0a13
Merge pull request #24536 from yuwata/dissect-take-loop-device
dissect-image: introduce dissect_loop_device() which takes LoopDevice object
2022-09-03 03:05:57 +09:00
Yu Watanabe 51f42f34e6 udevadm-wait: move comments and condition outside of setup_periodic_timer() 2022-09-03 01:46:25 +09:00
Yu Watanabe bad31660ed dissect-image: introduce dissect_loop_device() which takes LoopDevice object 2022-09-03 01:32:01 +09:00
Lennart Poettering 93b233e72a find-esp: call the right function
We want the parent dir here, let's fix that.
2022-09-02 18:12:25 +02:00
Lennart Poettering 95150f3f56 update TODO 2022-09-02 18:09:57 +02:00