]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
18 months agoMerge pull request #26038 from lilyinstarlight/fix/fstab-generator-sysroot-without...
Zbigniew Jędrzejewski-Szmek [Thu, 9 Mar 2023 07:51:31 +0000 (08:51 +0100)] 
Merge pull request #26038 from lilyinstarlight/fix/fstab-generator-sysroot-without-cmdline

fstab-generator: use correct targets when /sysroot is specificied in fstab only

18 months agomacro: support the case that the number of elements has const qualifier
Yu Watanabe [Thu, 9 Mar 2023 04:14:12 +0000 (13:14 +0900)] 
macro: support the case that the number of elements has const qualifier

Follow-up for 5716c27e1f52d2aba9dd02916c01d6271d9d0b16.

Addresses https://github.com/systemd/systemd/pull/26303#issuecomment-1460712007.

18 months agoMerge pull request #26698 from ldv-alt/udevadm-verify
Yu Watanabe [Thu, 9 Mar 2023 04:05:57 +0000 (13:05 +0900)] 
Merge pull request #26698 from ldv-alt/udevadm-verify

Implement a udev rules syntax checker in the form of
`udevadm verify [OPTIONS] FILE...` command that is based on
`udev_rules_parse_file` interface and would apply further checks
on top of it in the future.

Resolves: #26606

18 months agolocaled: print a custom message if libxkbcommon.so is unvailable
Zbigniew Jędrzejewski-Szmek [Wed, 8 Mar 2023 17:59:14 +0000 (18:59 +0100)] 
localed: print a custom message if libxkbcommon.so is unvailable

Follow-up for 82c2095a5e407bcf041dc7bde84791deec95ff9c.

> I feel like the logging here may be a bit confusing on the new path.
> Previously you did get a message that explained what was going on. Now you get
> an info message that the layout could not be compiled, and … that's all. I can
> imagine this being a confusing red herring if someone was trying to debug a
> problem and saw this message. Perhaps we should log something else instead/as
> well, on the case where libxkbcommon isn't present, to say that's what we're
> logging about and it just means we can't validate the configuration, not that
> it's definitely invalid?

18 months agoMerge pull request #26119 from kraxel/uki.install
Luca Boccassi [Wed, 8 Mar 2023 21:25:25 +0000 (21:25 +0000)] 
Merge pull request #26119 from kraxel/uki.install

kernel-install: improve uki handling

18 months agoMerge pull request #26656 from yuwata/mkdir-error-code
Luca Boccassi [Wed, 8 Mar 2023 21:23:07 +0000 (21:23 +0000)] 
Merge pull request #26656 from yuwata/mkdir-error-code

mkdir: fix error code

18 months agoCODING_STYLE: note that 'unsigned' form is preferred over 'unsigned int'
Dmitry V. Levin [Wed, 8 Mar 2023 20:00:00 +0000 (20:00 +0000)] 
CODING_STYLE: note that 'unsigned' form is preferred over 'unsigned int'

18 months agoMerge pull request #26711 from keszybz/man-page-stuff
Luca Boccassi [Wed, 8 Mar 2023 20:29:18 +0000 (20:29 +0000)] 
Merge pull request #26711 from keszybz/man-page-stuff

Man page tweaks

