]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #20257 from bluca/seqno
Luca Boccassi [Tue, 31 Aug 2021 08:06:33 +0000 (09:06 +0100)] 
Merge pull request #20257 from bluca/seqno

Use new diskseq block device property

3 years agoMerge pull request #20567 from yuwata/socket-additional-cmsg-buffer
Yu Watanabe [Tue, 31 Aug 2021 04:54:18 +0000 (13:54 +0900)] 
Merge pull request #20567 from yuwata/socket-additional-cmsg-buffer

socket-util: add additional cmsg buffer for 64bit timeval or timespec

3 years agogpt-auto-generator: Use volatile-root by default and automatic logic as fallback
Kristian Klausen [Mon, 30 Aug 2021 07:55:41 +0000 (09:55 +0200)] 
gpt-auto-generator: Use volatile-root by default and automatic logic as fallback

Previously volatile-root was only checked if "/" wasn't backed by a
block device, but the block device isn't necessarily original root block
device (ex: if the rootfs is copied to a ext4 fs backed by zram in the
initramfs), so we always want volatile-root checked.

So shuffle the code around so volatile-root is checked first and
fallback to the automatic logic.

Fix #20557

3 years agoMerge pull request #20583 from poettering/pk-no-tty
Yu Watanabe [Tue, 31 Aug 2021 04:45:04 +0000 (13:45 +0900)] 
Merge pull request #20583 from poettering/pk-no-tty

some polkit agent tweaks

3 years agoman: Don't leak memory in path-documents example
Thomas Mühlbacher [Mon, 30 Aug 2021 14:16:30 +0000 (16:16 +0200)] 
man: Don't leak memory in path-documents example

The `sd_path_lookup(3)` man page states that the returned string shall be
`free(3)`'d but then doesn't do so in the example code.

Also add basic error handling as well.

3 years agocore: fix typo: they -> the
Yu Watanabe [Mon, 30 Aug 2021 11:34:48 +0000 (20:34 +0900)] 
core: fix typo: they -> the

3 years agohwdb: remove double empty line in --help text
Lennart Poettering [Mon, 30 Aug 2021 11:20:59 +0000 (13:20 +0200)] 
hwdb: remove double empty line in --help text

3 years agoexec-util: handle gracefully if we want to fork an agent but have no controlling tty 20583/head
Lennart Poettering [Mon, 30 Aug 2021 11:28:02 +0000 (13:28 +0200)] 
exec-util: handle gracefully if we want to fork an agent but have no controlling tty

Fixes: #20576
3 years agorun/mount/systemctl: don't fork off PolicyKit/ask-pw agent when in --user mode
Lennart Poettering [Mon, 30 Aug 2021 11:21:55 +0000 (13:21 +0200)] 
run/mount/systemctl: don't fork off PolicyKit/ask-pw agent when in --user mode

When we are in --user mode there's no point in doing PolicyKit/ask-pw
because both of these systems are only used by system-level services.
Let's disable the two agents for that automaticlly hence.

Prompted by: #20576

3 years agotimesync: check cmsg length 20567/head
Yu Watanabe [Sun, 29 Aug 2021 11:55:44 +0000 (20:55 +0900)] 
timesync: check cmsg length

3 years agosocket-util: introduce CMSG_SPACE_TIMEVAL/TIMESPEC macro to support additional 64bit...
Yu Watanabe [Sun, 29 Aug 2021 11:50:49 +0000 (20:50 +0900)] 
socket-util: introduce CMSG_SPACE_TIMEVAL/TIMESPEC macro to support additional 64bit timeval or timespec

Fixes #20482 and #20564.

3 years agoAdd matrix for the Chuwi SurBook Mini (CWI540)
jlempen [Sun, 29 Aug 2021 18:49:20 +0000 (20:49 +0200)] 
Add matrix for the Chuwi SurBook Mini (CWI540)

