Commit graph

39021 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek cf2edf1d5c sd-bus: export sd_bus_message_read_strv_extend()
The same story as before: it's a useful helper, other uses of the library
are likely to find it useful.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek e16144844b sd-id128: rename and export sd_id128_string_equal()
We find this function useful in our code, so no reason not to export it.
I changed the order of last two words in the name to match the arguments.
(With "equal_string" I expected sd_id128_t first, string second, but in
actual use, the second argument is usually a long constant so it's nice
to keep this order of arguments.)
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek fc69fab5ec sd-bus: export sd_bus_error_setfv()
The usual: if we find that function useful, other users of the library
will too. In particular, the v-variants are necessary to build pass-thru
wrappers.
2022-06-30 10:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 7a1f261da3 sd-bus: drop unused prototype
Function was exported in 07a0d22f9e,
but apparently we forgot to remove the old declaration.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 2dbf1c0f15 libsystemd: drop unexported sd-utf8
It had two symbols which were not actually exported because they were not
listed in libsystemd.sym. They were also entirely unused in our codebase.
I don't think it makes much sense to export just those two functions, and
it doesn't make to build a string processing library in systemd either.

History of the file shows that it was created in
faaa5728d9 'utf8: export utf8 validation functions as part of sd-bus'
and hasn't gone even one non-trivial change since then ;)
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 84e1001541 libsystemd: export sd-netlink
It was added originally in 65f568bbeb. The API is
has stabilized pretty much, and generally follows the usual style for
libsystemd.  We've held it as a public-but-private library for almost 10 years,
let's export it.

sd_netlink_sendv() and sd_nfnl_nft_*() are excluded.

libsystemd.so seems to grow by 12k.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 42d824dee3 test-lib*-sym: print symbols names in addition to addresses
This makes it easier to see what the test is doing.

I converted the code to use f-strings. They are already used in other scripts
necessary for build, so IIUC this is OK.
2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek 3e4f1dc9d9 sd-daemon: remove sd_ prefix from static function 2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek f2ef78d208 sd-netlink: remove sd_ prefix from static function 2022-06-30 10:35:26 +02:00
Zbigniew Jędrzejewski-Szmek b01f31954f Turn mempool_enabled() into a weak symbol
Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.

In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.

test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
2022-06-29 16:51:52 +02:00
Zbigniew Jędrzejewski-Szmek d0aec7d4da sd-id128: avoid an unnecessary function call in inline helper
When optimizing, the compiler will most likely replace the call to memcmp(),
but at -O0, the code that is emitted builds the call preamble and does the
call. Let's use the same pattern as with sd_id128_is_null() and
sd_id128_is_allf() and avoid the call.
2022-06-29 15:41:51 +02:00
Daan De Meyer f63d1b0efa journal: Fix missing parenthesis 2022-06-29 14:05:23 +02:00
Yu Watanabe 840a49f3dc virt: fix detection of Parallels virtualization
If Parallels virtualization is detected from DMI, then trust that over CPUID.

Fixes issue caused by 28b1a3eac2.

Fixes #23856.
2022-06-29 14:03:54 +02:00
Yu Watanabe b8478c14c7 sd-journal: data object may be invalid after data_object_in_hash_table()
Fixes a bug introduced by 578cd1855b.

The function `data_object_in_hash_table()` calls
`journal_file_move_to_object()` with `OBJECT_DATA`. Hence,
previously obtained pointer to a data object may be now invalid.

