Commit Graph
34349 Commits
Author SHA1 Message Date
Yu Watanabe 7a7d2f16c2 tree-wide: fix typo 2021-03-02 09:48:20 +01:00
Yu Watanabe dbc3cf009a Merge pull request #18832 from keszybz/resolved-stop-sources
Always stop sd-event sources in resolved when unreffing them
2021-03-02 14:15:18 +09:00
Lennart Poettering 62e10065d0 fs-util: use ERRNO_IS_NOT_SUPPORTED() at two more places where we can't be sure of the backing implementation 2021-03-02 13:16:22 +09:00
Lennart Poettering 674b04ff1b btrfs-util: add helper that abstracts "might be btrfs subvol?" check
Let#s not hardcode inode nr 256 everywhere, but abstract this check
slightly.
2021-03-02 13:11:37 +09:00
Lennart Poettering 35f4b6d8ba test-signal-util: add test for signal_is_blocked() 2021-03-02 12:41:39 +09:00
Zbigniew Jędrzejewski-Szmek 9793530228 resolved: disable event sources before unreffing them
We generally operate on the assumption that a source is "gone" as soon
as we unref it. This is generally true because we have the only reference.
But if something else holds the reference, our unref doesn't really stop
the source and it could fire again.

In particular, on_query_timeout() is called with DnsQuery* as userdata, and
it calls dns_query_stop() which invalidates that pointer. If it was ever
called again, we'd be accessing already-freed memory.

I don't see what would hold the reference. sd-event takes a temporary reference,
but on the sd_event object, not on the individual sources. And our sources
are non-floating, so there is no reference from the sd_event object to the
sources.

For #18427.
2021-03-01 23:12:51 +01:00
Zbigniew Jędrzejewski-Szmek f2ec080ef2 resolved: unref event object after the sources
It shouldn't matter because of all the refcounting, but it looks unclean.
2021-03-01 23:12:51 +01:00
Zbigniew Jędrzejewski-Szmek cd18afec16 Merge pull request #18827 from keszybz/a-bunch-of-man-page-updates
A bunch of man page updates
2021-03-01 15:14:40 +01:00
Zbigniew Jędrzejewski-Szmek 969524fae2 basic/log: align tables 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek 3a559f22c3 coredump: indent comment 2021-03-01 13:40:52 +01:00
Zbigniew Jędrzejewski-Szmek bfc2274db7 test-socket-util: fix test for address parsing w/o IPv6 support
sockaddr_pretty() is the function that is ultimately called to print
the address, and afaics, it'll always use 0.0.0.0 if family==AF_INET.
So the test must have always been broken on systems with IPv6 support.

Fixes a failure in semaphore debian autopkgtest ci:
"65535" → ✓ 0 → "0.0.0.0:65535" (expect 0 / "[::]:65535") 15:15
Assertion 'streq(out, expected ?: in)' failed at src/test/test-socket-netlink.c:32, function test_socket_address_parse_one(). Aborting. 15:15
2021-03-01 11:27:03 +01:00
Zbigniew Jędrzejewski-Szmek 7966a91690 core: change confusing parameter name
fixup_output() is used for both stdout and stderr.
2021-03-01 11:26:52 +01:00
Einsler Lee aa10a8a37a remove the default value of CPUAffinity
"1 2" is not the default value systemd used to set CPUAffinity. Let's remove it to avoid confusing users.
2021-03-01 11:12:30 +01:00
Luca Boccassi b33cd6b3ee core: do not set noexec on sysfs/procfs
It causes a regression in certain running environments (networkd under LXC),
so avoid enabling for now.

Fixes #18795