3 years agohwdb: add a generic rule for trackpoints (#20543)
José Expósito [Mon, 30 Aug 2021 08:30:42 +0000 (10:30 +0200)] 
hwdb: add a generic rule for trackpoints (#20543)

Check for "TrackPoint" in the device name and add the
ID_INPUT_POINTINGSTICK property.

In reference to libinput issue:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/651

3 years agoMerge pull request #20057 from yuwata/sd-netlink-genl-cleanups
Yu Watanabe [Sun, 29 Aug 2021 13:37:31 +0000 (22:37 +0900)] 
Merge pull request #20057 from yuwata/sd-netlink-genl-cleanups

sd-netlink: cleanups for generic netlink

3 years agosd-netlink: make type_system_get_*() and friends return value directly 20057/head
Yu Watanabe [Sun, 29 Aug 2021 08:59:17 +0000 (17:59 +0900)] 
sd-netlink: make type_system_get_*() and friends return value directly

3 years agosd-netlink: introduce sd_genl_add_match()
Yu Watanabe [Tue, 29 Jun 2021 16:16:45 +0000 (01:16 +0900)] 
sd-netlink: introduce sd_genl_add_match()

By using this, we can listen multicast messages for generic netlink.

3 years agosd-netlink: split sd_netlink_add_match() into two parts
Yu Watanabe [Tue, 29 Jun 2021 16:11:07 +0000 (01:11 +0900)] 
sd-netlink: split sd_netlink_add_match() into two parts

This also makes netlink_slot_disconnect() correctly unref multicast
groups.

3 years agosd-netlink: introduce sd_genl_message_get_command()
Yu Watanabe [Fri, 2 Jul 2021 21:21:45 +0000 (06:21 +0900)] 
sd-netlink: introduce sd_genl_message_get_command()

3 years agosd-netlink: determine header size of genl message by using CTRL_ATTR_HDRSIZE attribute
Yu Watanabe [Fri, 2 Jul 2021 21:53:08 +0000 (06:53 +0900)] 
sd-netlink: determine header size of genl message by using CTRL_ATTR_HDRSIZE attribute

Fortunately, all genl families we currently use do not require additional
header size.

3 years agosd-netlink: read protocol version of each genl family
Yu Watanabe [Sun, 4 Jul 2021 11:05:35 +0000 (20:05 +0900)] 
sd-netlink: read protocol version of each genl family

3 years agosd-netlink: drop sd_genl_family_t and introduce GenericNetlinkFamily
Yu Watanabe [Tue, 24 Aug 2021 09:11:20 +0000 (18:11 +0900)] 
sd-netlink: drop sd_genl_family_t and introduce GenericNetlinkFamily

Kernel manages each genl family by its name, e.g. "nlctrl" or WG_GENL_NAME,
and its ID (used for nlmsg_type) is determined dynamically when the
corresponding module is loaded.

This commit makes sd-netlink follow the same way; now, sd_genl_family_t
is dropped, and sd_genl_message_new() takes a genl family name. Each
genl family is resolved when it is used first time, and its information
is stored in GenericNetlinkFamily.

3 years agosd-netlink: split message_new() into two parts and introduces message_new_full()
Yu Watanabe [Tue, 24 Aug 2021 08:41:14 +0000 (17:41 +0900)] 
sd-netlink: split message_new() into two parts and introduces message_new_full()

3 years agosd-netlink: introduce several macros to define type system
Yu Watanabe [Tue, 24 Aug 2021 08:06:41 +0000 (17:06 +0900)] 
sd-netlink: introduce several macros to define type system

3 years agosd-netlink: drop redundant string table lookup functions to handle type system union
Yu Watanabe [Tue, 24 Aug 2021 07:39:38 +0000 (16:39 +0900)] 
sd-netlink: drop redundant string table lookup functions to handle type system union

3 years agosd-netlink: split type system for nfnl
Yu Watanabe [Tue, 24 Aug 2021 07:10:49 +0000 (16:10 +0900)] 
sd-netlink: split type system for nfnl

This makes the root type system for nfnl indexed by subsystem, and
itroduces a next level type system for each subsystem. The second
level type systems are indexed by message types correspond to each
subsystem.

3 years agosd-netlink: drop 'flags' argument from sd_nfnl_nft_message_new_table()
Yu Watanabe [Sat, 3 Jul 2021 03:42:08 +0000 (12:42 +0900)] 
sd-netlink: drop 'flags' argument from sd_nfnl_nft_message_new_table()

3 years agosd-netlink: wrap long function declarations
Yu Watanabe [Sat, 3 Jul 2021 03:38:52 +0000 (12:38 +0900)] 
sd-netlink: wrap long function declarations

3 years agosd-netlink: add several missing attributes
Yu Watanabe [Tue, 24 Aug 2021 06:51:33 +0000 (15:51 +0900)] 
sd-netlink: add several missing attributes

3 years agobasic: copy genetlink.h to repository
Yu Watanabe [Tue, 29 Jun 2021 08:26:19 +0000 (17:26 +0900)] 
basic: copy genetlink.h to repository

3 years agosd-netlink: introduce basic_type_system
Yu Watanabe [Tue, 24 Aug 2021 06:40:17 +0000 (15:40 +0900)] 
sd-netlink: introduce basic_type_system

Preparation for later commits.

3 years agosd-netlink: unify two spurious type system root for genl
Yu Watanabe [Tue, 24 Aug 2021 06:27:56 +0000 (15:27 +0900)] 
sd-netlink: unify two spurious type system root for genl

3 years agosd-netlink: drop genl type system indexed by command
Yu Watanabe [Tue, 24 Aug 2021 06:11:02 +0000 (15:11 +0900)] 
sd-netlink: drop genl type system indexed by command

All type systems of currently supported genl families do not depend on
commands. Hence, at least tentatively, let's drop the tables.

Note that type system for genl ethtool depends on commands. Let's
reintroduce a mechanism to support the deps when we support ethtool on
netlink.

3 years agosd-netlink: rename several type systems for generic netlink
Yu Watanabe [Tue, 24 Aug 2021 05:55:16 +0000 (14:55 +0900)] 
sd-netlink: rename several type systems for generic netlink

3 years agosd-netlink: split netlink-types.[ch] into small files
Yu Watanabe [Wed, 7 Jul 2021 04:42:04 +0000 (13:42 +0900)] 
sd-netlink: split netlink-types.[ch] into small files

Also renames several files.

3 years agosd-netlink: make several type systems static
Yu Watanabe [Tue, 29 Jun 2021 07:07:21 +0000 (16:07 +0900)] 
sd-netlink: make several type systems static

3 years agosd-netlink: move type systems
Yu Watanabe [Tue, 29 Jun 2021 07:06:04 +0000 (16:06 +0900)] 
sd-netlink: move type systems

3 years agosd-netlink: introduce two helper functions for type system union
Yu Watanabe [Sun, 4 Jul 2021 06:11:08 +0000 (15:11 +0900)] 
sd-netlink: introduce two helper functions for type system union

3 years agosd-netlink: rename functions
Yu Watanabe [Sun, 4 Jul 2021 05:58:20 +0000 (14:58 +0900)] 
sd-netlink: rename functions

3 years agosd-netlink: make type_get_type_system{,_union}() return value directly
Yu Watanabe [Sun, 4 Jul 2021 05:33:02 +0000 (14:33 +0900)] 
sd-netlink: make type_get_type_system{,_union}() return value directly

3 years agosd-netlink: make message_seal() accept already sealed messages
Yu Watanabe [Wed, 7 Jul 2021 01:05:08 +0000 (10:05 +0900)] 
sd-netlink: make message_seal() accept already sealed messages

The function can be idempotent. It is not necessary to refuse already
sealed messages.

3 years agosd-netlink: rename variables, arguments, and functions
Yu Watanabe [Wed, 7 Jul 2021 00:42:41 +0000 (09:42 +0900)] 
sd-netlink: rename variables, arguments, and functions

Most changes are 'rtnl' -> 'nl' where the function is not only for rtnl.

3 years agotest: add usual log messages in test-netlink
Yu Watanabe [Tue, 29 Jun 2021 06:33:58 +0000 (15:33 +0900)] 
test: add usual log messages in test-netlink

3 years agosd-netlink: drop unused type
Yu Watanabe [Tue, 29 Jun 2021 06:26:25 +0000 (15:26 +0900)] 
sd-netlink: drop unused type

3 years agoupdate TODO
Lennart Poettering [Sat, 28 Aug 2021 05:15:12 +0000 (07:15 +0200)] 
update TODO

3 years agocore: Add information on which condition failed to the job done message
Daan De Meyer [Thu, 26 Aug 2021 15:44:37 +0000 (16:44 +0100)] 
core: Add information on which condition failed to the job done message

When a job is skipped, it's useful to know exactly which condition failed so
let's add this information to the error message.

To avoid having to dynamically generate a format string, we special case the
formatting of condition failed messages.

3 years agocore: Unit's condition_result field is a boolean
Lennart Poettering [Fri, 27 Aug 2021 14:49:12 +0000 (16:49 +0200)] 
core: Unit's condition_result field is a boolean

Let's only assign boolean values to a boolean variable.

Unit's condition_result is not of type ConditionResult, slightly
confusingly. Let's hence not assign one of ConditionResult's values to
it, but simple booleans.

This effectively doesn't make a difference, since CONDITION_ERROR is
true when cast to bool. But it's still ugly to rely on that. And
confusing.

3 years agoFix another crash due to missing NHDR
Kevin Orr [Thu, 26 Aug 2021 21:04:53 +0000 (17:04 -0400)] 
Fix another crash due to missing NHDR

3 years agoMerge pull request #20547 from poettering/home-4k
Lennart Poettering [Fri, 27 Aug 2021 07:59:44 +0000 (09:59 +0200)] 
Merge pull request #20547 from poettering/home-4k

homed: round fs offset and sizes to multiples of 4K

3 years agoMerge pull request #20553 from weblate/weblate-systemd-master
Yu Watanabe [Thu, 26 Aug 2021 18:09:29 +0000 (03:09 +0900)] 
Merge pull request #20553 from weblate/weblate-systemd-master

Translations update from Weblate

3 years agopo: Translated using Weblate (Finnish) 20553/head
Jan Kuparinen [Thu, 26 Aug 2021 18:05:20 +0000 (20:05 +0200)] 
po: Translated using Weblate (Finnish)

Currently translated at 9.5% (18 of 189 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main

3 years agopo: Translated using Weblate (Spanish)
Adolfo Jayme Barrientos [Thu, 26 Aug 2021 18:05:20 +0000 (20:05 +0200)] 
po: Translated using Weblate (Spanish)

Currently translated at 89.4% (169 of 189 strings)

Co-authored-by: Adolfo Jayme Barrientos <fitoschido@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/es/
Translation: systemd/main

3 years agoRevert "core: Add information on which condition failed to job skipped format string"
Lennart Poettering [Thu, 26 Aug 2021 14:50:35 +0000 (16:50 +0200)] 
Revert "core: Add information on which condition failed to job skipped format string"

This reverts commit c97bef458b6e59079c9613ec755c1c6513c1c655.

3 years agocryptsetup: drop an unused variable
Frantisek Sumsal [Thu, 26 Aug 2021 08:38:46 +0000 (10:38 +0200)] 
cryptsetup: drop an unused variable

This fixes compilation with new-enough libcryptsetup (2.4.0+) & clang:

```
$ CC=clang CXX=clang++ meson build --werror -Dlibcryptsetup-plugins=true
...
$ ninja -C build
...
../src/cryptsetup/cryptsetup-tokens/luks2-fido2.c:23:53: error: unused variable 'v' [-Werror,-Wunused-variable]
        _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
...
```

3 years agohwdb: Add sensor rule for Hometech Wi101
Wind/owZ [Sun, 22 Aug 2021 00:19:18 +0000 (03:19 +0300)] 
hwdb: Add sensor rule for Hometech Wi101

This commit was done to add sensor rule for Hometech Wi101. Note that this rule might be too general and need fixes. I couldn't test this on any other device since this one is the only one I have.

Co-authored-by: Simeonlps <Simeonlps@users.noreply.github.com>
Signed-off-by: Wind/owZ <windowz414@gnuweeb.org>
3 years agohwdb: Add force-release for HP Omen 15 calculator key. (#20538)
I-dont-need-name [Thu, 26 Aug 2021 09:25:32 +0000 (12:25 +0300)] 
hwdb: Add force-release for HP Omen 15 calculator key. (#20538)

* Add force-release for HP Omen 15 calculator key.

The key doesn't create release event so I have come up with this fix to make it work properly.

3 years agocore: Add information on which condition failed to job skipped format string
Daan De Meyer [Fri, 20 Aug 2021 10:02:25 +0000 (11:02 +0100)] 
core: Add information on which condition failed to job skipped format string

When a job is skipped, it's useful to know exactly which condition failed so
let's add this information to the error message. Because we now return an
allocated string from job_done_message_format(), make sure we strdup() the
other formats as well so the caller can safely free the string returned by
job_done_message_format().

3 years agonetwork: default LinkLocalAddresssing= to no for link stacked with a passthru mode...
Tom Yan [Wed, 25 Aug 2021 09:50:01 +0000 (17:50 +0800)] 
network: default LinkLocalAddresssing= to no for link stacked with a passthru mode MACVLAN/MACVTAP

For similar reason to the case of a bridge slave: we don't want any IP configuration for it.

3 years agoMerge pull request #20541 from yuwata/udev-coalesce-follow-up
Yu Watanabe [Wed, 25 Aug 2021 21:05:29 +0000 (06:05 +0900)] 
Merge pull request #20541 from yuwata/udev-coalesce-follow-up

udev: follow-ups for coalesce feature support

3 years agoMerge pull request #20515 from yuwata/pid1-mount-apivfs-no
Yu Watanabe [Wed, 25 Aug 2021 21:05:03 +0000 (06:05 +0900)] 
Merge pull request #20515 from yuwata/pid1-mount-apivfs-no

pid1: make find_executable() work with MountAPIVFS=no

3 years agoMerge pull request #20531 from DaanDeMeyer/fix-17433
Yu Watanabe [Wed, 25 Aug 2021 21:04:40 +0000 (06:04 +0900)] 
Merge pull request #20531 from DaanDeMeyer/fix-17433

core: Check unit start rate limiting earlier

3 years agoupdate TODO 20547/head
Lennart Poettering [Tue, 24 Aug 2021 15:45:10 +0000 (17:45 +0200)] 
update TODO

3 years agohomed: always align home file systems to 4K boundaries
Lennart Poettering [Fri, 20 Aug 2021 16:40:53 +0000 (18:40 +0200)] 
homed: always align home file systems to 4K boundaries

Let's carefully align all home file systems to 4K sector boundaries.
It's the safest thing to do, to ensure good perfomance on 4K sector
drives, i.e. today's hardware.

Yes, this means we'll waste 3.5K when resizing home dirs, but I think we
can live with that.

This ensures both the offsets where we start and the sizes of the file
systems/partitions/disk images are multiples of 4K always, both when
creating a new image and when resizing things.

Note that previously we aligned everything to 1024, but weren't quite as
careful.

3 years agoudev/net: initialize coalesce tristate variables 20541/head
Yu Watanabe [Wed, 25 Aug 2021 18:34:23 +0000 (03:34 +0900)] 
udev/net: initialize coalesce tristate variables

Otherwise, 99-default.link may introduce something like the
following warnings:
----
Aug 26 03:23:59 systemd-udevd[519]: wlan0: Could not set coalesce settings, ignoring: Operation not supported
Aug 26 03:24:00 systemd-udevd[547]: wlp59s0: Could not set coalesce settings, ignoring: Operation not supported
----

Follow-up for 6c35ea5ef0231d519ff24d43a57a72cebab6a121.

3 years agoethtool: move function
Yu Watanabe [Wed, 25 Aug 2021 18:31:05 +0000 (03:31 +0900)] 
ethtool: move function

I'd like to locate all conf parsers at end of file.

3 years agotest-execute: add a testcase for MountAPIVFS=no 20515/head
Yu Watanabe [Sun, 22 Aug 2021 21:45:33 +0000 (06:45 +0900)] 
test-execute: add a testcase for MountAPIVFS=no

3 years agocore: Check unit start rate limiting earlier 20531/head
Daan De Meyer [Tue, 24 Aug 2021 15:46:47 +0000 (16:46 +0100)] 
core: Check unit start rate limiting earlier

Fixes #17433. Currently, if any of the validations we do before we
check start rate limiting fail, we can still enter a busy loop as
no rate limiting gets applied. A common occurence of this scenario
is path units triggering a service that fails a condition check.

To fix the issue, we simply move up start rate limiting checks to
be the first thing we do when starting a unit. To achieve this,
we add a new method to the unit vtable and implement it for the
relevant unit types so that we can do the start rate limit checks
earlier on.

3 years agoNEWS: net.ipv4.tcp_ecn = 1 was reverted at v240
Sho Iizuka [Wed, 25 Aug 2021 04:00:03 +0000 (13:00 +0900)] 
NEWS: net.ipv4.tcp_ecn = 1 was reverted at v240

Turning on ECN was reverted by 1e190df.

3 years agoMerge pull request #20530 from keszybz/typos-and-meson
Luca Boccassi [Tue, 24 Aug 2021 20:54:22 +0000 (21:54 +0100)] 
Merge pull request #20530 from keszybz/typos-and-meson

Typos and meson

3 years agocore: Remove circular include
Daan De Meyer [Tue, 24 Aug 2021 15:19:03 +0000 (16:19 +0100)] 
core: Remove circular include

service.h includes socket.h and socket.h includes service.h. Move
service.h include from socket.h to socket.c to remove the circular
dependency.

3 years agomeson: capitalize the last instance of "efi" 20530/head
Zbigniew Jędrzejewski-Szmek [Tue, 24 Aug 2021 12:54:50 +0000 (14:54 +0200)] 
meson: capitalize the last instance of "efi"

All the others in this section use "EFI"…

3 years agoman: adjust the description of extension-release.*
Zbigniew Jędrzejewski-Szmek [Sat, 21 Aug 2021 14:02:09 +0000 (16:02 +0200)] 
man: adjust the description of extension-release.*

3 years agodocs: adjust sentece, fix minor typo
Zbigniew Jędrzejewski-Szmek [Wed, 4 Aug 2021 07:19:13 +0000 (09:19 +0200)] 
docs: adjust sentece, fix minor typo

The verity partition types are per-architecture already, and they contain the
hash data independently of whether we are on a given architecture. (Or in other
words, we would make *use* this partition on some architecture, but the
contents always *exists*.)

3 years agoman: fix minor grammar issue
Zbigniew Jędrzejewski-Szmek [Sat, 7 Aug 2021 06:40:51 +0000 (08:40 +0200)] 
man: fix minor grammar issue

The usual: "searched" vs. "searched for".

3 years agoMerge pull request #20524 from weblate/weblate-systemd-master
Yu Watanabe [Mon, 23 Aug 2021 18:28:06 +0000 (03:28 +0900)] 
Merge pull request #20524 from weblate/weblate-systemd-master

Translations update from Weblate

3 years agopo: Translated using Weblate (Finnish) 20524/head
Jan Kuparinen [Mon, 23 Aug 2021 18:04:54 +0000 (20:04 +0200)] 
po: Translated using Weblate (Finnish)

Currently translated at 1.5% (3 of 189 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main

3 years agopo: Translated using Weblate (German)
Ettore Atalan [Mon, 23 Aug 2021 18:04:54 +0000 (20:04 +0200)] 
po: Translated using Weblate (German)

Currently translated at 70.3% (133 of 189 strings)

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/de/
Translation: systemd/main

3 years agotest-execute: logs can_share flag
Yu Watanabe [Sun, 22 Aug 2021 22:13:14 +0000 (07:13 +0900)] 
test-execute: logs can_share flag

3 years agopath-util: make find_executable() work without /proc mounted
Yu Watanabe [Sun, 22 Aug 2021 21:16:48 +0000 (06:16 +0900)] 
path-util: make find_executable() work without /proc mounted

Follow-up for 888f65ace6296ed61285d31db846babf1c11885e.

Hopefully fixes #20514.

3 years agopath-util: split out common part in find_executable_full()
Yu Watanabe [Sun, 22 Aug 2021 21:09:14 +0000 (06:09 +0900)] 
path-util: split out common part in find_executable_full()

3 years agoMerge pull request #20513 from yuwata/network-allow-deny-list-take-prefix-length
Yu Watanabe [Mon, 23 Aug 2021 17:01:51 +0000 (02:01 +0900)] 
Merge pull request #20513 from yuwata/network-allow-deny-list-take-prefix-length

network: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take prefix length

3 years agojson: rework JSON_BUILD_XYZ() macros to use compound literals instead of compound...
Lennart Poettering [Mon, 23 Aug 2021 08:48:56 +0000 (10:48 +0200)] 
json: rework JSON_BUILD_XYZ() macros to use compound literals instead of compound statements

Compound statements is this stuff: ({ … })

Compound literals is this stuff: (type) { … }

We use compound statements a lot in macro definitions: they have one
drawback though: they define a code block of their own, hence if macro
invocations are nested within them that use compound literals their
lifetime is limited to the code block, which might be unexpected.

Thankfully, we can rework things from compound statements to compund
literals in the case of json.h: they don't open a new codeblack, and
hence do not suffer by the problem explained above.

The interesting thing about compound statements is that they also work
for simple types, not just for structs/unions/arrays. We can use this
here for a typechecked implicit conversion: we want to superficially
typecheck arguments to the json_build() varargs function, and we do that
by assigning the specified arguments to our compound literals, which
does the minimal amount of typechecks and ensures that types are
propagated on correctly.

We need one special tweak for this: sd_id128_t is not a simple type but
a union. Using compound literals for initialzing that would mean
specifiying the components of the union, not a complete sd_id128_t. Our
hack around that: instead of passing the object directly via the stack
we now take a pointer (and thus a simple type) instead.

Nice side-effect of all this: compound literals is C99, while compound
statements are a GCC extension, hence we move closer to standard C.

Fixes: #20501
Replaces: #20512

3 years agotest-network: add more testcases for *Allow/DenyList= 20513/head
Yu Watanabe [Mon, 23 Aug 2021 11:37:36 +0000 (20:37 +0900)] 
test-network: add more testcases for *Allow/DenyList=

3 years agonetwork: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take prefix length
Yu Watanabe [Sun, 22 Aug 2021 16:36:21 +0000 (01:36 +0900)] 
network: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take prefix length

Closes #20505.

3 years agoMerge pull request #20498 from yuwata/network-fix-gateway
Yu Watanabe [Sun, 22 Aug 2021 13:58:20 +0000 (22:58 +0900)] 
Merge pull request #20498 from yuwata/network-fix-gateway

network: fix logic for checking gateway address

3 years agopo: Added translation using Weblate (Finnish)
Jan Kuparinen [Sun, 22 Aug 2021 10:19:47 +0000 (12:19 +0200)] 
po: Added translation using Weblate (Finnish)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agotree-wide: fix typo
Yu Watanabe [Sun, 22 Aug 2021 06:42:51 +0000 (15:42 +0900)] 
tree-wide: fix typo

3 years agoMerge pull request #20303 from andir/sysconfig-example
Yu Watanabe [Sun, 22 Aug 2021 06:40:39 +0000 (15:40 +0900)] 
Merge pull request #20303 from andir/sysconfig-example

{core, login}: respect install_sysconfdir_samples in meson file

3 years agotest-network: add testcases that gateway address is IPv6 link local 20498/head
Yu Watanabe [Fri, 20 Aug 2021 18:54:35 +0000 (03:54 +0900)] 
test-network: add testcases that gateway address is IPv6 link local

3 years agonetwork: fix logic for checking gateway address is ready
Yu Watanabe [Fri, 20 Aug 2021 18:51:39 +0000 (03:51 +0900)] 
network: fix logic for checking gateway address is ready

This fixes the followings:
- The corresponding route or address to the gateway address must be in
  the same link.
- IPv6 link local address is not necessary to be reachable.

Fixes an issue reported in https://github.com/systemd/systemd/issues/8686#issuecomment-902562324.

3 years agologin: respect install_sysconfdir_samples in meson file 20303/head
Andreas Rammhold [Mon, 26 Jul 2021 15:20:34 +0000 (17:20 +0200)] 
login: respect install_sysconfdir_samples in meson file

The refactoring done in c900d89faa0 caused the configuration files to be
installed into the pkgsysconfdir regardless of the state of the
install_sysconfdir_samples boolean that indicates whether or not the
sample files should be installed.

3 years agocore: respect install_sysconfdir_samples in meson file
Andreas Rammhold [Mon, 26 Jul 2021 14:57:43 +0000 (16:57 +0200)] 
core: respect install_sysconfdir_samples in meson file

The refactoring done in e11a25cadbe caused the configuration files to be
installed into the pkgsysconfdir regardless of the state of the
install_sysconfdir_samples boolean that indicates whether or not the
sample files should be installed.

3 years agodocs: Add documentation on how to use VSCode to debug systemd via mkosi
Daan De Meyer [Fri, 20 Aug 2021 18:09:37 +0000 (19:09 +0100)] 
docs: Add documentation on how to use VSCode to debug systemd via mkosi

3 years agoMerge pull request #20500 from poettering/import-tweaks
Yu Watanabe [Sat, 21 Aug 2021 03:50:22 +0000 (12:50 +0900)] 
Merge pull request #20500 from poettering/import-tweaks

a few minor tweaks/bugfixlets to importd backends

3 years agoMerge pull request #20499 from poettering/align-to-tweak
Yu Watanabe [Sat, 21 Aug 2021 03:50:07 +0000 (12:50 +0900)] 
Merge pull request #20499 from poettering/align-to-tweak

ALIGN_TO() tweaks

3 years agoMerge pull request #20494 from bluca/snprintf_voidify
Yu Watanabe [Fri, 20 Aug 2021 21:45:58 +0000 (06:45 +0900)] 
Merge pull request #20494 from bluca/snprintf_voidify

tree-wide: voidify unchecked snprintf calls or use snprintf_ok

3 years agoMerge pull request #20484 from DaanDeMeyer/rx-gro-hw
Yu Watanabe [Fri, 20 Aug 2021 21:43:49 +0000 (06:43 +0900)] 
Merge pull request #20484 from DaanDeMeyer/rx-gro-hw

Add rx-gro-hw support

3 years agotest: make sure test timeout has a higher priority than a pass
Frantisek Sumsal [Fri, 20 Aug 2021 12:08:18 +0000 (14:08 +0200)] 
test: make sure test timeout has a higher priority than a pass

otherwise we might mark tests where something crashes during shutdown as
successful, as happened in one of the recent TEST-01-BASIC runs:

```
testsuite-01.service: About to execute rm -f /failed /testok
testsuite-01.service: Forked rm as 606
testsuite-01.service: Executing: rm -f /failed /testoktestsuite-01.service: Changed dead -> start-pre
         Starting TEST-01-BASIC...
...
Child 606 (rm) died (code=exited, status=0/SUCCESS)
testsuite-01.service: Child 606 belongs to testsuite-01.service.
testsuite-01.service: Control process exited, code=exited, status=0/SUCCESS (success)
testsuite-01.service: Got final SIGCHLD for state start-pre.
testsuite-01.service: Passing 0 fds to service
testsuite-01.service: About to execute sh -e -x -c "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"
testsuite-01.service: Forked sh as 607
testsuite-01.service: Changed start-pre -> start
testsuite-01.service: Executing: sh -e -x -c "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"systemd-journald.service: Got notification message from PID 560 (FDSTORE=1)S
...
testsuite-01.service: Child 607 belongs to testsuite-01.service.
testsuite-01.service: Main process exited, code=exited, status=0/SUCCESS (success)
testsuite-01.service: Deactivated successfully.
testsuite-01.service: Service will not restart (restart setting)
testsuite-01.service: Changed start -> dead
testsuite-01.service: Job 207 testsuite-01.service/start finished, result=done
[  OK  ] Finished TEST-01-BASIC.
...
end.service: About to execute /bin/sh -x -c "systemctl poweroff --no-block"
end.service: Forked /bin/sh as 623end.service: Executing: /bin/sh -x -c "systemctl poweroff --no-block"
...
end.service: Job 213 end.service/start finished, result=canceled
Caught <SEGV>, dumped core as pid 624.
Freezing execution.

CentOS Linux 8
Kernel 4.18.0-305.12.1.el8_4.x86_64 on an x86_64 (ttyS0)

H login: qemu-kvm: terminating on signal 15 from pid 80134 (timeout)
E: Test timed out after 600s
Spawning getter /root/systemd/build/journalctl -o export -D /var/tmp/systemd-test.0UYjAS/root/var/log/journal/ca6031c2491543fe8286c748258df8d1...
Finishing after writing 15125 entries
Spawning getter /root/systemd/build/journalctl -o export -D /var/tmp/systemd-test.0UYjAS/root/var/log/journal/remote...
Finishing after writing 0 entries
-rw-r-----. 1 root root 25165824 Aug 20 12:26 /var/tmp/systemd-test.0UYjAS/system.journal
TEST-01-BASIC RUN: Basic systemd setup [OK]
...

3 years agomacro: handle overflow in ALIGN_TO() somewhat reasonably 20499/head
Lennart Poettering [Fri, 20 Aug 2021 16:11:14 +0000 (18:11 +0200)] 
macro: handle overflow in ALIGN_TO() somewhat reasonably

The helper call rounds up to next multiple of specified boundary. If one
passes a very large value as first argument, then there might not be a
next multiple. So far we ignored that. Let's handle this now and return
SIZE_MAX in this case, as special indicator that we reached the end.

Of course, IRL this should not happen. With this new change we at least
do something somewhat reasonable, leaving it to the caller to handle it
further.

3 years agotest: split out macro tests into own test-macro.c
Lennart Poettering [Fri, 20 Aug 2021 16:28:21 +0000 (18:28 +0200)] 
test: split out macro tests into own test-macro.c

No changes in code, just a split out of tests for stuff from macro.h
into test-macro.c

3 years agoimport-fs: create paren dirs in --direct mode too 20500/head
Lennart Poettering [Fri, 20 Aug 2021 12:22:29 +0000 (14:22 +0200)] 
import-fs: create paren dirs in --direct mode too

There's no reason not to create these in advance if they are missing.