Fixes #23794.
2022-06-29 04:54:05 +09:00
Yu Watanabe a30630f5dc sd-journal: also check object header before verifying object data
Otherwise, the check by journal_file_check_object() may be meaning less
when the header is broken.
2022-06-29 03:42:37 +09:00
Yu Watanabe 31fdd89fc6 sd-journal: drop unused argument from journal_file_check_object()
And rename the function.
2022-06-29 03:42:37 +09:00
Yu Watanabe 586fb79e27 sd-journal: shorten code a bit 2022-06-29 03:42:37 +09:00
Yu Watanabe 909a6b87b0 sd-journal: align table 2022-06-29 03:42:37 +09:00
Yu Watanabe d5548eb618
Merge pull request #23821 from dtardon/ascii-logging
Allow ASCII fallback for Unicode characters in logs
2022-06-29 03:36:35 +09:00
Yu Watanabe 94f881fd8e
Merge pull request #23849 from mbiebl/more-https
Use https for freedesktop.org
2022-06-29 03:22:51 +09:00
Zbigniew Jędrzejewski-Szmek a4d60b3e1c
Merge pull request #23827 from yuwata/sd-event-process-buffered-inotify-data
sd-event: process buffered inotify data
2022-06-28 18:25:14 +02:00
Michael Biebl 85fce6f42c Use https for gnu.org 2022-06-28 16:07:35 +02:00
Michael Biebl 41d6f3bf4d Use https for freedesktop.org
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
2022-06-28 13:10:05 +02:00
David Tardon 28e5e1e97f tree-wide: allow ASCII fallback for … in logs 2022-06-28 12:50:44 +02:00
David Tardon e2341b6bc3 tree-wide: allow ASCII fallback for → in logs 2022-06-28 12:50:43 +02:00
Sam James 5a9276f659 gpt: add PARISC UUIDs
Not doing PARISC64 for now as no userland exists for it yet.
2022-06-28 04:52:42 +01:00
Sam James 344e6b62fc seccomp: add PARISC (HPPA support)
We have to skip the W^X protections as we need executable
memory on PARISC for now. Kernel work is in progress (started
w/ 5.18).

Closes: https://github.com/systemd/systemd/issues/23180
2022-06-28 04:39:29 +01:00
Sam James d40de37edd basic/missing-syscalls: add PARISC (HPPA support)
Bug: https://github.com/systemd/systemd/issues/23180
2022-06-28 04:28:57 +01:00
Yu Watanabe c7b5a5a736 test: add another test for inotify event source
The test case is for issue #23826.
2022-06-28 00:05:14 +09:00
Yu Watanabe 067fc91702 sd-event: make sd_event_prepare() return positive when buffered inotify data exists
Previously, even if there is buffered inotify data, sd_event_prepare()
did not process the data when there is no pending event source.

Fixes #23826.
2022-06-28 00:05:14 +09:00
Yu Watanabe 32861b4c76 sd-event: use LIST_IS_EMPTY() 2022-06-28 00:05:14 +09:00
Yu Watanabe 54e0cfc44e network: grouping elements in network_free() 2022-06-27 15:52:31 +02:00
Yu Watanabe b09a5659e2
Merge pull request #23842 from medhefgo/boot-std
boot: Use standard types
2022-06-27 22:32:31 +09:00
Zbigniew Jędrzejewski-Szmek 6b0485c29a test-sd-hwdb: adjust the test to actually do anything
Without the terminating colon we wouldn't match anything, so the loop over
properties was skipped.
2022-06-27 22:31:24 +09:00
Jan Janssen e5a1b8f9a3 boot: Use stdbool
The way the UEFI spec defines BOOLEAN is fully compatible to stdbool, so
it is perfectly safe to switch to it. Although any other values than 0/1
are undefined by the spec, we could theoretically have cases where a
sloppy firmware hands us a bad BOOLEAN (since gnu-efi/edk2 declare it
as uint8_t). So any uses where we pass a pointer to BOOLEAN are left
untouched.
2022-06-27 12:27:23 +02:00
Jan Janssen 07d0fde49e boot: Use char
This also switches to _cleanup_free_. Otherwise no code changes.
2022-06-27 12:26:57 +02:00
Jan Janssen 3639d1b021 boot: Use char16_t
This also switches to _cleanup_free_. Otherwise no code changes.
2022-06-27 12:26:21 +02:00
Jan Janssen db4122d130 boot: Use stdint types 2022-06-27 12:16:27 +02:00
Jan Janssen 2a5e4fe414 boot: Remove use of EFI_ERROR
The macro is ugly and annoying to use and provides no real benefit. The
only reason to use it would be to allow warnings to go through. But any
EFI APIs we call do not return warning status codes or we do not check
the return value anyway. The only other case would be BS->StartImage,
where we already treat anything other than EFI_SUCCESS as an error
anyway.