Suggested-by: Topi Miettinen <toiwoton@gmail.com>
2021-02-26 20:20:53 +00:00
Lennart Poettering ee1aa61c47 copy: handle copy_file_range() weirdness on procfs/sysfs
This addresses the issue described in https://lwn.net/Articles/846403/
and makes sure we will be able to stream bytes from procfs/sysfs via
copy_bytes() if people ask us to.
2021-02-26 18:38:22 +01:00
Lennart Poettering 97e535c724 udev: when btrfs.ko is not available consider btrfs filesystems not ready
Let's add a special tweak to the btrfs builtin: if /dev/btrfs-control is
not there, let's consider all btrfs file systems as SYSTEMD_READY=0.
This is useful in initrds, where btrfs.ko might be missing. After the
initrd → host transition we can then retigger the device and undo the
SYSTEMD_READY=0 marking.
2021-02-26 14:27:49 +01:00
Lennart Poettering 16e6a7010f Merge pull request #18804 from poettering/epoll-wait2
sd-event: make use of kernel 5.11 epoll_pwait2() if available
2021-02-26 14:27:27 +01:00
Anita Zhang 7c382f0b7d json: rename json_dispatch_{integer,unsigned} -> json_dispatch_{intmax,uintmax}
Prompted by https://bugzilla.redhat.com/show_bug.cgi?id=1930875 in which
I had previously used json_dispatch_unsigned and passed a return variable of
type unsigned when json_dispatch_unsigned writes a uintmax_t.
2021-02-26 10:14:03 +00:00
Lennart Poettering 42d7904284 Merge pull request #18801 from keszybz/small-documentation-updates
Small documentation updates
2021-02-26 09:36:11 +01:00
Lennart Poettering 798445ab84 sd-event: make use of epoll_pwait2() for greater time accuracy 2021-02-26 09:22:09 +01:00
Lennart Poettering 420297c9e1 missing_syscall: add epoll_pwait2() wrapper 2021-02-26 09:21:51 +01:00
Luca Boccassi 8b2620ea8c Merge pull request #18797 from keszybz/trivial-cleanups
Trivial cleanups
2021-02-25 22:20:04 +00:00
Zbigniew Jędrzejewski-Szmek 403db47069 timesync: rename variable to match config name
PollIntervalMinSec and PollIntervalMaxSec use the same pattern, but
RootDistanceMaxSec had switched orderd in the code.
2021-02-25 21:14:04 +01:00
Zbigniew Jędrzejewski-Szmek 0025868cc9 libudev: fix typo in docstring 2021-02-25 14:07:21 +01:00
Zbigniew Jędrzejewski-Szmek 67f63ee5ae shared/dissect-image: inline iterator variables 2021-02-25 14:07:21 +01:00
Zbigniew Jędrzejewski-Szmek 8794e6dbbd core/namespace: inline more iterator variable declarations 2021-02-25 14:07:21 +01:00
Zbigniew Jędrzejewski-Szmek 06cd836342 resolved: inline trivial function 2021-02-25 14:07:21 +01:00
Lennart Poettering de4abc3f46 bus-unit-util: generate proper log message when we fail to parse properties 2021-02-25 13:38:20 +01:00
Lennart Poettering 2a7865cc43 bus-unit-util: don't validate partition designator client side
When we parse properties set via "systemctl set-property" we should
validate to the point where the data we pass over the bus makes rough
sense, but we shouldn't needlessly check whether specified enum values
are among the known enum values. The server side checks that anyway
again, and it's kinda nice if an older systemctl can be used to talk to
a newer systemd.
2021-02-25 13:36:43 +01:00
Lennart Poettering d60e3b405d namespace: return correct error code 2021-02-25 13:36:32 +01:00
Lennart Poettering 33d31c0e60 env-util: fix parameter handling of parse_env_extension_hierarchies() + getenv_path_list()
Our coding style dictates we should not clobber return parameters on
failure, and always initialize them on success. Do so here.

This changes getenv_path_list() to return ENXIO if the env var is not
set, which is similar to how we handle this in getenv_bool().

This drops debug logging from parse_env_extension_hierarchies(), since
it's done anyway in getenv_path_list()

Follow-up for: #18018
2021-02-25 13:24:53 +01:00
Lennart Poettering 9c274488a9 signal-util: make -1 termination of ignore_signals() argument list unnecessary
Clean up ignore_signals() + default_signals() + sigaction_many() a bit:
make it unnecessary to explicitly terminate the signal list with -1.
Merge all three calls into a single function that is just called with
slightly different parameters. And eliminate an unnecessary extra
iteration in its inner for() loop.

