]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #17228 from bluca/bind_path_runtime
Luca Boccassi [Mon, 18 Jan 2021 21:22:57 +0000 (21:22 +0000)] 
Merge pull request #17228 from bluca/bind_path_runtime

core: add systemctl and DBUS method to bind mount new paths without service restart

3 years agoresolved: fix use-after-free with queries hitting the cache
Zbigniew Jędrzejewski-Szmek [Sun, 17 Jan 2021 18:51:28 +0000 (19:51 +0100)] 
resolved: fix use-after-free with queries hitting the cache

When dns_transaction_complete() manages to resolve a query, it invalidates the
query candidate object. It shall not be accessed afterwards.

We have the following chain of calls:
dns_query_candidate_go → dns_transaction_go → dns_transaction_prepare → dns_cache_lookup (success: 1)
                                                                      → dns_transaction_complete
After returning back to dns_query_candidate_go(), we'd attempt to continue
iteration over the list of transactions attached to the query candidate,
accessing already freed (and overwritten) memory:

(gdb) bt
0  0x00007f637297cf47 in hashmap_iterate_entry (i=0x7ffe7e15cc90, h=0x706f746b73656465) at ../src/basic/hashmap.c:703
1  _hashmap_iterate (h=0x706f746b73656465, i=i@entry=0x7ffe7e15cc90, value=value@entry=0x7ffe7e15cc88,
    key=key@entry=0x0) at ../src/basic/hashmap.c:712
2  0x00007f637297d01b in set_iterate (s=<optimized out>, i=i@entry=0x7ffe7e15cc90, value=value@entry=0x7ffe7e15cc88)
    at ../src/basic/hashmap.c:733
hence we crash

3  0x0000557bc99eb80f in dns_query_candidate_go (c=c@entry=0x557bcaf86890) at ../src/resolve/resolved-dns-query.c:139
...but c is not valid here in the second iteration of the loop

4  0x0000557bc99eb720 in dns_query_candidate_notify (c=0x557bcaf86890) at ../src/resolve/resolved-dns-query.c:271
c was valid here at entry...

5  0x0000557bc99efe28 in dns_transaction_complete (t=0x557bcac072f0, state=<optimized out>)
    at ../src/resolve/resolved-dns-transaction.c:350
t is a valid transaction (11481 in the backtrace below)

6  0x0000557bc99f1efb in dns_transaction_process_reply (t=0x557bcac072f0, p=<optimized out>)
    at ../src/resolve/resolved-dns-transaction.c:1171
7  0x0000557bc99f2d41 in on_dns_packet (s=<optimized out>, fd=<optimized out>, revents=<optimized out>,
    userdata=0x557bcac072f0) at ../src/resolve/resolved-dns-transaction.c:1223
8  0x00007f6372a25217 in source_dispatch (s=s@entry=0x557bcb162c50) at ../src/libsystemd/sd-event/sd-event.c:3181
9  0x00007f6372a254fd in sd_event_dispatch (e=0x557bcb15b050) at ../src/libsystemd/sd-event/sd-event.c:3620
10 0x00007f6372a267c8 in sd_event_run (e=e@entry=0x557bcb15b050, timeout=timeout@entry=18446744073709551615)
    at ../src/libsystemd/sd-event/sd-event.c:3678
11 0x00007f6372a269ef in sd_event_loop (e=0x557bcb15b050) at ../src/libsystemd/sd-event/sd-event.c:3700
12 0x0000557bc99ddc14 in run (argc=<optimized out>, argv=<optimized out>) at ../src/resolve/resolved.c:92
13 0x0000557bc99d260a in main (argc=<optimized out>, argv=<optimized out>) at ../src/resolve/resolved.c:99