This also helps the compiler and code analyzers to better reason about
the code. In particular, this can help reduce use of uninitialized
variable warnings.
2022-06-27 12:16:27 +02:00
Jan Janssen 8599bdb67c boot: Rename remaining EFI_STATUS vars to err for consistency 2022-06-27 12:16:27 +02:00
Jan Janssen 6b852d22b6 fundamental: Remove types-fundamental.h
This removes the fundamental typedefs in favor of just using standard C
types. These are all used internally anyway and also do not do anything
special to warrant any redefinition to EFI types.

Even for BOOLEAN we can safely use stdbool. The defition from the EFI
specification is fully compatible, including making any other values
than 0/1 as undefined.

The exception is sd_char as those need to be char16_t. The typedef is
moved to string-util-fundamental.h instead.
2022-06-27 12:16:27 +02:00
Yu Watanabe 5ad08191d8 nspawn: support PrivateUsers=identity
Follow-up for 33eac552ab.

Fixes #23825.
2022-06-27 10:33:10 +09:00
Yu Watanabe b917743d50 nspawn: update help message for user namespacing
Follow-up for 33eac552ab.
2022-06-27 10:31:41 +09:00
Jan Janssen 4e5c39597a sha256: Use stdbool and uintptr_t
This also syncs the copyright blurb with current glibc sources. The
written by line does not appear in upstream, so it should be okay to
remove.
2022-06-24 17:51:17 +01:00
Yu Watanabe c3613ee51e udev: allow to execute longer command line
Fixes #23607.
2022-06-24 20:09:24 +09:00
Jan Janssen c4ba5fef78 boot: Fix calls to ResetSystem
gnu-efi falsely declares a return type for ResetSystem when it should be
void. The spec also says that it never returns, so just assert.
2022-06-23 18:41:35 +02:00
Zbigniew Jędrzejewski-Szmek e5c09aad37 logind: simplify code
Follow-up for 4885d7490b.
2022-06-23 17:55:09 +02:00
Zbigniew Jędrzejewski-Szmek ef88c81bbe
Merge pull request #23802 from yuwata/core-watchdog-follow-ups
core: cleanups for watchdog
2022-06-23 09:59:24 +02:00
David Tardon 4885d7490b logind-session-dbus: allow to set display name via dbus
Currently, the only way to set display name of a graphical session is to
pass it to CreateSession(). But modern display managers like gdm start
the display server as part of the user session, which means that the
display name isn't known yet when the session is being created. Hence,
let's make it possible to set it later.
2022-06-22 22:34:29 +02:00
Jan Janssen 35148e8ff9 bootspec: Add PE file name to log messages
Fixes: #23783
2022-06-23 01:34:28 +09:00
Yu Watanabe 46355675f7
Merge pull request #23774 from yuwata/netlabel-nftset-follow-ups
network, core: revert NFTSet and NetLabel features
2022-06-23 01:33:19 +09:00
Zbigniew Jędrzejewski-Szmek a7b2aa658f
Merge pull request #23806 from keszybz/udevadm-info-pager
Pager for udevadm info
2022-06-22 16:50:53 +02:00
Yu Watanabe a32badc5a6 Revert "networkd: NetLabel integration"
This reverts PR #23269 and its follow-up commit. Especially,
2299b1cae3 (partially), and
3cf63830ac.

The PR was merged without final approval, and has several issues:
- The NetLabel for static addresses are not assigned, as labels are
  stored in the Address objects managed by Network, instead of Link.
- If NetLabel is specified for a static address, then the address
  section will be invalid and the address will not be configured,
- It should be implemented with Request object,
- There is no test about the feature.
2022-06-22 22:34:26 +09:00
Yu Watanabe b48ed70c79 Revert NFTSet feature
This reverts PR #22587 and its follow-up commit. More specifically,
2299b1cae3 (partially),
e176f85527,
ceb46a31a0, and
51bb9076ab.

The PR was merged without final approval, and has several issues:
- OSS fuzz reported issues in the conf parser,
- It calls synchrnous netlink call, it should not be especially in PID1,
- The importance of NFTSet for CGroup and DynamicUser may be
  questionable, at least, there was no justification PID1 should support
  it.
- For networkd, it should be implemented with Request object,
- There is no test for the feature.

