summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* busctl: Fix warning about invaild introspection dataSebastian Scheibner2022-09-061-8/+12
| | | | | The set_put function returns 0 if the element is already in the set and not EEXIST, like e.g. hashmap does.
* man: fix static bridge exampleJade Bilkey2022-09-041-0/+5
| | | A NetDev is needed to create the bridge in order to match the example's description "This creates a bridge..."
* test: actually set SYSTEMD_DISSECT_VERITY_TIMEOUT_SEC=30Frantisek Sumsal2022-09-031-0/+1
| | | | | | Without the section header the assignments were effectively ignored. Follow-up to 9fff8e1fdd222f8f05b9ecf170814a9059acfc78.
* Merge pull request #24550 from yuwata/bootspecYu Watanabe2022-09-036-5/+57
|\ | | | | bootspec: do not build too many json object at once
| * test: check returned values are always initialized on successYu Watanabe2022-09-031-1/+4
| |
| * bootspec: shorten code a bitYu Watanabe2022-09-031-2/+1
| |
| * fuzz: add a test case for fuzz-bootspecYu Watanabe2022-09-031-0/+1
| | | | | | | | | | This adds a testcase for the issue oss-fuzz#50949 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50949).
| * bootspec: do not build two many json object at onceYu Watanabe2022-09-031-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * json: introduce json_append()Yu Watanabe2022-09-033-0/+42
|/
* loop-util: fix memleak when fd is for a block device with non-zero offset or ↵Yu Watanabe2022-09-031-1/+1
| | | | size
* tmpfile-util: truncate original filename if the result filename is too longYu Watanabe2022-09-032-64/+204
| | | | This also verify that the extra string does not contain '/'.
* test: extend ConditionFirmware testsDaniel Braunwarth2022-09-031-2/+69
|
* Merge pull request #24538 from mrc0mmand/TEST-13-tweaksLuca Boccassi2022-09-032-2/+3
|\ | | | | test: forward nspawn logs to journal
| * test: suppress not-found errors for `selinuxenabled`Frantisek Sumsal2022-09-022-2/+2
| | | | | | | | if the binary is not available.
| * test: forward nspawn logs to journalFrantisek Sumsal2022-09-021-0/+1
| | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #24546 from mrc0mmand/test-exec-deserialization-tweaksLuca Boccassi2022-09-031-46/+46
|\ \ | |/ |/| A couple of tweaks for test-exec-deserialization
| * test: make pylint happyFrantisek Sumsal2022-09-021-35/+36
| |
| * test: check for the output file in a loopFrantisek Sumsal2022-09-021-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | Merge pull request #24541 from poettering/bootspec-tweaksLennart Poettering2022-09-024-70/+352
|\ \ | | | | | | bootspec: slightly stricter validation + process tries-left/tries-done counters in filenames
| * | update TODOLennart Poettering2022-09-021-12/+2
| | |
| * | bootspec: clarify we knowingly ignore all errors but ENOMEMLennart Poettering2022-09-021-1/+1
| | |
| * | bootspec: properly parse tries done/tries left from bootspec file namesLennart Poettering2022-09-023-17/+194
| | | | | | | | | | | | | | | | | | | | | This has been a long-time omission in the userspace parser of bootspec files. Correct that. Fixes: #16457
| * | bootspec: rename "id" function parameters to "fname"Lennart Poettering2022-09-021-12/+12
| | | | | | | | | | | | | | | | | | | | | It's really the file name, so name it like that. Just some renaming. (This is preparation for later work, to extract tries-done/tries-left info from filenames)
| * | bootspec: complain about loader.conf lines without parameterLennart Poettering2022-09-021-0/+4
| | |
| * | bootspec: port type1 parser to log_syntax()Lennart Poettering2022-09-021-27/+52
| | |
| * | bootspec: let's actually use the result of strstrip() for further parsingLennart Poettering2022-09-021-6/+6
| | | | | | | | | | | | | | | Also, given we are looking for whitespace as separators, just pass NULL as separators, extract_first_word() defaults to whitespace after all.
| * | bootspec: simplify paths + insist they are normalizedLennart Poettering2022-09-021-13/+99
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Inspired by #23913, let's complain if people use paths with ".." in Type #1 bootspec entries. Let's prefix all paths with "/" if it is missing. Let's simplify all paths. let's refuse paths/warn with "..". Fixes: #23913
* | mkosi: update to latest commitLuca Boccassi2022-09-021-1/+1
| | | | | | | | | | Required to fix Debian testing/unstable builds, as resolved is now in its own package
* | log: don't attempt to duplicate closed fdLennart Poettering2022-09-021-1/+1
| | | | | | | | | | | | | | | | 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
* | Merge pull request #24536 from yuwata/dissect-take-loop-deviceYu Watanabe2022-09-0221-89/+76
|\ \ | | | | | | dissect-image: introduce dissect_loop_device() which takes LoopDevice object
| * | dissect-image: introduce dissect_loop_device() which takes LoopDevice objectYu Watanabe2022-09-029-58/+32
| | |
| * | loop-util: always set LoopDevice.nodeYu Watanabe2022-09-021-0/+5
| | |
| * | loop-util: rename loopdev -> nodeYu Watanabe2022-09-021-7/+7
| | | | | | | | | | | | Preparation for the next commit. No functional change.
| * | core/swap: use devname_from_stat_rdev()Yu Watanabe2022-09-021-1/+1
| | |
| * | sd-device: introduce devname_from_stat_rdev()Yu Watanabe2022-09-022-0/+8
| | |
| * | sd-device: rename devpath_from_devnum() -> devname_from_devnum()Yu Watanabe2022-09-0212-24/+24
| |/ | | | | | | | | | | | | | | In sd-device, `devpath` is a kind of syspath without '/sys' prefix, e.g. /devices/pci0000:00/0000:00:1c.4/0000:3c:00.0/nvme/nvme0/nvme0n1, and `devname` is a path to the device node, e.g. /dev/nvme0n1. Let's use the consistent name for the helper function.
* / find-esp: call the right functionLennart Poettering2022-09-021-1/+1
|/ | | | We want the parent dir here, let's fix that.
* Merge pull request #24491 from poettering/compare-orderLennart Poettering2022-09-028-182/+299
|\ | | | | condition: unify operator parsing handling
| * mention ConditionKernelVersion= compat break in NEWSLennart Poettering2022-09-011-2/+15
| |
| * condition: change operator logic to use $= instead of =$ for glob comparisonsLennart Poettering2022-09-013-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So this is a bit of a bikeshedding thing. But I think we should do this nonetheless, before this is released. Playing around with the glob matches I realized that "=$" is really hard to grep for, since in shell code it's an often seen construct. Also, when reading code I often found myself thinking first that the "$" belongs to the rvalue instead of the operator, in a variable expansion scheme. If we move the $ character to the left hand, I think we are on the safer side, since usually lvalues are much more restricted in character sets than rvalues (at least most programming languages do enforce limits on the character set for identifiers). It makes it much easier to grep for the new operator, and easier to read too. Example: before: ConditionOSRelease=ID=$fedora-* after: ConditionOSRelease=ID$=fedora-*
| * condition: change ConditionKernelVersion= so that =/!= mean literal string ↵Lennart Poettering2022-09-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | comparison, and ==/<> version comparison The only reason to do this is to ensure uniformity with the other options, that work like this, i.e. ConditionOSRelease= or ConditionSecurity=. This is a compatibility break, but a minor one, given that string comparison and version comparison is mostly the same for equality and inequality.
| * condition: allow literal string compares in SMBIOS conditionLennart Poettering2022-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This ensures that "=" and "!=" are now interpreted as literal string compares, and "==" and "<>" are for version compares. This is not a compat break, since the SMBIOS stuff has not been included in any release yet. Main reason to do this, is to be systematic with the other conditions that check for text stuff.
| * condition: allow fnmatch() matches in ConditionKernelVersion=Lennart Poettering2022-09-012-27/+27
| | | | | | | | | | | | This is mostly to make things systematic, and brings no new functionality, as not specifying any operator is identical to prefixing with =$ anyway.
| * compare: add macro for operator charsetLennart Poettering2022-09-012-2/+5
| |
| * compare: propagate errors of fnmatch() as errorsLennart Poettering2022-09-011-2/+7
| |
| * compare: support textual operators, and port analyze over to itLennart Poettering2022-09-013-16/+19
| |
| * compare: add two new operators "==" and "<>"Lennart Poettering2022-09-012-29/+35
| | | | | | | | | | | | | | | | These two operators always indicate ordering comparisons, as opposed to "=" and "!=" which depending on context mean literal string compares. This is useful for ConditionOSRelease= for example, as this means there's now always a way to do version compares.
| * compare: rework table in parse_compare_operator() to be array of structsLennart Poettering2022-09-011-23/+22
| | | | | | | | | | | | | | | | Let's change the lookup table to contain pairs of operator/strings, instead of being indexed by operator. The table isn't dense anymore, and this allows us to add alias strings sooner or later.
| * condition: allow fnmatch compares for ConditionOSRelease=Lennart Poettering2022-09-013-8/+11
| | | | | | | | | | We support this for smbios matches, hence do so for /etc/os-release matches too.
| * compare: add flag for parse_compare_operator() to do equality/inequality ↵Lennart Poettering2022-09-013-11/+33
| | | | | | | | | | | | | | comparison via simple string compares This allows us to switch condition_test_osrelease() to use generic version_or_fnmatch_compare() for executing the comparison.