Commit Graph

47546 Commits

Author SHA1 Message Date
Lennart Poettering da7511d575 update NEWS 2020-10-22 14:05:28 +02:00
Lennart Poettering 44f88e7050
Merge pull request #17415 from keszybz/logind-resolved-docs
A bunch of updates to logind and resolved man pages
2020-10-22 13:44:17 +02:00
Zbigniew Jędrzejewski-Szmek 31619e2f61 resolved: add trailing newlines in generated file
Fixup for b3ffa2b5f3.
2020-10-22 11:55:35 +02:00
Zbigniew Jędrzejewski-Szmek 9c0780af5d resolved.conf: add empty DNSStubListenerExtra= 2020-10-22 11:55:35 +02:00
Zbigniew Jędrzejewski-Szmek bace688394 man: document differences between nss-resolve and nss-dns
https://bugzilla.redhat.com/show_bug.cgi?id=1889012
https://serverfault.com/questions/626612/dns-just-started-resolving-my-server-prod-addresses-to-127-0-53-53
https://serverfault.com/questions/649352/what-are-the-security-implications-of-the-allow-dns-suffix-appending-to-unquali
2020-10-22 11:55:35 +02:00
Zbigniew Jędrzejewski-Szmek 2ce493672c man/org.freedesktop.resolve1: briefly document a bunch of methods and properties
Fixes #13799.
2020-10-22 11:55:35 +02:00
Zbigniew Jędrzejewski-Szmek 9e1804b24c man/systemd-resolved: reword the description of query a bit
The phrase "routing domains" is used to mean both route-only domains and search
domains. Route-only domains are always called like that, and not just "route domains".

Some paragraphs are reordered to describe synthetisized records first, then
LLMNR, then various ways quries are routed.

Fixes #8928, hopefully.
2020-10-22 11:55:35 +02:00
Lennart Poettering 349bbd8331
Merge pull request #13589 from williamvds/systemctl-edit-copy
systemctl: show original contents in comment when editing unit
2020-10-22 11:19:26 +02:00
Kairui Song edb8c98446 pstore: don't enable crash_kexec_post_notifiers by default
commit f00c36641a enabled
crash_kexec_post_notifiers by default regardless of whether pstore
is enabled or not.

The original intention to enabled this option by default is that
it only affects kernel post-panic behavior, so should have no harm.
But this is not true if the user wants a reliable kdump.

crash_kexec_post_notifiers is known to cause problem with kdump,
and it's documented in kernel. It's not easy to fix the problem
because of how kdump works. Kdump expects the crashed kernel to
jump to an pre-loaded crash kernel, so doing any extra job before
the jump will increase the risk.

It depends on the user to choose between having a reliable kdump or
some other post-panic debug mechanic.

So it's better to keep this config untouched by default, or it may put
kdump at higher risk of failing silently. User should enable it by
uncommenting the config line manually if pstore is always needed.

Also add a inline comment inform user about the potential issue.

Thanks to Dave Young for finding out this issue.

Fixes #16661

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-22 11:17:39 +02:00
Lennart Poettering dbb74162b2
Merge pull request #17412 from mrc0mmand/ghworkflow-buildtest-improvements
ci: GH 'build test' improvements
2020-10-22 11:16:12 +02:00
Lennart Poettering 66032ef489 macro: introduce POINTER_MAX as define for (void*) -1
Just add a safer, prettier way to write (void*) -1, that doesn't rely on
two's complement, but uses the correct underlying C constructs.
2020-10-22 08:33:20 +09:00
williamvds 85c5d313b5
systemctl: show original contents when editing unit
A comment indicates the start of the new contents of the override file,
and another indicates that lines following it will be discarded once
editing is finished.
The contents of the unit file and drop-ins are listed out after this
last marker.

Adds WRITE_STRING_FILE_TRUNCATE to set O_TRUNC when opening a file.

Thanks to cgzones for providing the required SELinux function calls.