No change in behaviour.
2021-02-25 11:32:28 +01:00
Zbigniew Jędrzejewski-Szmek 155d626bc6 Merge pull request #18018 from bluca/mount_images_overlay
Add ExtensionImages directive to form overlays
2021-02-25 11:31:14 +01:00
Dan Streetman b66789a9b5 test: skip tests if cgroup isn't mounted
Debian builds in a chroot without cgroup mounted, so tests expecting
to access cgroup will fail with ENOMEDIUM, so skip the tests in that
situation.
2021-02-25 16:32:04 +09:00
Lennart Poettering a437c5e4da cgroup: don't generate BPF firewall unsupported warning on wrong unit
Let's generate the warning on a unit that actually needs the BPF
firewall, and not confusingly already for a sibling of one.
2021-02-25 16:31:46 +09:00
Lennart Poettering 249a967f62 format-table: don't suppress trailing whitespace in first line
We underline the first line, hence we shouldn't suppress the whitespace,
otherwise the line will end early.

Follow-up for: 71894e1831
2021-02-25 16:31:25 +09:00
Joerg Behrmann fa02711758 treewide: fix spelling 2021-02-25 05:54:11 +09:00
Annika Wickert c0267a592a network: Implement B.A.T.M.A.N. Advanced interface type 2021-02-25 01:57:29 +09:00
Sergey Bugaev 2aaf376597 resolved: don't discard mDNS queries with bad flags
Even though RFC 6762 specifies these bits MUST be zero, it also says they MUST
be ignored on reception.
2021-02-24 17:17:03 +01:00
Sergey Bugaev 7675501540 resolved: don't discard mDNS packets with ip6.arpa RRs
ip6.arpa is also a valid domain name to put in mDNS packets.
2021-02-24 17:17:03 +01:00
Yu Watanabe 2be6c4758e timedate: do not ignore fix_system argument in SetLocalRTC method
Fixes #18391.
2021-02-24 23:50:21 +09:00
Yu Watanabe b34b57a738 clock-util: rename function argument 2021-02-24 19:56:14 +09:00
Zbigniew Jędrzejewski-Szmek d9a65c5976 Merge pull request #18730 from yuwata/dhcp6-client-do-not-set-t1-t2-18090
dhcp6: do not set T1 and T2 in IA_PD option or friends
2021-02-24 09:53:37 +01:00
Yu Watanabe ebc98027fc Merge pull request #18589 from yuwata/network-nexthop-drop-unnecessary-nexthops
network: drop unnecessary nexthops
2021-02-24 09:07:57 +09:00
Lennart Poettering eceb61112c bootspec: assume that the root dir is at the top of its file system
Fixes: #17746
2021-02-23 18:43:34 +01:00
Zbigniew Jędrzejewski-Szmek 0892c3b2eb Merge pull request #18763 from poettering/cov-fixes
A bunch of coverity fixes
2021-02-23 18:41:53 +01:00
Luca Boccassi 93f597013a Add ExtensionImages directive to form overlays
Add support for overlaying images for services on top of their
root fs, using a read-only overlay.
2021-02-23 15:34:46 +00:00
Luca Boccassi 82fb2da213 core/namespace: reafactor applying mounts in a separate function
The setup_namespace code to apply mounts is a big if block that
keeps growing, so refactor it in a separate function.
2021-02-23 15:34:46 +00:00
Luca Boccassi 280b3781bd sysext: split parsing SYSTEMD_SYSEXT_HIERARCHIES in a common helper 2021-02-23 15:34:46 +00:00
Lennart Poettering 685097b9ca efi stub: accept it if our loaded image has no FilePath field set
The firmware spec doesn't really say whether FilePath of the LoadedImage
protocol may be NULL or not. So far we assumed it to be non-NULL, but
apparently the FreeBSD UEFI chainloader sets it to NULL. Handle this
gracefully.

(Noticed and tracked down by Alexander Schreiber)

Fixes: #18733
2021-02-23 15:48:48 +01:00