Fixes #23711.
Fixes #23717.
Fixes #23719.
Fixes #23720.
Fixes #23721.
Fixes #23759.
2022-06-22 22:23:58 +09:00
Zbigniew Jędrzejewski-Szmek cbef829f80 udevadm info: use pager for all output types
Before we used the pager for --tree, but not e.g. for --export-db.
I don't see any particular reason to limit this.
2022-06-22 14:31:43 +02:00
Zbigniew Jędrzejewski-Szmek b6ec23a01a udevadm info: implement --no-pager 2022-06-22 14:31:42 +02:00
Yu Watanabe 82d7a151db core: close watchdog device if watchdog device is unspecified now
If a watchdog device was specified previously, and unspecified later and
PID1 is reloaded, then we need to close the device.
2022-06-22 16:23:36 +09:00
Yu Watanabe e83c4d178b core: drop unnecessary free
As reset_arguments() frees the string.

Follow-up for 919ea64f69.
2022-06-22 16:21:06 +09:00
Vishal Chillara Srinivas 127b26f3d8 resolve: mDNS transaction max attempts fix
Maximum attempts to send mDNS requests is one except for probe requests, which should be attempted thrice.
Implemented fix to account for the difference between regular queries and probe requests, and prevent
even regular queries from being attempted thrice.
See RFC 6762 Section 8.1
2022-06-22 16:04:55 +09:00
Łukasz Stelmach 919ea64f69 core: Fix memory leaks
arg_early_core_pattern and arg_watchdog_device hold pointers to memory
allocated with strdup() (inside path_make_absolute_cwd). The memory needs
to be freed in reset_arguments() during reload rather than forgotten.
2022-06-22 01:31:17 +01:00
Pavel Zhukov 19df770fe1 Add sys/file.h for LOCK_
Fixes build with musl:
| ../git/src/shared/dissect-image.c: In function 'mount_image_privately_interactively':
| ../git/src/shared/dissect-image.c:2986:34: error: 'LOCK_SH' undeclared (first use in this function)
|  2986 |         r = loop_device_flock(d, LOCK_SH);
|       |                                  ^~~~~~~
2022-06-21 16:07:58 +01:00
Zbigniew Jędrzejewski-Szmek 107795a759 pkgconfig,rpm: expose vars for user-tmpfiles.d location
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2098553.
2022-06-21 15:49:41 +09:00
Yu Watanabe e83cfbf972 locale: drop unnecessary allocation
Fixes a bug introduced by 3d36b5d7e7.