xxx.name.net systemd-resolved[31705]: Got message type=method_call sender=:1.3644 destination=org.freedesktop.resolve1 path=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 signature=isit error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: idn2_lookup_u8: xxx → xxx
xxx.name.net systemd-resolved[31705]: Looking up RR for xxx IN A.
xxx.name.net systemd-resolved[31705]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=1102 reply_cookie=0 signature=s error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=1103 reply_cookie=0 signature=s error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.3324 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=1103 signature=s error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Cache miss for xxx.name.net IN A
xxx.name.net systemd-resolved[31705]: Transaction 11481 for <xxx.name.net IN A> scope dns on enp42s0/*.
xxx.name.net systemd-resolved[31705]: Using feature level UDP for transaction 11481.
xxx.name.net systemd-resolved[31705]: Using DNS server 192.168.1.1 for transaction 11481.
xxx.name.net systemd-resolved[31705]: Sending query packet with id 11481 of size 35.
xxx.name.net systemd-resolved[31705]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.3324 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=1102 signature= error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Match type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.3644' successfully installed.
xxx.name.net systemd-resolved[31705]: Processing incoming packet on transaction 11481 (rcode=NXDOMAIN).
xxx.name.net systemd-resolved[31705]: Not caching negative entry without a SOA record: xxx.name.net IN A
xxx.name.net systemd-resolved[31705]: Transaction 11481 for <xxx.name.net IN A> on scope dns on enp42s0/* now complete with <rcode-failure> from network (unsigned).
xxx.name.net systemd-resolved[31705]: Positive cache hit for xxx.lan IN A
xxx.name.net systemd-resolved[31705]: Transaction 64364 for <xxx.lan IN A> on scope dns on enp42s0/* now complete with <success> from cache (unsigned).
xxx.name.net systemd-resolved[31705]: Sent message type=method_return sender=n/a destination=:1.3644 path=n/a interface=n/a member=n/a cookie=1104 reply_cookie=2 signature=a(iiay)st error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=1105 reply_cookie=0 signature=s error-name=n/a error-message=n/a
xxx.name.net systemd-resolved[31705]: Freeing transaction 64364.
xxx.name.net systemd[1]: systemd-resolved.service: Main process exited, code=dumped, status=11/SEGV
xxx.name.net systemd[1]: systemd-resolved.service: Failed with result 'core-dump'.

Fixes #16168, https://bugzilla.redhat.com/show_bug.cgi?id=1895937.

3 years agoupdate TODO
Lennart Poettering [Mon, 18 Jan 2021 20:05:32 +0000 (21:05 +0100)] 
update TODO

3 years agotest: run strace with -f and copy log out 17228/head
Luca Boccassi [Thu, 14 Jan 2021 22:11:14 +0000 (22:11 +0000)] 
test: run strace with -f and copy log out

3 years agotest: skip missing optional libraries in image install
Luca Boccassi [Thu, 14 Jan 2021 16:48:13 +0000 (16:48 +0000)] 
test: skip missing optional libraries in image install

Not all optional libraries might be available on developers machines,
so log and skip.
Also some pkg-config files are broken (eg: tss2 on Debian Stable) so
skip if the required variables are missing, and improve logs.

3 years agocore: add DBUS method to bind mount new nodes without service restart
Luca Boccassi [Thu, 30 Jul 2020 18:37:10 +0000 (19:37 +0100)] 
core: add DBUS method to bind mount new nodes without service restart

Allow to setup new bind mounts for a service at runtime (via either
DBUS or a new 'systemctl bind' verb) with a new helper that forks into
the unit's mount namespace.
Add a new integration test to cover this.

Useful for zero-downtime addition to services that are running inside
mount namespaces, especially when using RootImage/RootDirectory.

If a service runs with a read-only root, a tmpfs is added on /run
to ensure we can create the airlock directory for incoming mounts
under /run/host/incoming.

3 years agoMountAPIVFS: always mount a tmpfs on /run
Luca Boccassi [Fri, 18 Dec 2020 16:16:46 +0000 (16:16 +0000)] 
MountAPIVFS: always mount a tmpfs on /run

We need a writable /run for most operations, but in case a read-only
RootImage (or similar) is used, by default there's no additional
tmpfs mount on /run. Change this behaviour and document it.

3 years agomachine: use file descriptor when chasing bind mount sources
Luca Boccassi [Fri, 15 Jan 2021 15:50:45 +0000 (15:50 +0000)] 
machine: use file descriptor when chasing bind mount sources

Allows to always operate on pinned inodes, rather than paths, so that
races are less likely

3 years agomachine: enter target PID namespace when adding a live mount
Luca Boccassi [Wed, 13 Jan 2021 23:52:00 +0000 (23:52 +0000)] 
machine: enter target PID namespace when adding a live mount

machinectl fails since 21935150a0c42b91a322105f6a9129116bfc8e2e as it's now
mounting onto a file descriptor in a target namespace, without joining the
target's PID namespace.
Note that it's not enough to setns CLONE_NEWPID, but a double-fork is required
as well, as implemented by namespace_fork().

Add a test case to TEST-13-NSPAWN to cover this use case.

3 years agoshared/mount-util: use namespace_fork utils
Luca Boccassi [Thu, 13 Aug 2020 13:47:01 +0000 (14:47 +0100)] 
shared/mount-util: use namespace_fork utils

3 years agomachine: adjust error message to use 'normalized' instead of ../
Luca Boccassi [Tue, 15 Dec 2020 18:26:34 +0000 (18:26 +0000)] 
machine: adjust error message to use 'normalized' instead of ../

3 years agomachine/basic: factor out helper function to add airlocked mount to namespace
Luca Boccassi [Thu, 13 Aug 2020 13:01:34 +0000 (14:01 +0100)] 
machine/basic: factor out helper function to add airlocked mount to namespace

3 years agohwdb: Add Logitech MX 518 Legendary mouse
moson-mo [Mon, 18 Jan 2021 14:29:22 +0000 (15:29 +0100)] 
hwdb: Add Logitech MX 518 Legendary mouse

Add Logitech MX 518 Legendary model to hwdb.

3 years agoMerge pull request #18289 from yuwata/core-load-fragment-cleanups
Zbigniew Jędrzejewski-Szmek [Mon, 18 Jan 2021 15:48:44 +0000 (16:48 +0100)] 
Merge pull request #18289 from yuwata/core-load-fragment-cleanups

pid1: several cleanups for conf parsers

3 years agonetwork: address-pool: also check conflicts with foreign addresses
Yu Watanabe [Sun, 17 Jan 2021 15:44:14 +0000 (00:44 +0900)] 
network: address-pool: also check conflicts with foreign addresses

Fixes CI issue found in
https://github.com/systemd/systemd-centos-ci/pull/334.

3 years agohwdb: Add NEWYES 10" LCD writing tablet (#18274)
Jonathan McDowell [Sun, 17 Jan 2021 22:39:07 +0000 (22:39 +0000)] 
hwdb: Add NEWYES 10" LCD writing tablet (#18274)

3 years agocore: add logs when credential value is duplicated 18289/head
Yu Watanabe [Sun, 17 Jan 2021 16:32:49 +0000 (01:32 +0900)] 
core: add logs when credential value is duplicated

3 years agocore: make config_parse_documentation() explicitly return 0 on success
Yu Watanabe [Sun, 17 Jan 2021 16:27:14 +0000 (01:27 +0900)] 
core: make config_parse_documentation() explicitly return 0 on success

3 years agocore: add missing log_oom()
Yu Watanabe [Sun, 17 Jan 2021 16:24:10 +0000 (01:24 +0900)] 
core: add missing log_oom()

3 years agocore: do not fail when an invalid cpu affinity is specified
Yu Watanabe [Sun, 17 Jan 2021 16:22:39 +0000 (01:22 +0900)] 
core: do not fail when an invalid cpu affinity is specified

3 years agoMerge pull request #18286 from ssahani/net-1
Yu Watanabe [Sun, 17 Jan 2021 16:18:17 +0000 (01:18 +0900)] 
Merge pull request #18286 from ssahani/net-1

tree-wide: more use of hashmap_ensure_put() and TAKE_PTR()

3 years agosystemctl: use right type 'size_t' for counting memory
Lennart Poettering [Sun, 17 Jan 2021 13:43:17 +0000 (14:43 +0100)] 
systemctl: use right type 'size_t' for counting memory

Follow-up for e363b0e4fc4f32225034a11dd53c0cc68747ba6e

(Mostly a theoretical fix. On 64bit systems unsigned is 32bit, and we
had more than 2^32 units thing would fall apart here.)

3 years agonetwork: tc use TAKE_PTR
Susant Sahani [Sun, 17 Jan 2021 10:14:15 +0000 (11:14 +0100)] 
network: tc use TAKE_PTR

3 years agoudevadm-monitor: use TAKE_PTR 18286/head
Susant Sahani [Sun, 17 Jan 2021 09:31:30 +0000 (10:31 +0100)] 
udevadm-monitor: use TAKE_PTR

3 years agoudevadm-monitor: Use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:30:06 +0000 (10:30 +0100)] 
udevadm-monitor: Use hashmap_ensure_put

3 years agoudev-rules: Use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:28:15 +0000 (10:28 +0100)] 
udev-rules: Use hashmap_ensure_put

3 years agoresolved-dnssd: Use TAKE_PTR
Susant Sahani [Sun, 17 Jan 2021 09:24:29 +0000 (10:24 +0100)] 
resolved-dnssd: Use TAKE_PTR

3 years agoresolved-dnssd: Use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:23:04 +0000 (10:23 +0100)] 
resolved-dnssd: Use hashmap_ensure_put

3 years agoresolved-dns-packet: Use TAKE_PTR
Susant Sahani [Sun, 17 Jan 2021 09:20:22 +0000 (10:20 +0100)] 
resolved-dns-packet: Use TAKE_PTR

3 years agoresolved-dns-packet: Use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:19:21 +0000 (10:19 +0100)] 
resolved-dns-packet: Use hashmap_ensure_put

3 years agoresolved-bus: Use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:14:25 +0000 (10:14 +0100)] 
resolved-bus: Use hashmap_ensure_put

3 years agojournal-remote: use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 09:02:17 +0000 (10:02 +0100)] 
journal-remote: use hashmap_ensure_put

3 years agocore: load fragment - use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 08:55:00 +0000 (09:55 +0100)] 
core: load fragment - use hashmap_ensure_put

3 years agocore: job - use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 13:24:36 +0000 (14:24 +0100)] 
core: job - use hashmap_ensure_put

3 years agobasic: drop unused module
Yu Watanabe [Sun, 17 Jan 2021 07:15:52 +0000 (16:15 +0900)] 
basic: drop unused module

Follow-up for 35b42e560039fd87d4ae4d99cd54d1d4e89710b1.

3 years agoMerge pull request #18284 from ssahani/net-7
Yu Watanabe [Sun, 17 Jan 2021 11:08:59 +0000 (20:08 +0900)] 
Merge pull request #18284 from ssahani/net-7

Tree wide tighten variable scope used in loop

3 years agonetwork: Use ordered_hashmap_ensure_put (#18233)
Susant Sahani [Sun, 17 Jan 2021 11:07:02 +0000 (12:07 +0100)] 
network: Use ordered_hashmap_ensure_put (#18233)

3 years agoMerge pull request #18230 from ssahani/macvlan-bcqueuelen
Yu Watanabe [Sun, 17 Jan 2021 11:05:22 +0000 (20:05 +0900)] 
Merge pull request #18230 from ssahani/macvlan-bcqueuelen

 network: macvlan - add support to configure rx queue for broadcast / multicast

3 years agoMerge pull request #17576 from gportay/veritysetup-add-support-for-dm-verity-flags
Lennart Poettering [Sun, 17 Jan 2021 10:18:25 +0000 (11:18 +0100)] 
Merge pull request #17576 from gportay/veritysetup-add-support-for-dm-verity-flags

veritysetup: add support for veritytab

3 years agocore: dbus - use hashmap_ensure_put
Susant Sahani [Sun, 17 Jan 2021 08:49:14 +0000 (09:49 +0100)] 
core: dbus - use hashmap_ensure_put

3 years agonetwork: macvlan - add support to configure rx queue for broadcast/multicast 18230/head
Susant Sahani [Sun, 17 Jan 2021 07:39:28 +0000 (08:39 +0100)] 
network: macvlan - add support to configure rx queue for broadcast/multicast

3 years agojournal: journal-file - tighten variable scope used in loop 18284/head
Susant Sahani [Sat, 16 Jan 2021 18:38:06 +0000 (19:38 +0100)] 
journal: journal-file - tighten variable scope used in loop

3 years agomachine: machined-dbus - tighten variable scope used in loop
Susant Sahani [Sat, 16 Jan 2021 18:26:24 +0000 (19:26 +0100)] 
machine: machined-dbus - tighten variable scope used in loop

3 years agotree-wide: fix typo
Yu Watanabe [Sun, 17 Jan 2021 06:43:14 +0000 (15:43 +0900)] 
tree-wide: fix typo

3 years agoMerge pull request #18243 from ssahani/ensure-put-use
Yu Watanabe [Sun, 17 Jan 2021 06:39:41 +0000 (15:39 +0900)] 
Merge pull request #18243 from ssahani/ensure-put-use

tree-wide: introduce hashmap_ensure_put() and use it

3 years agoMerge pull request #18261 from ssahani/net2
Yu Watanabe [Sun, 17 Jan 2021 06:39:01 +0000 (15:39 +0900)] 
Merge pull request #18261 from ssahani/net2

network: modernize routing policy rule and add 0 validation where needed

3 years agonetwork: tighten variable scope used in loop (#18277)
Susant Sahani [Sun, 17 Jan 2021 06:38:33 +0000 (07:38 +0100)] 
network: tighten variable scope used in loop (#18277)

3 years agoman: clarify what network scopes are
Adam Nielsen [Sun, 17 Jan 2021 01:10:57 +0000 (11:10 +1000)] 
man: clarify what network scopes are

3 years agonetwork: nexthop - use hashmap_ensure_put 18243/head
Susant Sahani [Thu, 14 Jan 2021 06:22:49 +0000 (07:22 +0100)] 
network: nexthop - use hashmap_ensure_put

3 years agonetwork: use hashmap_ensure_put
Susant Sahani [Sat, 16 Jan 2021 22:10:18 +0000 (23:10 +0100)] 
network: use hashmap_ensure_put

3 years agonetwork: routing-policy-rule - TAKE_PTR 18261/head
Susant Sahani [Fri, 15 Jan 2021 17:07:28 +0000 (18:07 +0100)] 
network: routing-policy-rule - TAKE_PTR

3 years agonetwork: route - add a zero verification for tcp window
Susant Sahani [Fri, 15 Jan 2021 16:49:16 +0000 (17:49 +0100)] 
network: route - add a zero verification for tcp window

3 years ago network: tc - use TAKE_PTR (#18266)
Susant Sahani [Sat, 16 Jan 2021 21:08:36 +0000 (22:08 +0100)] 
 network: tc - use TAKE_PTR (#18266)

* network: tc cake - use TAKE_PTR

* network: tc htb - use TAKE_PTR

* network: tc pie - use TAKE_PTR

* network: tc netem - use TAKE_PTR

* network: tc hhf - use TAKE_PTR

* network: tc gred - use TAKE_PTR

* network: tc fq codel - use TAKE_PTR

* network: tc fifo - use TAKE_PTR

* network: tc drr - use TAKE_PTR

* network: tc qdisc - use TAKE_PTR

3 years agoMerge pull request #18263 from keszybz/syscalls-auto
Zbigniew Jędrzejewski-Szmek [Sat, 16 Jan 2021 16:21:34 +0000 (17:21 +0100)] 
Merge pull request #18263 from keszybz/syscalls-auto

Generate missing syscalls headers programatically

3 years agoMerge pull request #18264 from ssahani/net3
Luca Boccassi [Sat, 16 Jan 2021 12:16:43 +0000 (12:16 +0000)] 
Merge pull request #18264 from ssahani/net3

network: Use TAKE_PTR

3 years agoMerge pull request #18268 from ssahani/net5
Luca Boccassi [Sat, 16 Jan 2021 12:13:14 +0000 (12:13 +0000)] 
Merge pull request #18268 from ssahani/net5

network: tighten variable scope used in loop

3 years agonetwork: manager tighten variable scope used in loop
Susant Sahani [Fri, 15 Jan 2021 16:38:00 +0000 (17:38 +0100)] 
network: manager tighten variable scope used in loop

3 years agonetwork: route - use ordered_set_ensure_put
Susant Sahani [Thu, 14 Jan 2021 11:58:58 +0000 (12:58 +0100)] 
network: route - use ordered_set_ensure_put

3 years agonetwork: address label - use TAKE_PTR 18264/head
Susant Sahani [Fri, 15 Jan 2021 18:00:13 +0000 (19:00 +0100)] 
network: address label - use TAKE_PTR

3 years agonetwork: mdb - use TAKE_PTR
Susant Sahani [Fri, 15 Jan 2021 17:57:11 +0000 (18:57 +0100)] 
network: mdb - use TAKE_PTR

3 years agonetworkctl: tighten variable scope used in loop 18268/head
Susant Sahani [Fri, 15 Jan 2021 19:34:53 +0000 (20:34 +0100)] 
networkctl: tighten variable scope used in loop

3 years agomkosi: Allow setting version-tag option via VERSION_TAG env variable
Daan De Meyer [Fri, 15 Jan 2021 19:51:42 +0000 (20:51 +0100)] 
mkosi: Allow setting version-tag option via VERSION_TAG env variable

With https://github.com/systemd/mkosi/pull/630, we can set environment
variables for the build script in mkosi. Let's modify the build script
so we can set the version-tag option via an environment variable of the
same name. The default is the empty string which causes meson to fall
back to the default behavior (git version).

3 years agoci: bump the Semaphore CI badge to the v2 instance
Frantisek Sumsal [Fri, 15 Jan 2021 19:50:47 +0000 (20:50 +0100)] 
ci: bump the Semaphore CI badge to the v2 instance

3 years agorpm: expose $systemd_util_dir also as rpm macro
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 09:31:00 +0000 (10:31 +0100)] 
rpm: expose $systemd_util_dir also as rpm macro

This variable (a.k.a. rootlibexecdir), was exposed through the .pc file, but
not as rpm macro.

The .pc file must be located in the package that provides libraries, which
pulls in a lot of dependencies. In Fedora, the macros are split out to a
separate package so that other packages which need to refer to some systemd
path but don't otherwise require it, can only pull in the (much smaller and
dependency-less) macros package. zram-generator uses the path to specify the
location of systemd-makefs, so by using the rpm macro we'll be able to use
a much smaller buildroot.

3 years agonetwork: macsec - tighten variable scope used in loop
Susant Sahani [Fri, 15 Jan 2021 19:30:04 +0000 (20:30 +0100)] 
network: macsec - tighten variable scope used in loop

3 years agonetwork: generator tighten variable scope used in loop
Susant Sahani [Fri, 15 Jan 2021 19:26:25 +0000 (20:26 +0100)] 
network: generator tighten variable scope used in loop

3 years agoci: migrate to Semaphore CI 2.0
Frantisek Sumsal [Fri, 15 Jan 2021 17:04:47 +0000 (18:04 +0100)] 
ci: migrate to Semaphore CI 2.0

3 years agofs-util: make laccess() macro follow our usual error propagation
Lennart Poettering [Fri, 15 Jan 2021 13:54:11 +0000 (14:54 +0100)] 
fs-util: make laccess() macro follow our usual error propagation

Functions defined by us are supposed to return negative errno-style
errors on errors. laccess() is for access() what lstat() is for stat(),
but defined by us as a macro. This led to some confusion regarding error
handling.

Let's return a negative errno code just in case. This means callers can
it use either way: like access(), i.e. checking for a negative return
value + looking at errno, or like our own code, i.e. using the negative
errno code it returns.

3 years agomeson: Use configure_file when version-tag is specified
Daan De Meyer [Sun, 10 Jan 2021 12:18:36 +0000 (13:18 +0100)] 
meson: Use configure_file when version-tag is specified

vcs_tag() is slow. When the version-tag meson option is set,
we can use configure_file() directly to speed up incremental
builds.

Before (with version-tag set to v247):

```
‣ Running build script...
[1/418] Generating version.h with a custom command

real    0m0.521s
user    0m0.229s
sys     0m0.067s
```

After (with version-tag set to v247):

```
‣ Running build script...
ninja: no work to do.

real    0m0.094s
user    0m0.048s
sys     0m0.022s
```

3 years agonetwork: nexthop - use TAKE_PTR
Susant Sahani [Fri, 15 Jan 2021 17:55:17 +0000 (18:55 +0100)] 
network: nexthop - use TAKE_PTR

3 years agosrc/basic: generate missing syscall headers programatically 18263/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 16:06:19 +0000 (17:06 +0100)] 
src/basic: generate missing syscall headers programatically

Getting the numbers right for all architectures has proven to be a
constant chore. Let's autogenerate the header from the tables that
were imported in one of the previous commits.

Fixes #18074. (Hopefully. I cannot verify this on all architectures.)

To update the lists, or to update the header after template changes:
ninja -C build update-syscall-tables update-syscall-header

Note: the generated file is saved in git. Initially I wanted to only
store the tables in git, and generate the header during each build.
Generation is quick enough, but the header is used in many many
places (wherever missing_syscall.h is included, directly or indirectly),
which means that we would need to declare the dependency in meson, so
the header would be generated early enough. This turned out to be very
noisy. Storing the generated header in version control avoids the hassle.

3 years agotree-wide: use curl --fail
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 12:02:44 +0000 (13:02 +0100)] 
tree-wide: use curl --fail

curl will save the 404 response page (or another error) if the page
download fails, which we never want. Let it error out instead.

3 years agosyscalls: update tables
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 10:46:14 +0000 (11:46 +0100)] 
syscalls: update tables

$ ninja -C build update-syscall-tables

3 years agomeson: download full syscall tables from hrw/syscalls-table
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 10:43:47 +0000 (11:43 +0100)] 
meson: download full syscall tables from hrw/syscalls-table

The target is renamed to 'update-syscall-tables'. (Other targets
with similar names will be added later.)

3 years agosystemctl: avoid warning about signed-unsigned compare on 32 bits
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 17:00:14 +0000 (18:00 +0100)] 
systemctl: avoid warning about signed-unsigned compare on 32 bits

../src/systemctl/systemctl-list-units.c: In function ‘output_units_list’:
../src/systemctl/systemctl-list-units.c:112:75: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  112 |         for (const UnitInfo *u = unit_infos; unit_infos && u - unit_infos < c; u++) {
      |                                                                           ^

The pointer difference is signed. I don't know why gcc warns on 32bits, but
not otherwise.

gcc-10.2.1-9.fc33.x86_64, -m32

3 years agoman/systemd-veritysetup-generator: fix trailing space 17576/head
Gaël PORTAY [Thu, 31 Dec 2020 11:38:49 +0000 (06:38 -0500)] 
man/systemd-veritysetup-generator: fix trailing space

3 years agoveritysetup: remove unused globals
Gaël PORTAY [Thu, 31 Dec 2020 11:25:17 +0000 (06:25 -0500)] 
veritysetup: remove unused globals

This removes the three global variables arg_root_hash, arg_data_what and
arg_hash_what which were presents since the beginning but were never
being used.

3 years agoveritysetup-generator: add support for veritytab
Gaël PORTAY [Sat, 14 Nov 2020 14:21:39 +0000 (09:21 -0500)] 
veritysetup-generator: add support for veritytab

This adds the support for veritytab.

The veritytab file contains at most five fields, the first four are
mandatory, the last one is optional:
 - The first field contains the name of the resulting verity volume; its
   block device is set up /dev/mapper/</filename>.
 - The second field contains a path to the underlying block data device,
   or a specification of a block device via UUID= followed by the UUID.
 - The third field contains a path to the underlying block hash device,
   or a specification of a block device via UUID= followed by the UUID.
 - The fourth field is the roothash in hexadecimal.
 - The fifth field, if present, is a comma-delimited list of options.
   The following options are recognized only: ignore-corruption,
   restart-on-corruption, panic-on-corruption, ignore-zero-blocks,
   check-at-most-once and root-hash-signature. The others options will
   be implemented later.

Also, this adds support for the new kernel verity command line boolean
option "veritytab" which enables the read for veritytab, and the new
environment variable SYSTEMD_VERITYTAB which sets the path to the file
veritytab to read.

3 years agoMerge pull request #18254 from keszybz/trivial-cleanups
Luca Boccassi [Fri, 15 Jan 2021 14:00:06 +0000 (14:00 +0000)] 
Merge pull request #18254 from keszybz/trivial-cleanups

Assorted small cleanups

3 years agoudevd: Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 06:18:59 +0000 (07:18 +0100)] 
udevd: Use hashmap_ensure_put

3 years agonetwork: online - use hashmap_ensure_put
Susant Sahani [Fri, 15 Jan 2021 13:32:16 +0000 (14:32 +0100)] 
network: online - use hashmap_ensure_put

3 years agonetwork: routing policy rule - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 06:05:49 +0000 (07:05 +0100)] 
network: routing policy rule - Use hashmap_ensure_put

3 years agonetwork: route - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 06:04:11 +0000 (07:04 +0100)] 
network: route - Use hashmap_ensure_put

3 years agonetwork: radv - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 06:02:58 +0000 (07:02 +0100)] 
network: radv - Use hashmap_ensure_put

3 years agonetwork: neighbor - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 06:01:11 +0000 (07:01 +0100)] 
network: neighbor - use hashmap_ensure_put

3 years agonetwork: mdb - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:54:47 +0000 (06:54 +0100)] 
network: mdb - use hashmap_ensure_put

3 years agonetwork: link - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:42:50 +0000 (06:42 +0100)] 
network: link - use hashmap_ensure_put

3 years agonetwork: link - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:33:52 +0000 (06:33 +0100)] 
network: link - use hashmap_ensure_put

3 years agonetwork: fdb - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:32:05 +0000 (06:32 +0100)] 
network: fdb - Use hashmap_ensure_put

3 years agonetwork: dhcp6 - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:30:39 +0000 (06:30 +0100)] 
network: dhcp6 - use hashmap_ensure_put

3 years agonetwork: address label - use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:28:04 +0000 (06:28 +0100)] 
network: address label - use hashmap_ensure_put

3 years agonetwork: wireguard - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:25:12 +0000 (06:25 +0100)] 
network: wireguard - Use hashmap_ensure_put

3 years agonetwork: netdev - Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:24:02 +0000 (06:24 +0100)] 
network: netdev - Use hashmap_ensure_put

3 years agogenerator: Use hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:21:09 +0000 (06:21 +0100)] 
generator: Use hashmap_ensure_put

3 years agobasic: introuce hashmap_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:19:47 +0000 (06:19 +0100)] 
basic: introuce hashmap_ensure_put

3 years agohomed: use ordered_set_ensure_put
Susant Sahani [Thu, 14 Jan 2021 05:00:53 +0000 (06:00 +0100)] 
homed: use ordered_set_ensure_put

3 years agoMerge pull request #18214 from elmarco/vsock
Lennart Poettering [Fri, 15 Jan 2021 10:43:15 +0000 (11:43 +0100)] 
Merge pull request #18214 from elmarco/vsock

udev: allow kvm group to access vhost net and vsock devices

3 years agoMerge pull request #18197 from weblate/weblate-systemd-master
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 10:10:43 +0000 (11:10 +0100)] 
Merge pull request #18197 from weblate/weblate-systemd-master

Translations update from Weblate

3 years agoMerge pull request #18244 from anitazha/systemctledit
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 10:07:02 +0000 (11:07 +0100)] 
Merge pull request #18244 from anitazha/systemctledit

systemctl-edit fixes

3 years agobasic/env-util: modernization 18254/head
Zbigniew Jędrzejewski-Szmek [Fri, 15 Jan 2021 09:23:57 +0000 (10:23 +0100)] 
basic/env-util: modernization