Co-authored-by: Christian Göttsche <cgzones@googlemail.com>
2020-10-21 21:20:01 +01:00
Jonathan Lebon 6c5496c492 units: add initrd-cryptsetup.target
For encrypted block devices that we need to unlock from the initramfs,
we currently rely on dracut shipping `cryptsetup.target`. This works,
but doesn't cover the case where the encrypted block device requires
networking (i.e. the `remote-cryptsetup.target` version). That target
however is traditionally dynamically enabled.

Instead, let's rework things here by adding a `initrd-cryptsetup.target`
specifically for initramfs encrypted block device setup. This plays the
role of both `cryptsetup.target` and `remote-cryptsetup.target` in the
initramfs.

Then, adapt `systemd-cryptsetup-generator` to hook all generated
services to this new unit when running from the initrd. This is
analogous to `systemd-fstab-generator` hooking all mounts to
`initrd-fs.target`, regardless of whether they're network-backed or not.
2020-10-21 22:08:19 +02:00
williamvds 6797a74f78
Add WRITE_STRING_FILE_TRUNCATE to set O_TRUNC 2020-10-21 17:18:25 +01:00
williamvds 82443be506
Add strv_prepend
Inserts a copy of the value at the head of the list.
2020-10-21 17:14:37 +01:00
Lennart Poettering 69f30d4321
Merge pull request #17356 from yuwata/sd-xxx-stop
network: about sd_xxx_stop()
2020-10-21 18:07:38 +02:00
Lennart Poettering d9da267f71
Merge pull request #17400 from yuwata/network-route-counter-17396
network: about route message counter
2020-10-21 18:07:12 +02:00
Chandradeep Dey 842067e675 homed: remove PAM_USER_UNKNOWN test in pam_sm_acct_mgmt
Why this change
---------------
Assumption - PAM's auth stack is properly configured.

Currently account pam_systemd_home.so returns PAM_SUCCESS for non
systemd-homed users, and a variety of return values (including
PAM_SUCCESS) for homed users.

account pam_unix returns PAM_AUTHINFO_UNAVAIL for systemd-homed
users, and a variety of return values (including PAM_AUTHINFO_UNAVAIL)
for normal users.

No possible combination in the pam stack can let us preserve the
various return values of the modules. For example, the configuration
mentioned in the manpage causes account pam_unix to never be reached
since pam_systemd_home just returns a success for ordinary users. Users
with expired passwords are allowed to log in because a check cannot be
made.

More configuration examples and why they don't work are mentioned
in #16906 and the downstream discussion linked there.

After this change
-----------------
account pam_unix will continue to return wrong value for homed users.
But we can skip the module conditionally using the return value from
account pam_systemd_home. We can already do this with the auth and
password modules.
2020-10-21 16:47:10 +02:00
Frantisek Sumsal 5310fc624e ci: add the libfido2 dependency for better coverage 2020-10-21 16:28:22 +02:00
Frantisek Sumsal 0273f6e7f2 ci: build with clang-11 as well
The LLVM nightly repositories now have a separate branch for clang-11,
so let's build with it as well.
2020-10-21 16:24:01 +02:00
Frantisek Sumsal f1150eddf6 ci: bump the 'build test' image to Ubuntu Focal 2020-10-21 16:23:59 +02:00
Arian van Putten 429495163c cgtop: Display cpu time in microseonds with --raw
this makes the CPU time easily parseable; which was the goal
of --raw in the first place.

This only triggers if --raw is combined with --cpu=time
2020-10-21 14:29:48 +02:00
Zbigniew Jędrzejewski-Szmek 9d7b11fdc8
Merge pull request #17395 from keszybz/hwdb-drop-quotes
hwdb: drop quotes from XKB_FIXED_*= properties
2020-10-21 11:34:39 +02:00
Lennart Poettering aa5502bb33
Merge pull request #16444 from oniko/luks-detached-header
Add support for detached LUKS header on kernel cmd line
2020-10-21 10:41:11 +02:00
Lennart Poettering af918c4818 test-mountpoint-util: run test in private mount namespace
This creates a private mount namespace for test-mountpint-util, with all
propagation from the host turned off. This gives us the guarantee that
/proc/self/mountinfo remains fixed and constant while we operate,
removing potential races against other unrelated stuff running on the
system that changes the mount table.