18 months agoudev_rules_parse_file: issue diagnostics about line continuation at EOF 26698/head
Dmitry V. Levin [Wed, 8 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev_rules_parse_file: issue diagnostics about line continuation at EOF

When udev rules file ends with a line continuation, the parser
used to silently ignore the line without any diagnostics at all.
It's time to break the vow of silence and let the parser issue some
error diagnostics.

18 months agoMerge pull request #26716 from mrc0mmand/more-tests
Luca Boccassi [Wed, 8 Mar 2023 18:55:40 +0000 (18:55 +0000)] 
Merge pull request #26716 from mrc0mmand/more-tests

test: add a couple of tests for systemd-escape and systemd-id128

18 months agotest: check udevadm verify diagnostics of unused labels
Dmitry V. Levin [Mon, 6 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
test: check udevadm verify diagnostics of unused labels

18 months agoudevadm-verify: check for unused labels
Dmitry V. Levin [Sun, 5 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udevadm-verify: check for unused labels

Check for unused labels in the specified udev rules files, report such
labels and exit with a non-zero exit code if any unused labels are
found.

18 months agotest: add a test for udevadm verify
Dmitry V. Levin [Sat, 4 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
test: add a test for udevadm verify

18 months agomeson.build: check udev rules using udevadm verify
Dmitry V. Levin [Fri, 3 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
meson.build: check udev rules using udevadm verify

Although udev rules are already being checked by rule-syntax-check.py
script, also check them using udevadm verify which performs more
thorough checks.

18 months agorules: do not use blkid builtin if built without blkid support
Dmitry V. Levin [Tue, 7 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
rules: do not use blkid builtin if built without blkid support

When built without blkid, then udev-builtin-blkid is not built,
and the verifier warns about the unknown builtin:

60-persistent-storage.rules:114 Unknown builtin command: blkid --hint=session_offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}
60-persistent-storage.rules:117 Unknown builtin command: blkid --noraid
60-persistent-storage.rules:120 Unknown builtin command: blkid
60-persistent-storage.rules: udev rules check failed

18 months agoudevadm: introduce new 'verify' command
Dmitry V. Levin [Thu, 2 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udevadm: introduce new 'verify' command

We seem to have no tool to verify udev rule files.  There is a simple
udev rules syntax checker in the tree, test/rule-syntax-check.py, but
it is too simple to detect less trivial issues not detected by udev,
e.g. redundant comparisons (#26593) or labels without references.

Such a tool would be beneficial not only for maintaining udev rules
distributed along with udev, but also and even more so for maintaining
third party udev rules that are more likely to have issues with syntax
and semantic correctness.

Implement a udev rules syntax and semantics checker in the form of
'udevadm verify [OPTIONS] FILE...' command that is based on
udev_rules_parse_file() interface and would apply further checks
on top of it in subsequent commits.

Resolves: #26606

18 months agoudev_rules_parse_file: mark logged issues
Dmitry V. Levin [Wed, 1 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev_rules_parse_file: mark logged issues

Traditionally, all issues found in udev rules by udev_rules_parse_file()
are logged and ignored, so there was no mechanism to propagate the
information about these issues back to the caller.

Introduce such a mechanism by adding a new member to UdevRuleFile.
This new member is a bitmask describing which log levels were used
in messages logged with regards to the rule file.

This mechanism is going to be used by udevadm verify in subsequent
commits.

18 months agoMerge pull request #26678 from yuwata/foreach_array
Zbigniew Jędrzejewski-Szmek [Wed, 8 Mar 2023 18:06:20 +0000 (19:06 +0100)] 
Merge pull request #26678 from yuwata/foreach_array

macro: introduce FOREACH_ARRAY() macro

18 months agocore: log message when reloading finishes
Luca Boccassi [Wed, 8 Mar 2023 12:59:40 +0000 (12:59 +0000)] 
core: log message when reloading finishes

Reloading might be slow, especially when under memory pressure, and watchdogs
might be triggered. It is useful to have timestamped telemetry in the journal
to see how long a reload takes.

18 months agotest: add a couple of tests for systemd-id128 26716/head
Frantisek Sumsal [Wed, 8 Mar 2023 15:18:09 +0000 (16:18 +0100)] 
test: add a couple of tests for systemd-id128

18 months agotest: add a couple of tests for systemd-escape
Frantisek Sumsal [Wed, 8 Mar 2023 14:40:34 +0000 (15:40 +0100)] 
test: add a couple of tests for systemd-escape

18 months agorandom-seed: drop extraneous "we"
Frantisek Sumsal [Wed, 8 Mar 2023 11:58:28 +0000 (12:58 +0100)] 
random-seed: drop extraneous "we"

18 months agoMerge pull request #26713 from keszybz/man-getenv
Yu Watanabe [Wed, 8 Mar 2023 15:16:30 +0000 (00:16 +0900)] 
Merge pull request #26713 from keszybz/man-getenv

Add note to docs that setenv() cannot be called in parallel with getenv()

18 months agoman: use more references 26713/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 19:26:20 +0000 (20:26 +0100)] 
man: use more references

18 months agoman: add mention that libsystemd uses getenv()
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 19:25:58 +0000 (20:25 +0100)] 
man: add mention that libsystemd uses getenv()

See #26688: getenv() is not thread-safe, and could a possible source of
problems when a multi-threaded program calls setenv()/putenv()/unsetenv() in
parallel. It is not possible to avoid getenv() calls in general, since $PATH,
$LANG, $SHELL, $USER, $HOME, $TZ may need to be accessed at any time.
Add a warning to our docs so that people are aware of the issue.

Closes #26688. (Real fixes will need to be in glibc and gnome-shell or other
programs.)

The text is added to threads-aware.xml to be included in various places. By
including it in libsystemd-pkgconfig.xml, it is automatically added to all sd-*
pages. The text is also included explicitly in pages for a few other functions
which are call getenv().

18 months agotimesync: stop re-sync on network configuration change when no link servers are confi...
Chitoku [Wed, 8 Mar 2023 10:52:55 +0000 (19:52 +0900)] 
timesync: stop re-sync on network configuration change when no link servers are configured (#26708)

This commit fixes an issue where systemd-timesyncd re-synchronizes the
system clock every time the network configuration is updated, no matter
whether link servers are actually changed.

Fixes a bug introduced by e05dd7718d0b32e039c9e0f7bf3875079d1a359d.

18 months agolocaled: skip verification when libxkbcommon is not installed
Zbigniew Jędrzejewski-Szmek [Wed, 8 Mar 2023 08:11:22 +0000 (09:11 +0100)] 
localed: skip verification when libxkbcommon is not installed

When compliled without libxkbcommon, we do no verification and accept the
arguments as given. When compliled against with, if dlopen() works, we do the
verification. But if dlopen() fails, we would refuse the call and return
SD_BUS_ERROR_INVALID_ARGS. 5de344704df64d8f31448f1222432bc87ddcfbef added things
this way when converting to dlopen(), but it seems not very useful: it can be
expected that when the library is supported but missing at runtime, we degrade
softly, and that the behaviour is something inbetween the cases of hard disable
at compilation time and full support. But right now we behave more strictly then
if disabled at compilation. Change the code to just warn if dlopen fails, but
accept the arguments.

(There are various minimization scenarios where forcing the installation of
libxkbcommon is not useful. E.g. a small installation where we want to set the
keymap via logind, but the configuration is managed by a configuration
management system and is known to be valid. Verification via libxkbcommon is
just overhead in this case.)

800f65f827c9828d4c872d44b19ca8a008505690 moved the check earlier, so now even
a noop case of setting the values that were already in place can fail.
C.f. https://bugzilla.redhat.com/show_bug.cgi?id=2175244.

18 months agoMerge pull request #26685 from yuwata/man-missing-services
Zbigniew Jędrzejewski-Szmek [Wed, 8 Mar 2023 08:35:03 +0000 (09:35 +0100)] 
Merge pull request #26685 from yuwata/man-missing-services

man: mention two missing services

18 months agotest: add a couple of tests for busctl
Frantisek Sumsal [Tue, 7 Mar 2023 17:44:20 +0000 (18:44 +0100)] 
test: add a couple of tests for busctl

18 months agoMerge pull request #26706 from jengelh/master
Luca Boccassi [Tue, 7 Mar 2023 21:34:03 +0000 (21:34 +0000)] 
Merge pull request #26706 from jengelh/master

doc: various orthographic fixes

18 months agoMerge pull request #26695 from poettering/dissect-mount-helper
Luca Boccassi [Tue, 7 Mar 2023 20:07:17 +0000 (20:07 +0000)] 
Merge pull request #26695 from poettering/dissect-mount-helper

make "systemd-dissect --mount" available as /sbin/mount.ddi

18 months agoman: adjust description of CPUAccounting= 26711/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 15:09:35 +0000 (16:09 +0100)] 
man: adjust description of CPUAccounting=

For any user on a semi-recent kernel, effectively this setting is pointless.
We should deprecate it once not needed anymore for the v1 hierarchy. For
now, adjust the description.

18 months agoman: add a note about session autogrouping
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 15:08:16 +0000 (16:08 +0100)] 
man: add a note about session autogrouping

When cpu controller is disabled, thing would often still behave as if
it was. And since the cpu controller can be enabled "magically" e.g. by
starting user@1000, add a note for users to be careful. Autogrouping
is described well in the man page, incl. how to enable or disable it,
so it should be enough to refer to that.

18 months agoman: tweak details in descriptions of pids and cpu configuration
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 15:06:23 +0000 (16:06 +0100)] 
man: tweak details in descriptions of pids and cpu configuration

For CPUWeight=: there is an important distinction between our default of
[not set], and the kernel default of "100". Let's not say that our default
is "100" because then 'systemctl show' output is hard to explain.

For task accounting, it's the kernel that does the accounting, not systemd.

18 months agoman: describe how cgroup controllers are turned on
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 15:02:14 +0000 (16:02 +0100)] 
man: describe how cgroup controllers are turned on

For a user, information which cgroup controllers are enabled based on
the unit configuration is rather important. Not only because it determines
what resource control is peformed by the kernel, but also because controllers
have a non-negligible cost, especially for deep nesting, and users may want
to *not* have controllers enabled.

Our documentation did its best to avoid the topic so far. This was partially
caused by the support for cgroup v1, which meant that any discussion of
controllers had to be conditional and messy. But v1 is deprecated on its way
out, so it should be fine to just describe what happens with v2.

The text is extended with a discussion of how controllers are enabled and
disabled, and an example, and for various settings that enable controllers
the relevant controller is now mentioned.

18 months agoman: explain route-only domains a bit more
Zbigniew Jędrzejewski-Szmek [Tue, 7 Mar 2023 12:48:09 +0000 (13:48 +0100)] 
man: explain route-only domains a bit more

The details discussion of how search and route-only domains work is in
systemd-resolved.service(8). But users are more likely to look at
resolved.conf(5), because that's where Domains= is described. So let's add a
reference to the other man page there, and also strengthen the text a bit. In
particular, in systemd-resolved.service(8) we say "route-only", which makes
the distinction with search domains clearer. Let's use the same in the other
man page too.

This is based on feedback from Lukáš Nykrýn that the man page is not clear
enough.

18 months agoMerge pull request #26709 from DaanDeMeyer/mkosi-drop-debug
Daan De Meyer [Tue, 7 Mar 2023 14:49:06 +0000 (15:49 +0100)] 
Merge pull request #26709 from DaanDeMeyer/mkosi-drop-debug

mkosi: Various cleanups

18 months agomkosi: Fix locations of mkosi-check-and-shutdown files 26709/head
Daan De Meyer [Tue, 7 Mar 2023 14:24:13 +0000 (15:24 +0100)] 
mkosi: Fix locations of mkosi-check-and-shutdown files

18 months agomkosi: Drop debug logging
Daan De Meyer [Tue, 7 Mar 2023 14:23:35 +0000 (15:23 +0100)] 
mkosi: Drop debug logging

The spurious "connection timed out" errors from nspawn should be
fixed now that we're running the latest version.

18 months agomkosi: Drop kernel command line masking in CI
Daan De Meyer [Tue, 7 Mar 2023 14:22:59 +0000 (15:22 +0100)] 
mkosi: Drop kernel command line masking in CI

These services should be disabled by default and not need explicit
masking anymore.

18 months agomkosi: Update to latest
Daan De Meyer [Tue, 7 Mar 2023 14:25:02 +0000 (15:25 +0100)] 
mkosi: Update to latest

So that we don't enable services by default anymore on Debian.

18 months agodoc: correct wrong use "'s" contractions 26706/head
Jan Engelhardt [Tue, 7 Mar 2023 11:51:31 +0000 (12:51 +0100)] 
doc: correct wrong use "'s" contractions

18 months agodoc: replace wrong idiom in homed comment
Jan Engelhardt [Tue, 7 Mar 2023 12:06:14 +0000 (13:06 +0100)] 
doc: replace wrong idiom in homed comment

18 months agodoc: replace wrong á preposition by à
Jan Engelhardt [Tue, 7 Mar 2023 12:04:21 +0000 (13:04 +0100)] 
doc: replace wrong á preposition by à

18 months agoMerge pull request #26648 from bluca/kernel_install_guid
Luca Boccassi [Tue, 7 Mar 2023 11:26:12 +0000 (11:26 +0000)] 
Merge pull request #26648 from bluca/kernel_install_guid

kernel-install: also try to find $BOOT by partition GUID

18 months agoconf-files: fix potential memleak in conf_files_list_strv_internal() on failure
Yu Watanabe [Sun, 5 Mar 2023 20:56:29 +0000 (05:56 +0900)] 
conf-files: fix potential memleak in conf_files_list_strv_internal() on failure

This also changes the used hash_ops from path_hash_ops to
string_hash_ops, as the key is not a path, but a filename.

18 months agokernel-install: handle uki installs automatically 26119/head
Gerd Hoffmann [Fri, 20 Jan 2023 08:05:18 +0000 (09:05 +0100)] 
kernel-install: handle uki installs automatically

Detect image type using "bootctl kernel-identify $kernel",
store result in KERNEL_INSTALL_IMAGE_TYPE.

Extend layout autodetection to check the kernel image type
and pick layout=uki for UKIs.

Resolves: #25822

18 months agokernel-install: remove math slang from man page
Gerd Hoffmann [Wed, 25 Jan 2023 12:57:09 +0000 (13:57 +0100)] 
kernel-install: remove math slang from man page

18 months ago90-uki-copy.install: create $BOOT/EFI/Linux directory if needed
Gerd Hoffmann [Fri, 20 Jan 2023 11:59:33 +0000 (12:59 +0100)] 
90-uki-copy.install: create $BOOT/EFI/Linux directory if needed

Do not consider a missing 'Linux' subdirectory an error.
Just create it instead.

18 months agobootctl: tweak DOS header magic check
Gerd Hoffmann [Tue, 24 Jan 2023 09:28:25 +0000 (10:28 +0100)] 
bootctl: tweak DOS header magic check

Read the magic first, try reading the full DOS exe header only in case
the magic check succeeds.

This avoids throwing an header read error on small dummy files as used
by test-kernel-install.

18 months agosystemctl: port FOREACH_ARRAY() to systemctl-list-units.c 26678/head
Yu Watanabe [Sun, 5 Mar 2023 06:06:11 +0000 (15:06 +0900)] 
systemctl: port FOREACH_ARRAY() to systemctl-list-units.c

18 months agomacro: introduce FOREACH_ARRAY() macro
Yu Watanabe [Sun, 5 Mar 2023 05:56:15 +0000 (14:56 +0900)] 
macro: introduce FOREACH_ARRAY() macro

The pattern that runs all array element is quite common.
But, sometimes, the number of element may be in a signed integer, or the
array may be NULL.

18 months agoMerge pull request #26669 from YHNdnzj/journalctl-lines-since-until
Yu Watanabe [Tue, 7 Mar 2023 03:02:47 +0000 (12:02 +0900)] 
Merge pull request #26669 from YHNdnzj/journalctl-lines-since-until

journalctl: fix output when --lines is used with --since or --until

18 months agoudev: Don't mark as tablet if device has relative coordinates
Joshua Goins [Sat, 4 Mar 2023 03:02:02 +0000 (22:02 -0500)] 
udev: Don't mark as tablet if device has relative coordinates

Tablets don't typically have relative coordinates (they are separated on
the kernel device layer). However, some Logitech mice report similar
supported events, so use the existence of EV_REL to determiner whether or
not the device is really a tablet.

Fixes bug introduced by 0855ce67726f87a5a67b4fb536d58e0e4428a248.

Fixes: #26600
18 months agoman: document /sbin/mount.ddi 26695/head
Lennart Poettering [Mon, 6 Mar 2023 17:48:18 +0000 (18:48 +0100)] 
man: document /sbin/mount.ddi

18 months agotest: add test for new /sbin/mount.ddi helper
Lennart Poettering [Mon, 6 Mar 2023 17:27:38 +0000 (18:27 +0100)] 
test: add test for new /sbin/mount.ddi helper

18 months agodissect: implement external helper plugin interface for /bin/mount
Lennart Poettering [Mon, 6 Mar 2023 17:25:25 +0000 (18:25 +0100)] 
dissect: implement external helper plugin interface for /bin/mount

With this change we'll install a symlink /sbin/mount.ddi →
systemd-dissect. If invoked that way we'll do the equivalent of
systemd-dissect --mount.

This makes DDIs mountable directly via the "mount" command, by
specifying the "-t ddi" pseudo file system type. Moreover you can now
mount DDIs directly via /etc/fstab, by specifying "ddi" in the file
system column (3rd column).

18 months agoMerge pull request #26686 from yuwata/iovec
Luca Boccassi [Mon, 6 Mar 2023 21:00:04 +0000 (21:00 +0000)] 
Merge pull request #26686 from yuwata/iovec

tree-wide: replace IOVEC_INIT with IOVEC_MAKE

18 months agonetwork: geneve: add InheritInnerProtocol flag
Josef Miegl [Sat, 4 Mar 2023 21:18:34 +0000 (22:18 +0100)] 
network: geneve: add InheritInnerProtocol flag

18 months agobase-filesystem: Support Arch-style multilib
Adrian Vovk [Thu, 2 Mar 2023 18:20:51 +0000 (13:20 -0500)] 
base-filesystem: Support Arch-style multilib

On distros like Arch and on carbonOS, libraries end up in /usr/lib.
Thus, /lib64 should point to /usr/lib. This commit adds this
functionality as a final fallback (if neither Debian-style nor
Fedora-style multilib can be detected)

18 months agoMerge pull request #26502 from DaanDeMeyer/chase-symlinks-additions
Luca Boccassi [Mon, 6 Mar 2023 20:51:06 +0000 (20:51 +0000)] 
Merge pull request #26502 from DaanDeMeyer/chase-symlinks-additions

Several chase_symlinks() additions

18 months agoMerge pull request #26687 from yuwata/c2x
Luca Boccassi [Mon, 6 Mar 2023 20:50:17 +0000 (20:50 +0000)] 
Merge pull request #26687 from yuwata/c2x

C2X support

18 months agotime-util: drop redundant call of tzset()
Yu Watanabe [Mon, 6 Mar 2023 13:02:43 +0000 (22:02 +0900)] 
time-util: drop redundant call of tzset()

It is also called at the beginning of `parse_timestamp_maybe_with_tz()`.

18 months agogpt-auto: Check for /boot before putting ESP there
Adrian Vovk [Thu, 2 Mar 2023 18:00:28 +0000 (13:00 -0500)] 
gpt-auto: Check for /boot before putting ESP there

We prefer /efi as a mount point for the ESP, and use /boot as a fallback
if /efi doesn't exist. However, when root=tmpfs, neither /efi nor /boot
exist. gpt-auto should mount to /efi in this case, but it mounted to
/boot instead. This is because gpt-auto didn't check for the existence
of /boot. Here, we correct this

18 months agomkosi: Update to latest
Daan De Meyer [Mon, 6 Mar 2023 15:51:53 +0000 (16:51 +0100)] 
mkosi: Update to latest

Latest version builds nspawn from source which hopefully gets rid of
the spurious "Connection timed out" errors we've been seeing in CI.

18 months agoTODO
Lennart Poettering [Mon, 6 Mar 2023 17:29:07 +0000 (18:29 +0100)] 
TODO

18 months agochase-symlinks: Add chase_symlinks_at_and_open() 26502/head
Daan De Meyer [Sun, 8 Jan 2023 17:24:38 +0000 (18:24 +0100)] 
chase-symlinks: Add chase_symlinks_at_and_open()

18 months agochase-symlinks: Add CHASE_MKDIR_0755
Daan De Meyer [Mon, 9 Jan 2023 11:29:12 +0000 (12:29 +0100)] 
chase-symlinks: Add CHASE_MKDIR_0755

18 months agochase-symlinks: Add CHASE_PARENT
Daan De Meyer [Fri, 23 Dec 2022 11:08:19 +0000 (12:08 +0100)] 
chase-symlinks: Add CHASE_PARENT

Let's simplify chasing the parent directory of some path by adding
CHASE_PARENT.

18 months agochase-symlinks: Return "." as path from chase_symlinks_at() instead of NULL
Daan De Meyer [Thu, 23 Feb 2023 13:24:56 +0000 (14:24 +0100)] 
chase-symlinks: Return "." as path from chase_symlinks_at() instead of NULL

18 months agochase-symlinks: Skip shortcuts if CHASE_PROHIBIT_SYMLINKS is set
Daan De Meyer [Sun, 8 Jan 2023 17:04:20 +0000 (18:04 +0100)] 
chase-symlinks: Skip shortcuts if CHASE_PROHIBIT_SYMLINKS is set

18 months agoudev_rules_parse_file: do not skip ENOENT
Dmitry V. Levin [Tue, 28 Feb 2023 08:00:00 +0000 (08:00 +0000)] 
udev_rules_parse_file: do not skip ENOENT

Starting with commit ed88bcfb7c15029f9fc95ee2380759a9eb782d46,
udev_rules_parse_file() silently skips files it fails to open with
ENOENT error, e.g. when they are broken symlinks.  As this behavior is
undocumented and it seems to be unintended, let's treat ENOENT like any
other error.  This change would also simplify the implementation of the
udev rules syntax checker mentioned in #26606.

udev_rules_load(), the only user of udev_rules_parse_file(), is not
affected by this change because it essentially ignores the value
returned by the latter, the only visible difference would be a log
message issued for every udev rules file that couldn't be open because
of ENOENT.

Fixes: ed88bcfb7c15 ("Be more careful when checking for empty files")
18 months agoMerge pull request #26650 from yuwata/udev-trigger
Yu Watanabe [Mon, 6 Mar 2023 07:36:34 +0000 (16:36 +0900)] 
Merge pull request #26650 from yuwata/udev-trigger

test: generate debugging logs for udevd after restart

18 months agotest: add header build tests for newer C and C++ standards 26687/head
Yu Watanabe [Mon, 6 Mar 2023 01:21:47 +0000 (10:21 +0900)] 
test: add header build tests for newer C and C++ standards

18 months agoInclude <threads.h> if possible to get thread_local definition
Cristian Rodríguez [Tue, 3 Jan 2023 17:52:08 +0000 (17:52 +0000)] 
Include <threads.h> if possible to get thread_local definition

IN C23, thread_local is a reserved keyword and we shall therefore
do nothing to redefine it. glibc has it defined for older standard
version with the right conditions.

v2 by Yu Watanabe:
Move the definition to missing_threads.h like the way we define e.g.
missing syscalls or missing definitions, and include it by the users.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
18 months agotree-wide: replace IOVEC_INIT with IOVEC_MAKE 26686/head
Yu Watanabe [Mon, 6 Mar 2023 00:25:14 +0000 (09:25 +0900)] 
tree-wide: replace IOVEC_INIT with IOVEC_MAKE

We use gnu11 to build, hence we can use structured initializer with
casting, and it is not necessary to use different patterns on
initialization and assignment.

Addresses https://github.com/systemd/systemd/pull/26560#discussion_r1118875447.

18 months agosd-journal: wrap long line
Yu Watanabe [Mon, 6 Mar 2023 00:16:07 +0000 (09:16 +0900)] 
sd-journal: wrap long line

Addresses https://github.com/systemd/systemd/pull/26560#discussion_r1118875967.

18 months agoman: mention systemd-growfs-root.service 26685/head
Yu Watanabe [Sun, 5 Mar 2023 22:15:29 +0000 (07:15 +0900)] 
man: mention systemd-growfs-root.service

18 months agoman: mention systemd-fsck-usr.service
Yu Watanabe [Sun, 5 Mar 2023 22:15:12 +0000 (07:15 +0900)] 
man: mention systemd-fsck-usr.service

18 months agomeson: adjust for removal of gnu-efi compat
Zbigniew Jędrzejewski-Szmek [Fri, 3 Mar 2023 15:08:41 +0000 (16:08 +0100)] 
meson: adjust for removal of gnu-efi compat

gnu-efi-3.0.11-13.fc39 in Fedora dropped the old include paths.

18 months agoRevert "hwdb: fix swapped buttons for Logitech Lift left"
Yu Watanabe [Sun, 5 Mar 2023 04:01:35 +0000 (13:01 +0900)] 
Revert "hwdb: fix swapped buttons for Logitech Lift left"

This reverts commit 81cfea95e51c72da6765b517e7038b3e7e3dec9f.

The modalias seems to match a generic Logitech USB receiver even the
connected mouce is not for left hand.

Fixes #26671 and #26676.

18 months agoMerge pull request #26651 from yuwata/meson-cleanups
Zbigniew Jędrzejewski-Szmek [Sun, 5 Mar 2023 12:38:55 +0000 (13:38 +0100)] 
Merge pull request #26651 from yuwata/meson-cleanups

Several meson cleanups

18 months agojournalctl: fix output when --since is used with --lines 26669/head
Mike Yuan [Sat, 4 Mar 2023 11:38:35 +0000 (19:38 +0800)] 
journalctl: fix output when --since is used with --lines

Before this commit, if --since is used with --lines=N,
we seek to the place of --since and search afterwards
there, resulting in outputing the first N lines.

After this commit, we only do the above if --since is used without
--reverse and --lines. Otherwise we seek to the tail first and check
if the entry is within the range of --since later.

18 months agomkosi: Install dnf on centos and fedora
Daan De Meyer [Sun, 5 Mar 2023 08:41:38 +0000 (09:41 +0100)] 
mkosi: Install dnf on centos and fedora

dnf is not installed by default anymore, but it's still useful to
have in our images, so let's install it explicitly.

18 months agojournalctl: fix output when --until is used with --lines
Mike Yuan [Sat, 4 Mar 2023 11:06:00 +0000 (19:06 +0800)] 
journalctl: fix output when --until is used with --lines

Before this commit, when --lines is specified, we jump to the tail and
search afterwards from there, thus breaking --until if used together.

After this commit:
If both --until and any of --reverse and --lines is specified, things get
a little tricky. We seek to the place of --until first. If only --reverse or
--reverse and --lines is specified, we search backwards and let the output
counter handle --lines for us. If only --lines is used, we just jump backwards
arg_lines and search afterwards from there.

18 months agoMerge pull request #26668 from yuwata/man-link-rename
Yu Watanabe [Sat, 4 Mar 2023 13:14:22 +0000 (22:14 +0900)] 
Merge pull request #26668 from yuwata/man-link-rename

man: add/update example in systemd.link

18 months agoman: add an example to (re-)apply new settings to a network interface 26668/head
Yu Watanabe [Sat, 4 Mar 2023 05:57:10 +0000 (14:57 +0900)] 
man: add an example to (re-)apply new settings to a network interface

Closes #26601.

18 months agoman: sync the default .link file in example
Yu Watanabe [Sat, 4 Mar 2023 05:33:10 +0000 (14:33 +0900)] 
man: sync the default .link file in example

18 months agoMerge pull request #26653 from poettering/tmpfile-linkable-replace
Yu Watanabe [Fri, 3 Mar 2023 17:53:59 +0000 (02:53 +0900)] 
Merge pull request #26653 from poettering/tmpfile-linkable-replace

teach link_tmpfile() to optionally replace files

18 months agoREADME: update CentOS CI URLs to the new instance
Frantisek Sumsal [Fri, 3 Mar 2023 16:57:15 +0000 (17:57 +0100)] 
README: update CentOS CI URLs to the new instance

18 months agosystemctl: explicitly cast the constants to uint64_t
Frantisek Sumsal [Fri, 3 Mar 2023 11:17:27 +0000 (12:17 +0100)] 
systemctl: explicitly cast the constants to uint64_t

Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:

$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.

$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument

(reproduced on an armv7hl machine)

Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735

18 months agoMerge pull request #26646 from poettering/nspawn-private
Luca Boccassi [Fri, 3 Mar 2023 15:57:13 +0000 (15:57 +0000)] 
Merge pull request #26646 from poettering/nspawn-private

nspawn: ensure all mount propagation is turned off between host and container, except for the "tunnel" dir

18 months agoMerge pull request #26649 from yuwata/parse-timstamp
Luca Boccassi [Fri, 3 Mar 2023 15:56:53 +0000 (15:56 +0000)] 
Merge pull request #26649 from yuwata/parse-timstamp

test: fix and extend test for parse_timestamp()

18 months agotest: trigger new events after all currently queued events are processed 26650/head
Yu Watanabe [Fri, 3 Mar 2023 14:19:27 +0000 (23:19 +0900)] 
test: trigger new events after all currently queued events are processed

Otherwise, udevd may be busy and udevadm may not receive the reply
for the control packet within the time limit.

18 months agoman: fix doubled word
Yu Watanabe [Fri, 3 Mar 2023 14:13:23 +0000 (23:13 +0900)] 
man: fix doubled word

18 months agoman: fix typo (#26655)
наб [Fri, 3 Mar 2023 14:01:51 +0000 (15:01 +0100)] 
man: fix typo (#26655)

18 months agotest: add tests for error code propagation from mkdir_xyz() 26656/head
Yu Watanabe [Fri, 3 Mar 2023 13:58:34 +0000 (22:58 +0900)] 
test: add tests for error code propagation from mkdir_xyz()

18 months agomkdir: fix error code on failure
Yu Watanabe [Fri, 3 Mar 2023 13:52:06 +0000 (22:52 +0900)] 
mkdir: fix error code on failure

Before:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": No such file or directory
====

After:
====
$ systemctl edit network.target
Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": Permission denied
====

Fixes #26652.

18 months agohwdb: port to flink_tmpfile() 26653/head
Lennart Poettering [Fri, 3 Mar 2023 10:30:13 +0000 (11:30 +0100)] 
hwdb: port to flink_tmpfile()

And modernize heavily while doing so.

Fixes: #21787
(Strictly speaking, this leaves a race window open: the the system is
powered off in the short interval when we linked in the prepared hwdb
file into the dir under a temporary name and are about to rename it to
the final name, then the file might be left over after all. But this
minimizes the window so much that this shouldn't be an issue in
real-life. Key after all is that with this change we'll build up the
hwdb file under O_TMPFILE, and thus are robust to power loss during the
slow operation)

18 months agotmpfile-util: teach link_tmpfile() to optionally replace files
Lennart Poettering [Fri, 3 Mar 2023 10:27:42 +0000 (11:27 +0100)] 
tmpfile-util: teach link_tmpfile() to optionally replace files