1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

58053 Commits

Author SHA1 Message Date
Frantisek Sumsal
a0aca8821c coccinelle: don't try to use IN_SET() in assert_cc()
Since assert_cc() requires an integral constant expression.
2022-05-30 18:17:11 +02:00
Frantisek Sumsal
81aa8d4130 journal: return & log in one statement 2022-05-30 18:12:58 +02:00
Frantisek Sumsal
4c7f7f4b22 analyze: use IN_SET() in one more place 2022-05-30 18:12:55 +02:00
Zbigniew Jędrzejewski-Szmek
02ece2fcb1
Merge pull request #23529 from nabijaczleweli/dollar-asterisk
Don't linebreak after each initrd in kernel-install verbose mode
2022-05-30 10:27:14 +02:00
Jan Janssen
5476cb988c meson: Build header tests with -pedantic
By using __extension__, we can silence pedantic errors we cannot or
do not want to fix.

This in particular silences:
 - enum values being outside of int range
 - variadic macros
 - long long being C99
 - type of bit-field ‘type’ is a GCC extension
 - use of C99 bool in public header functions
2022-05-30 05:06:36 +09:00
Yu Watanabe
ba780ccd5f
Merge pull request #23542 from medhefgo/attributes
meson: Document why -Wimplicit-fallthrough is not used with clang
2022-05-30 04:07:41 +09:00
Evgeny Vereshchagin
f232c83c72 tests: link tests using fabs against libm explicitly
Some compiler wrappers like honggfuzz pass -fno-builtin explicitly
and because of that the tests where fabs is used fail to compile
with something like
```
FAILED: test-bus-marshal
...
/usr/bin/ld: test-bus-marshal.p/src_libsystemd_sd-bus_test-bus-marshal.c.o: undefined reference to symbol 'fabs@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

Fun fact: it took honggfuzz less than a minute to discover
https://github.com/advisories/GHSA-gmc7-pqv9-966m used by
systemd to compress/descompress some stuff.
2022-05-29 19:05:58 +00:00
Jan Janssen
2581dbcb0f clang-format: Adjust style of pointers
We gernerally have our pointers aligned to the right. SpaceAroundPointerQualifiers
makes sure "const char * const" is formatted nicely.
2022-05-30 04:00:54 +09:00
Frantisek Sumsal
0fde92d3e4
Merge pull request #23550 from evverx/fuzz-i386
oss-fuzz: support i386
2022-05-29 18:35:03 +00:00
Zbigniew Jędrzejewski-Szmek
67f8ba714a
Merge pull request #23548 from tpgxyz/lua2
rpm: adjust lua trigger for udevadm
2022-05-29 20:08:05 +02:00
Evgeny Vereshchagin
b22f5ed5fb oss-fuzz: support i386
Closes https://github.com/systemd/systemd/issues/23532
2022-05-29 09:32:00 +00:00
Evgeny Vereshchagin
61ad4f25ed docs: mention how to build 32 bit fuzz targets 2022-05-29 09:12:38 +00:00
Evgeny Vereshchagin
8739f309f3 meson: exclude pcre2 when dependencies are skipped 2022-05-29 06:44:45 +00:00
Tomasz Paweł Gajc
744984aa2d rpm: adjust lua trigger for udevadm 2022-05-28 21:38:33 +02:00
Tomasz Paweł Gajc
7bde8293a4 rpm: use rpm.execute() instead of fork() and execp() for trigger scriplets 2022-05-28 21:29:00 +02:00
Michael Biebl
003a676161 Move homectl and userdbctl to bindir
Those binaries aren't needed during early boot.
2022-05-28 18:47:53 +02:00
Jan Janssen
c0f5d58c9a meson: Document why -Wimplicit-fallthrough is not used with clang
This changes the macro to ensure proper fallthrough attributes are
used with clang in case this option is added in the future.
2022-05-28 12:44:08 +02:00
Javkhlanbayar Khongorzul
01ae74c8c7 man: Fix minor typo 2022-05-28 18:38:47 +09:00
Jan Janssen
b41ebe3d18 macro: Move attribute defintions to macro-fundamental
This also sorts them.
2022-05-28 11:34:16 +02:00
Yu Watanabe
89b6a3f13e sd-bus: fix buffer overflow
Fixes #23486.
2022-05-28 10:06:14 +02:00
Luca Boccassi
5ad69b04bf
Merge pull request #23518 from enr0n/sd-hwdb-from-path
Implement --root option for systemd-hwdb query
2022-05-27 22:51:36 +01:00
Zbigniew Jędrzejewski-Szmek
94b84a0703 Use descriptive name for nobody
This matches the changes pushed to Fedora [1,2].

[1] https://fedoraproject.org/wiki/Changes/RenameNobodyUser
[2] https://pagure.io/setup/c/f6fdb5ffc87fc8f1acc211867fef4e3f0856edfc
2022-05-27 22:09:24 +01:00
Nick Rosbrook
beff73f94e hwdb: implement --root option for systemd-hwdb query
Currently, the systemd-hwdb --root flag only has an effect for the
'update' verb. It would be useful to be able to use the --root option
for the 'query' verb too (e.g. for testing a hwdb.bin created with
systemd-hwdb update --root <path>).

Use sd_hwdb_new_from_path to initialize the hwdb if --root is passed to
systemd-hwdb query.

Note that this functionality was not added to 'udevadm hwdb' since that
command is deprecated.
2022-05-27 09:40:54 -04:00
Nick Rosbrook
60f0ba7556 sd-hwdb: add sd_hwdb_new_from_path
The existing sd_hwdb_new function always initializes the hwdb from the
first successful hwdb.bin it finds from hwdb_bin_paths. This means there
is currently no way to initialize a hwdb from an explicit path, which
would be useful for systemd-hwdb query.

Add sd_hwdb_new_from_path to allow a sd_hwdb to be initialized from a
custom path outside of hwdb_bin_paths.
2022-05-27 09:40:54 -04:00
Nick Rosbrook
9745b51c73 sd-hwdb: include sys/stat.h in hwdb-internal.h
Include this header to fix errors when including hwdb-internal.h:
  ../src/libsystemd/sd-hwdb/hwdb-internal.h:16:21: error: field ‘st’ has incomplete type
     16 |         struct stat st;
2022-05-27 09:40:54 -04:00
Luca Boccassi
e1a8917ae1
Merge pull request #23504 from keszybz/bls-reordering
Refactor the BLS and add a description of version sorts
2022-05-27 14:36:10 +01:00
Luca Boccassi
90abe62fd9
Merge pull request #23536 from mrc0mmand/TEST-69-tweaks
A couple of tweaks for TEST-69-SHUTDOWN
2022-05-27 14:34:52 +01:00
Luca Boccassi
df90d255fe
Merge pull request #23527 from keszybz/esp-detect-xbootldr
Fix xbootldr detection, fail early in kernel-install
2022-05-27 11:46:46 +01:00
Luca Boccassi
d20110b459
Merge pull request #23521 from keszybz/some-docs
Some docs
2022-05-27 11:42:01 +01:00
Pablo Ceballos
1a2134fb51 hwdb: Add Google Meet speakermic
It has the same issue as the Google Hangouts Meet speakermic but a
different VID/PID.
2022-05-27 11:38:13 +01:00
Frantisek Sumsal
47a00df1f0 test: fix a couple of pylint warnings 2022-05-27 11:54:47 +02:00
Frantisek Sumsal
3e624bb13b test: bump the post-reboot expect() timeout
as it may take a bit longer on slower machines:

```
[  OK  ] Reached target System Reboot.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Failed to open watchdog device /dev/watchdog0, ignoring: No such file or directory
binfmt_misc is not mounted, not detaching entries.
Sending SIGTERM to remaining processes...
ERROR:test-shutdown:Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f3d4bcd20b0>
command: /systemd-meson-build/systemd-nspawn
<...snip...>
buffer (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
before (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 572528
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile('H login: ')
INFO:test-shutdown:killing child pid 572528
E: nspawn failed with exit code 1
```
2022-05-27 11:41:55 +02:00
Yu Watanabe
6d3bb9e7d1
Merge pull request #23517 from mrc0mmand/cryptsetup-switchroot-transition
test: cover initrd->sysroot transition in TEST-24
2022-05-27 07:36:17 +09:00
Eduard Tolosa
815068d3a3 loader.conf: Clarify the default value of timeout. 2022-05-27 06:48:18 +09:00
наб
2f9f8b96d4
kernel-install: don't log each initrd on its own line in verbose mode 2022-05-26 23:18:34 +02:00
наб
c60ca42571
kernel-install: actually ignore the last two arguments 2022-05-26 23:16:13 +02:00
Zbigniew Jędrzejewski-Szmek
13d7c841a2 shared/find-esp: enhance logging
If something doesn't match, let's print the non-matching value.
If we can't query something, say what.
And make the messages in the udev and blkid paths different, so
we tell which approach failed from a log.
2022-05-26 21:50:18 +02:00
Zbigniew Jędrzejewski-Szmek
4e12442554 shared/find-esp: fix inverted check for XBOOTLDR type 2022-05-26 21:49:38 +02:00
Zbigniew Jędrzejewski-Szmek
5aa285b437 kernel-install: if a plugin fails, return error immediately
Since the first version in 81516adcb7,
kernel-install would "gather" a return value by summing the exit codes
of the plugins… This makes no sense, because those are not additive values.

Let's just break off immediately. We now implement cleanup via trap, so if we
break, we should leave no garbage behind.
2022-05-26 21:46:58 +02:00
Zbigniew Jędrzejewski-Szmek
53c26db4da docs/BLS: clear up the confusion about what $BOOT means
The text used was originally written for everything being on the ESP. It was
later generalized for support XBOOTLDR, and "$BOOT" was introduced to mean
something like "XBOOTLDR if present, the ESP otherwise", and most of the text
was changed to talk about $BOOT. Sadly, this doesn't work, because the two
partitions are not interchangeable. sd-boot loads entries from both partitions,
and its configuration, random-seed, etc. only from the ESP.

The terms are redefined: $BOOT now means either the ESP or the "boot partition"
playing the same role on MBR systems, and $XBOOTLDR is XBOOTLDR.

Like various previous commits, this makes the specification describe our
current implementation.

Also, the let's just accept the common practice of using /boot and /boot/efi.
Since both partitions need to be read to gather configuration, it isn't a
problem that one is mounted underneath the other one. I think having /boot and
/efi is OK, but not better in any measureable way, so let's stop trying to push
people towards this setup.

A note that XBOOTLDR must be on the same disk as ESP is added.
2022-05-26 20:21:09 +02:00
Zbigniew Jędrzejewski-Szmek
e5985a7d07
Merge pull request #23523 from evverx/oss-fuzz-links
docs: add a link to the OSS-Fuzz coverage report
2022-05-26 18:10:56 +02:00
Evgeny Vereshchagin
39e63b441b docs: be more specific about the OSS-Fuzz toolchain 2022-05-26 15:22:50 +00:00
Yu Watanabe
4fc69e8a09 core/device: do not downgrade device state if it is already enumerated
On switching root, a device may have a persistent databse. In that case,
Device.enumerated_found may have DEVICE_FOUND_UDEV flag, and it is not
necessary to downgrade the Device.deserialized_found and
Device.deserialized_state. Otherwise, the state of the device unit may
be changed plugged -> dead -> plugged, if the device has not been mounted.

Fixes #23429.

[mwilck: cherry-picked from #23437]
2022-05-26 17:07:59 +02:00
Evgeny Vereshchagin
7d7c92ef8c docs: update OSS-Fuzz links 2022-05-26 14:16:17 +00:00
Martin Wilck
cf1ac0cfe4 core/device: device_coldplug(): don't set DEVICE_DEAD
dm-crypt device units generated by systemd-cryptsetup-generator
habe BindsTo= dependencies on their backend devices. The dm-crypt
devices have the db_persist flag set, and thus survive the udev db
cleanup while switching root. But backend devices usually don't survive.
These devices are neither mounted nor used for swap, thus they will
seen as DEVICE_NOT_FOUND after switching root.

The BindsTo dependency will cause systemd to schedule a stop
job for the dm-crypt device, breaking boot:

[   68.929457] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Unit is stopped because bound to inactive unit dev-disk-by\x2duuid-3bf91f73\x2d1ee8\x2d4cfc\x2d9048\x2d93ba349b786d.device.
[   68.945660] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Trying to enqueue job systemd-cryptsetup@cr_root.service/stop/replace
[   69.473459] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Installed new job systemd-cryptsetup@cr_root.service/stop as 343

Avoid this by not setting the state of the backend devices to
DEVICE_DEAD.

Fixes the LUKS setup issue reported in #23429.
2022-05-26 15:06:41 +02:00
Frantisek Sumsal
6b70d3cf81 test: store the key on a separate device 2022-05-26 15:06:41 +02:00
Frantisek Sumsal
b22d90e594 test: generate a custom initrd for TEST-24 if $INITRD is unset
Co-Authored-By: Yu Watanabe <watanabe.yu+github@gmail.com>
2022-05-26 15:04:56 +02:00
Zbigniew Jędrzejewski-Szmek
b72308d344 man/homectl: adjust man page to match code
Fixes #22966. Since there are competing conventions, let's not
change our code, but make the docs match what is implemented.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
8f24777156 man/sd-bus: discuss negative-return values and add example
Fixes #22816.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
5ee38adea4 man/shutdown: explain -h more
Fixes #23401
2022-05-26 14:29:50 +02:00