Prompted-by: #17050

(I doubt this actually fixes 17050, this is mostly to make sure that we
aren't possibly affected by such races in our test)
2020-10-21 09:18:35 +02:00
Lennart Poettering 0393e6a274
Merge pull request #17407 from keszybz/test-ipcrm
Make test-ipcrm not fail cryptically
2020-10-21 09:04:12 +02:00
Lennart Poettering 141261f127 dhcp-server: make parameter const 2020-10-21 15:02:16 +09:00
Michael Biebl 427103f7a6
Merge pull request #17297 from keszybz/tmpfiles-sysusers-disable-standalone-image
tmpfiles,sysusers: disable --image= support in standalone versions
2020-10-20 23:07:16 +02:00
Zbigniew Jędrzejewski-Szmek bb4febf4c1 test-ipcrm: modernize, skip test on permission errors
I now get:
$ build/test-ipcrm
Failed to enter shared memory directory /dev/shm/multipath: Permission denied
test-ipcrm: No privileges, skipping tests.
2020-10-20 18:06:28 +02:00
Zbigniew Jędrzejewski-Szmek aecdef08be shared/clean-ipc: improve error message a bit
Failed to enter shared memory directory multipath: Permission denied
→
Failed to enter shared memory directory /dev/shm/multipath: Permission denied

When looking at nested directories, we will print only the final two elements
of the path. That is still more useful than just the last component of the
path. To print the full path, we'd have to allocate the string, and since the
error occurs so very rarely, I think the current best-effort approach is
enough.
2020-10-20 18:06:28 +02:00
Zbigniew Jędrzejewski-Szmek 327d8f3ab8 sd-hwdb: reduce variable scope, use periods 2020-10-20 17:23:40 +02:00
Zbigniew Jędrzejewski-Szmek afe87974dd sd-hwdb: allow empty properties
So far we didn't allow empty properties, but it makes sense to do so, for
example to distinguish empty data from lack of data. It also makes it easy to
override properties (back to the empty) value for specific cases.
2020-10-20 17:12:42 +02:00
Дамјан Георгиевски c4b843473a bootctl: add @current/@oneshot/@default targets to set-default/set-oneshot
Using `bootctl set-default @current` will set the default loader entry
to the currently booted entry as read from the `LoaderEntrySelected` EFI
variable.

Also `bootctl set-oneshot @current` will set the oneshot loader entry to
the current booted entry.

Correspondingly `@default` and `@oneshot` can be used to read from the
LoaderEntryDefault and LoaderEntryOneshot EFI variables.
2020-10-20 15:02:58 +02:00
Lennart Poettering 558e5654a5
Merge pull request #17401 from mrc0mmand/sempahore-fixups
semaphore: try to use different keyservers
2020-10-20 15:01:11 +02:00
Lennart Poettering 08d3365677 update TODO 2020-10-20 14:46:55 +02:00
Frantisek Sumsal 9ac47d9261 semaphore: temporarily explicitly use the US image mirror
The UK one contains an incorrectly signed index file, causing the CI to
fail.
2020-10-20 12:39:25 +02:00
Frantisek Sumsal 493c965657 semaphore: try to use different keyservers
Recently the Semaphore CI started to fail pretty much constantly due to
GPG key verification fails. After a quick search this is a pretty common
issue with the Ubuntu keyserver in the last month. To make this,
hopefully, a bit more stable, let's use a few different keyservers in
case some of them fail.
2020-10-20 11:36:40 +02:00
Yu Watanabe fc9e3b8129 udevadm: also support alias .device units to specify devices
Previously, .device units generated by SYSTEMD_ALIAS= udev properties
are not supported to specify devices for e.g. 'udevadm info'.

Before:
```
$ udevadm info sys-subsystem-net-devices-enp0s31f6.device
Unknown device "sys-subsystem-net-devices-enp0s31f6.device": No such device
```

After:
```
$ ./udevadm info sys-subsystem-net-devices-enp0s31f6.device
P: /devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6
E: INTERFACE=enp0s31f6
E: IFINDEX=2
E: SUBSYSTEM=net
E: USEC_INITIALIZED=25317523
E: ID_NET_NAMING_SCHEME=v245
(snip)
```
2020-10-20 10:09:01 +02:00
Kai-Chuan Hsieh a5fe8447bf Add ACCEL_LOCATION property for Dell clamshell models 2020-10-20 09:13:55 +02:00
Lennart Poettering 67bd5620f6 util: make size macros unsigned
By making them unsigned comparing them with other sizes is less likely
to trigger compiler warnings regarding signed/unsigned comparisons.
After all sizes (i.e. size_t) are generally assumed to be unsigned, so
these should be too.

Prompted-by: https://github.com/systemd/systemd/pull/17345#issuecomment-709402332
2020-10-20 15:51:48 +09:00
Yu Watanabe 0c54bfd698 network: call netlink in the last of route_configure()
Otherwise, assertion will be hit when route_add() fails.
2020-10-20 15:44:24 +09:00
Zbigniew Jędrzejewski-Szmek a136c2cdd8 hwdb: drop quotes from XKB_FIXED_*= properties
The properties are not unquoted by udev, so the quotes effectively became part
of the value.

Even though those properties were added quite a while ago
(086c001e29,
d7d31692bf), they never started being used
(because of issues with having multiple layouts), see
https://gitlab.gnome.org/GNOME/mutter/-/issues/906,
https://bugzilla.gnome.org/show_bug.cgi?id=775681.

Let's remove the quotes while we still can.

From https://bugzilla.gnome.org/show_bug.cgi?id=775681#c7:
> Note to self: the values for XKB_FIXED_LAYOUT and XKB_FIXED_VARIANT are
> quoted, meaning that we need to remove the quotes before passing the values
> from udev_device_get_property_value() to xkb_keymap_new_from_names()
> otherwise the compilation of the keymap fails (please don't ask how I found
> out...)
2020-10-20 08:37:07 +02:00
Yu Watanabe 40075951dc network: also compare and hash weight of the gateway 2020-10-20 15:32:55 +09:00
Yu Watanabe cc17f75f66 network: copy multipath route element earlier
`route_get()` compares input with existing routes, however previously,
the input may did not have information about gateway. So, the
comparison result might be incorrect, and the foregoing set_put() might
return -EEXIST.
2020-10-20 15:32:55 +09:00
Yu Watanabe 8c212f76c2 network: make route_configure() return 0 on success
Previously, route_configure() always returns 1 on success, and never
returns 0. It is not necessary to return positive value.
2020-10-20 14:20:22 +09:00
Yu Watanabe 0ce8a9d6e5
Merge pull request #16939 from Rahix/robust-first-boot-machine-id
Make ConditionFirstBoot safe against power failures
2020-10-20 14:01:41 +09:00
Yu Watanabe 1586d324bd
Merge pull request #17352 from msekletar/ens-names-fix
udev/net_id: don't generate slot based names if multiple devices might claim the same slot
2020-10-20 13:49:29 +09:00
Felix Riemann 1eee15c388 update-done: Do not fail with read-only /etc or /var
With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.
2020-10-20 13:46:36 +09:00
Yu Watanabe 4b28e50f9e
Merge pull request #17390 from keszybz/logind-notifications-and-links
Fix sd_notify() usage in various daemons and update some documentation links
2020-10-20 13:44:52 +09:00
Michal Sekletár 2c8ec0095e udev/net_id: don't generate slot based names if multiple devices might claim the same slot 2020-10-19 17:55:44 +02:00