Fixes #23777.
2022-06-18 14:46:45 +01:00
Marc Kleine-Budde 25ed7633b1 networkctl: fix output of "status": replace "Queue Length" by "Number of Queues"
Commit 0307afc681 ("networkctl: add support to display Transmit/Recieve queue
length (#12633)") added the display of the number of RX and TX Queues to the
output of `networkctl status $DEV`. However the row description says "Queue
Length".

This patch fixes the output by replacing "Queue Length" by "Number of Queues".

Fixes: 0307afc681 ("networkctl: add support to display Transmit/Recieve queue length (#12633)")
2022-06-18 10:44:42 +09:00
Philipp Gortan 2751ad9c3f add program name to log line 2022-06-18 10:43:03 +09:00
Luca Boccassi 9dd98db27d
Merge pull request #23756 from yuwata/analyze-seccomp-filter
analyze: fix seccomp filter handling in security command
2022-06-17 09:58:14 +01:00
Jan Janssen 01d81c126b meson: Reorder cflags for sd-boot
Currently, -Wall and -Wextra override previously passed flags like
-Wno-unused-parameter. This reorders them to be passed before any
optional flags. -Wsign-compare is part of -Wextra and therefore dropped.
-nostdlib is a link-stage flag and dropped as it is already part of
efi_ldflags.
2022-06-17 12:57:41 +09:00
Yu Watanabe 6d6a08547c seccomp-util: make @known include @obsolete
@known is generated from syscall-list.txt, which generated from kernel
headers. So, some syscalls in @obsolete may not be listed in
syscall-list.txt.
2022-06-17 12:40:43 +09:00
Yu Watanabe 5862e5561c analyze-security: always save syscall name
This reverts dd51e725df and fixes bugs
introduced by 1624114d74.

Previously,
- On online scan, the syscall filter was a string Hashmap, but it
  might contain syscall name with errno or error action. Hence, we need
  to drop the errno or error action in the string.
- On offline scan, the syscall filter was a Hashmap of syscall ID, so
  hashmap_contains() with syscall name did not work. We need to convert
  syscall IDs to syscall names.
- If hashmap_contains() in syscall_names_in_filter() is true, then
  the syscall is allowed when the list is an allow-list, and vice versa.
  Hence, the condition in syscall_names_in_filter() was errnously
  inverted by dd51e725df.

This makes syscalls are always stored with its name, instead of ID,
and also correct the condition.

Fixes #23663.
2022-06-17 12:37:56 +09:00
Yu Watanabe cb649d12bf set: introduce set_put_strndup()
Note, if `n != SIZE_MAX`, we cannot check the existence of the specified
string in the set without duplicating the string. And, set_consume() also
checks the existence of the string. Hence, it is not necessary to call
set_contains() if `n != SIZE_MAX`.
2022-06-17 12:28:36 +09:00
Yu Watanabe 1008d415e7 core/dbus-execute: drop unnecessary flag
The code block is called only when the list was empty, and the newly
requested list is allow-list. Hence, invert_flag is always zero here.
2022-06-17 12:26:50 +09:00
Yu Watanabe 8c93ebbdf0 core/dbus-execute: do not append denied syscalls in allow-list
Follow-up for 68acc1afbe.

Before the commit, SystemCallFilter bus property provides only allowed
syscalls if ExecContext.syscall_filter is an allow-list, and vice versa.

After the commit, if the list is allow-list, it contains allowed
syscalls with value `-1`, and denied syscalls with non-negative values.

To keep the backward compatibility, denied syscalls must be dropped in
SystemCallFilter bus property.
2022-06-17 12:19:39 +09:00
Yu Watanabe 05ab439a62 nspawn: fix UID map string
We send/recv the set of payload uid, host uid, payload gid, host gid.
Hence, the index must be incremented with 4, instead of 2.

Fixes #23664.
2022-06-16 11:52:59 +09:00
Vishal Chillara Srinivas f941c12427 RFC 6762 section 7.1: a Multicast DNS querier SHOULD NOT include records in the
Known-Answer list whose remaining TTL is less than half of their original TTL
2022-06-16 10:44:25 +09:00
Vishal Chillara Srinivas 82af03c223 resolve: mark mDNS RRs in the Additional Records section as cacheable
RFC 6762 does not restrict caching of records in the Additional section.
Caching can improve resolve efficiency.
2022-06-16 10:44:07 +09:00
Yu Watanabe eed6ee82df
Merge pull request #23733 from sshedi/cid-1469711
homework: initialize we_detached
2022-06-15 12:03:24 +09:00
Yu Watanabe 4589c1d734
Merge pull request #23709 from yuwata/test-hostname-locale
test: import hostname and locale tests from debian/ubuntu test suite
2022-06-15 12:00:22 +09:00
Shreenidhi Shedi c9f5ac0917 sd-journal: check retval of sd_id128_from_string call
Fixes: CID#1469712

CID 1469712 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from sd_id128_from_string(word + 2, &boot_id) to r here,
but that stored value is overwritten before it can be used.
2022-06-14 17:52:48 +05:30
Shreenidhi Shedi 2f4ad53549 homework: initialize we_detached
Fixes: CID#1469711

CID 1469711 (#1 of 1): Uninitialized scalar variable (UNINIT)
14. uninit_use: Using uninitialized value we_detached.
2022-06-14 17:52:46 +05:30
Yu Watanabe 2b1eb5f871 localectl: use Table to show status 2022-06-14 20:56:23 +09:00
Yu Watanabe 3e5203b3eb locale: rename keymap-util.[ch] -> localed-util.[ch]
As the file contains not only keymap related functions.
2022-06-14 20:56:23 +09:00
Yu Watanabe 3d36b5d7e7 locale-setup: merge locale handling in PID1 and localed 2022-06-14 20:56:23 +09:00
Yu Watanabe d2e96a4f87 locale-util: align locale entries 2022-06-14 20:56:23 +09:00
Yu Watanabe a2f7937747 locale-util: check if enumerated locales are valid 2022-06-14 20:56:23 +09:00
Yu Watanabe 065058e63b locale-util: fix memleak on failure 2022-06-14 20:56:23 +09:00
Christian Göttsche 1805fbcf06 sysctl: increase log severity on failed write
Increase the log severity in case of writing to a non existent sysctl
parameter as this can either be caused by a misspelling or a kernel mis-
configuration, e.g. in case YAMA does not get loaded due to a incomplete
lsm= override:

    systemd-sysctl[354]: Couldn't write '1' to 'kernel/yama/ptrace_scope', ignoring: No such file or directory
2022-06-14 09:29:37 +09:00
Shreenidhi Shedi a4433b4532 network: l2tp: initialize a to NULL
Fixes: CID#1475788
2022-06-13 08:41:52 +09:00
Zbigniew Jędrzejewski-Szmek ef55efe823
Merge pull request #23707 from yuwata/dns_service_split
dns-domain: fix buffer-overflow
2022-06-12 11:37:20 +02:00
Luca Boccassi 039f1673e9 meson: add build targets for libudev, libsystemd and pkg-config
Mirror install tags with the same names and content
2022-06-12 13:13:49 +09:00
Yu Watanabe 0ffc372a1d shared/linux: update kernel headers to 5.19-rc1 2022-06-11 06:50:12 +09:00
Yu Watanabe 7d9a2c0aa6 basic/linux: update kernel headers to 5.19-rc1 2022-06-11 06:49:42 +09:00
Yu Watanabe 3c4ae50abe dns-domain: reduce indentation in dns_service_split() 2022-06-11 06:02:08 +09:00
Yu Watanabe ec4c01475e dns-domain: rename function arguments 2022-06-11 06:01:48 +09:00
Yu Watanabe 9db01ca5b0 dns-domain: make each label nul-terminated
dns_label_unescape() does not nul-terminate the buffer if it does not
have enough space. Hence, if a lable is enough long, then strjoin()
triggers buffer-overflow.

Fixes #23705.
2022-06-11 06:01:46 +09:00
Yu Watanabe 288bafa952
Merge pull request #23691 from medhefgo/efi-clang
efi: Add parse_number8/16
2022-06-11 05:01:24 +09:00
Elias Probst 4218f81d83 systemctl: add edit verb to arguments' help text
The arguments `--global`, `--runtime` and `--root` also affect the
`edit` verb.
2022-06-11 04:43:42 +09:00
Yu Watanabe 3e808e0769
Merge pull request #23701 from medhefgo/boot-mem
boot: Use memcpy/memset provided by firmware
2022-06-11 04:29:27 +09:00
Shreenidhi Shedi 1dea9f1268 boot: use efi_memcpy inplace of memcpy
`efi_memcpy` does some validations before referencing pointers, it is
the safer option for this case.

Fixes: CID#1489876
2022-06-11 04:25:35 +09:00
Zbigniew Jędrzejewski-Szmek a61473bde5 shared/condition: accept size suffixes for ConditionMemory
Fixes #23697.
2022-06-10 19:50:59 +01:00
Luca Boccassi e48bc49271
Merge pull request #23687 from yuwata/dns-domain-trivial-cleanups
dns-domain: trivial cleanups
2022-06-10 19:50:22 +01:00
Frantisek Sumsal bf24eafcd2
Merge pull request #23584 from yuwata/test-login
test: import logind test from debian/ubuntu test suite
2022-06-10 14:50:35 +00:00
Frantisek Sumsal a359237fb7
Merge pull request #23690 from yuwata/test-sd-device
test: several tweaks for test-sd-device
2022-06-10 14:50:01 +00:00
Jan Janssen 8494bd1ced boot: Use memcpy/memset provided by firmware
These are significantly faster and safe us from rolling our own
optimized versions.
2022-06-10 15:54:06 +02:00
Jan Janssen 2b0af8e76a boot: Mark memcmp/memcpy/memset aliases as used
The compiler may emit calls to these but also optimize the function away
somehow, breaking at link stage. Marking them as used prevents this.
2022-06-10 15:54:02 +02:00
Jan Janssen f23b2a04e6 efi-string: Remove one more |= for bool
This one was missed in #23589.
2022-06-10 14:14:57 +02:00
James Hilliard 76abad4d47 meson: add experimental bpf-gcc compiler support
Not fully working but should make it easier to clean up remaining
issues.
2022-06-10 14:01:19 +02:00
Jan Janssen 153381952b boot: Use parse_number16 for boot counter parsing 2022-06-10 11:50:13 +02:00
Jan Janssen 1621ab4600 boot: Drop use of Atoi 2022-06-10 11:50:13 +02:00
Jan Janssen 72bd3458e5 boot: Add parse_number8/16 2022-06-10 11:50:13 +02:00
Yu Watanabe 3284dd9159 test: exclude network interfaces
After https://github.com/systemd/systemd-centos-ci/pull/492 is merged,
the networkd test may be running when test-sd-device is invoked.
Let's exclude net subsystem.
2022-06-10 18:44:21 +09:00
Yu Watanabe f9e090b16d test: always exclude devices named loop*
Not only block subsystem, but also misc has device named "loop*", and
the test always said that the following device is newly found:
---
/* test_sd_device_enumerator_filter_subsystem */
New device found: subsystem:misc syspath:/sys/devices/virtual/misc/loop-control
1 new devices are found in re-scan
---
2022-06-10 15:36:21 +09:00
Yu Watanabe da5fb1877d boot/efi-string: check the end of haystack before testing remaining pattern
Fixes buffer-overflow reported at https://github.com/systemd/systemd/pull/23589#issuecomment-1151820341.
2022-06-10 12:05:38 +09:00
Yu Watanabe c07eb49aff devnode-acl: use set_put_strdup_full() and set_ensure_consume() 2022-06-10 10:47:25 +09:00
Yu Watanabe 47484dd955 dns-domain: simplify code a bit 2022-06-10 09:49:07 +09:00
Yu Watanabe 8d896617b4 dns-domain: use dns_name_concat()
`dns_name_normalize()` is an alias of `dns_name_concat()`.
For consistency with `dns_name_is_valid_ldh()`, let's use
`dns_name_concat()`.
2022-06-10 09:42:33 +09:00
Yu Watanabe 8bf796eeac
Merge pull request #23589 from medhefgo/efi-clang
boot: Drop use of several gnu-efi functions
2022-06-10 08:54:48 +09:00
i-do-cpp 67225a96e5 fix: sd_id128_get_invocation now works for user services 2022-06-10 08:28:37 +09:00
Yu Watanabe 74223cbe14 tree-wide: fix typo 2022-06-10 08:26:08 +09:00
Frantisek Sumsal 894dad2975 test: account for ADDR_NO_RANDOMIZE if it's set
On ppc64le sanitizers disable ASLR (i.e. by setting ADDR_NO_RANDOMIZE),
which opinionated_personality() doesn't return. Let's tweak the current
personality ourselves in such cases.

See: 78f7a6eaa6

Resolves: #23666
2022-06-10 05:34:01 +09:00
Yu Watanabe 677ec2d609
Merge pull request #23348 from medhefgo/log-shutdown-blockers
shutdown: Log processes that block umount
2022-06-10 05:33:37 +09:00
Luca Boccassi 9c3e2a2a97
Merge pull request #23658 from keszybz/gcc-warnings-2
Fixes for NULL-pointer arguments based on gcc warnings
2022-06-09 17:48:09 +01:00
James Hilliard 9b948bc062 bpf: use __always_inline macro in restrict-ifaces.bpf.c
This appears to be more reliable at inlining with some compilers.
2022-06-09 17:45:11 +01:00
Jan Janssen df48b430a4 shutdown: Lazy unmount /oldroot/{dev,proc,sys}
These should not prevent us from cleaning up the remainders of /oldroot
if something in the kernel is blocking these from being unmounted.
2022-06-09 17:02:50 +02:00
Jan Janssen 20596876e3 shutdown: Log processes that block umount 2022-06-09 17:00:46 +02:00
Jan Janssen 5125b67742 shutdown: Rename umount_log_level and make it a bool
This was already effectively a bool because only ever two states were
valid. To make the meaning of it more clear, also rename it to last_try.
2022-06-09 16:50:54 +02:00
Zbigniew Jędrzejewski-Szmek c4da8e90fa systemctl: simplify code a bit
gcc insists that bus may be used unitialized here, but I don't see any
possibility of that.
2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek c90821aa49 shared/bus-util: rename variables to follow newer style 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek 73e910926e shared/bus-util: simplification 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek 482dac9431 test-udev-util: do not pass NULL to printf, style fixes 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek fa1aa468b9 test-process-util: do not pass NULL to printf, simplify tests
We don't need to fork to test that the function returns -EINVAL
on null input. So let's simplify things a bit.
2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek e9edf285db test-dns-domain: a few more "NULL in printf %s"s 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek d10cee5e90 test-fstab-util: one more "NULL in printf %s" 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek 8b98cfb7dd various: indentation 2022-06-09 13:25:17 +02:00
Zbigniew Jędrzejewski-Szmek a78af10ae7
Merge pull request #23654 from keszybz/gcc-warnings
Fixes for NULL-pointer arguments based on gcc warnings
2022-06-09 12:55:47 +02:00
Jan Janssen 55233913c8 boot: Drop use of DuplicateDevicePath 2022-06-09 12:50:13 +02:00
Jan Janssen e17fd5538f boot: Don't copy device path
BS->LocateDevicePath only advances the passed device path pointer.
It does not actually modify it, so there is no need to make a copy.
2022-06-09 12:50:13 +02:00
Jan Janssen b05d69ed72 boot: Drop use of LibLocateHandle 2022-06-09 12:50:13 +02:00
Jan Janssen b04f818417 boot: Drop use of UnpackDevicePath
Device paths are a packed data structure and the UEFI spec is clear that
members may be misaligned.

In this case all accesses are aligned except for the signature. We can
simply memcpy it instead of making a whole (aligned) copy of the device
path.
2022-06-09 12:50:13 +02:00
Jan Janssen 79a2b916a0 boot: Drop use of FileDevicePath 2022-06-09 12:50:13 +02:00
Jan Janssen 0af26643d0 boot: Use xmalloc
This drops the unused xnew0 and xallocate_zero_pool as there is only two
users of it. _cleanup_freepool_ will be phased out once the types in the
declarations are changed/renamed.
2022-06-09 12:50:13 +02:00
Jan Janssen 9148312fab boot: Add xmalloc 2022-06-09 12:50:13 +02:00
Jan Janssen 5594ebee99 boot: Drop use of DevicePathFromHandle 2022-06-09 12:50:13 +02:00
Jan Janssen 6a261332bc boot: Drop use of LibLocateProtocol 2022-06-09 12:50:13 +02:00
Jan Janssen f747ca3ec3 boot: Drop use of LibOpenRoot 2022-06-09 12:50:13 +02:00
Jan Janssen 7ebce8145e boot: Drop use of LibGetSystemConfigurationTable 2022-06-09 12:50:13 +02:00
Jan Janssen 23742af522 boot: Drop use of MetaiMatch
A future commit will add support for unicode collation protocol that
allows case folding and comparing strings with locale awareness. But it
only operates on whole strings, so fnmatch cannot use those without a
heavy cost. Instead we just case fold the patterns instead (the IDs we
try to match are already lower case).
2022-06-09 12:50:13 +02:00
Jan Janssen 0e8ecba96e boot: Add efi_fnmatch
Unlike MetaiMatch from the UEFI spec/EDK2 this implementation is
intended to be compatible with POSIX fnmatch.
2022-06-09 12:50:08 +02:00
Zbigniew Jędrzejewski-Szmek 2299b1cae3 Resolve conflicts between #23616 and the recent NFT additions 2022-06-09 10:06:30 +02:00
Yu Watanabe 377157e6bd
Merge pull request #23616 from keszybz/in-addr-to-string-formatting
Add macros that allocate a fixed buffer for in_addr_to_string(), in_addr_prefix+to_string()
2022-06-09 15:21:57 +09:00
Zbigniew Jędrzejewski-Szmek e0d537950b test-load-fragment: don't print NULLs 2022-06-09 07:53:06 +02:00