]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoefi: drop spaces between function name and "(" 20614/head
Lennart Poettering [Wed, 1 Sep 2021 12:40:33 +0000 (14:40 +0200)] 
efi: drop spaces between function name and "("

When pulling in the SHA256 implementation from glibc, only some of the
coding style was adjusted to ours, other was not. Let's make things a
bit more consistent.

4 years agoefi: make EFI_GUID generally constant
Lennart Poettering [Wed, 1 Sep 2021 09:33:06 +0000 (11:33 +0200)] 
efi: make EFI_GUID generally constant

The GUIDs we usually deal with should be considered constant. Hence make
them so. Unfortunately the prototypes for various functions doesn't mark
them as const (but still decorates them with "IN", clarifying they are
input-only), hence we need to cast things at various places. We already
cast in similar fashion in many other cases, hence unify things here in
one style.

Making the EFI_GUID constant (and in particular so when specified in C99
compound literal style) allows compilers to merge multiple instances of
them.

4 years agorepart: Support volatile-root for finding the root partition
Kristian Klausen [Wed, 1 Sep 2021 13:59:04 +0000 (15:59 +0200)] 
repart: Support volatile-root for finding the root partition

The automatic logic can't always find the original root partition (ex:
if the rootfs is copied to a ext4 fs backed by zram in the initramfs),
so we want to support "/run/systemd/volatile-root" which is a symlink to
the original root partition.

Fix #20610

4 years agotest: make sure to include all haveged unit files
Franck Bui [Tue, 31 Aug 2021 13:49:43 +0000 (15:49 +0200)] 
test: make sure to include all haveged unit files

Recent versions of haveged relies on haveged-switch-root.service too.

4 years agoMerge pull request #20575 from vcaputo/verify_field_object_hash
Lennart Poettering [Wed, 1 Sep 2021 13:56:05 +0000 (15:56 +0200)] 
Merge pull request #20575 from vcaputo/verify_field_object_hash

sd-journal: verify field object hash

4 years agoudev: do not remove control socket on exit
Yu Watanabe [Tue, 31 Aug 2021 13:32:41 +0000 (22:32 +0900)] 
udev: do not remove control socket on exit

As we usually do, remove old unix socket before bind.

Note that systemd-udevd-control.socket has `RemoveOnStop=yes`.
So, it is not necessary to be removed when the service exits.

Replaces #20584 and #20588.

4 years agoMerge pull request #20537 from yuwata/sd-netlink-more-attributes
Lennart Poettering [Wed, 1 Sep 2021 11:25:54 +0000 (13:25 +0200)] 
Merge pull request #20537 from yuwata/sd-netlink-more-attributes

udev: use link info obtained through netlink

4 years agoMerge pull request #20521 from DaanDeMeyer/analyze-condition-units
Lennart Poettering [Wed, 1 Sep 2021 11:25:31 +0000 (13:25 +0200)] 
Merge pull request #20521 from DaanDeMeyer/analyze-condition-units

analyze: Support passing unit files to systemd-analyze condition

4 years agomkosi: Add zsh to Arch packages 20521/head
Daan De Meyer [Mon, 23 Aug 2021 15:44:58 +0000 (16:44 +0100)] 
mkosi: Add zsh to Arch packages

Useful for testing zsh completion changes.

4 years agomkosi: Install bash-completion in Arch image
Daan De Meyer [Mon, 23 Aug 2021 15:26:46 +0000 (16:26 +0100)] 
mkosi: Install bash-completion in Arch image

Useful for testing bash completion changes.

4 years agomkosi: Add man-db to arch packages
Daan De Meyer [Mon, 23 Aug 2021 13:31:56 +0000 (14:31 +0100)] 
mkosi: Add man-db to arch packages

Required to test systemd-analyze verify.

4 years agopo: Translated using Weblate (Finnish)
Jan Kuparinen [Tue, 31 Aug 2021 20:04:56 +0000 (22:04 +0200)] 
po: Translated using Weblate (Finnish)

Currently translated at 48.6% (92 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

4 years agoMerge pull request #20525 from maanyagoenka/custom-security
Luca Boccassi [Tue, 31 Aug 2021 20:15:41 +0000 (21:15 +0100)] 
Merge pull request #20525 from maanyagoenka/custom-security

systemd-analyze: add option to enable users to custom define security requirements in the form of a .json file

4 years agoupdate TODO
Lennart Poettering [Tue, 31 Aug 2021 15:11:10 +0000 (17:11 +0200)] 
update TODO

4 years agonetwork: print Ethernet Link-Layer DHCP client ID with leading 0's
Alvin Šipraga [Tue, 31 Aug 2021 12:17:33 +0000 (14:17 +0200)] 
network: print Ethernet Link-Layer DHCP client ID with leading 0's

This is a small cosmetic change.

Before:

   Offered DHCP leases: 192.168.0.183 (to 0:9:a7:36:bc:89)

After:

   Offered DHCP leases: 192.168.0.183 (to 00:09:a7:36:bc:89)

4 years agotest: add integration tests for systemd-analyze 20525/head
Maanya Goenka [Wed, 25 Aug 2021 16:44:26 +0000 (09:44 -0700)] 
test: add integration tests for systemd-analyze

4 years agosystemd-analyze: allow parsing of JSON file to obtain custom security requirements...
Maanya Goenka [Mon, 23 Aug 2021 21:21:50 +0000 (14:21 -0700)] 
systemd-analyze: allow parsing of JSON file to obtain custom security requirements for comparison

The 'security' verb of systemd-analyze needs to be able to parse JSON files to be able to read in
the user-defined requirements and use them to determine the overall exposure level of the specified unit
file(s). The JSON files are expected to have a specific format where the keys in the file are the
unit ids consisting of only alphanumeric characters and underscores and the values are JSON objects
again consisting of key value pairs. The keys in these objects may include one or more of the following
properties: description_na, description_good, description_bad, weight, and range. The first three of these
are expected to be strings and the latter two are expected to be unsigned integer values. If one or more
of these properties is missing from the JSON object, then the default values of the properties as specified
in the hard coded set of security directives is used. The other properties that assess() needs to determine
overall exposure levels for a unit file for example, the assess function and parameter type among others,
are not to be included in the JSON files defined by the user because the values assigned to these fields
are expected to be consistent across unit files for each id.

4 years agosystemd-analyze: add new 'security' option to allow user to choose custom requirements
Maanya Goenka [Mon, 23 Aug 2021 21:20:10 +0000 (14:20 -0700)] 
systemd-analyze: add new 'security' option to allow user to choose custom requirements

A new option --security-policy= is added to work with the 'security' verb in order to enable
users to create and pass in a JSON file consisting of user defined requirements
against which to compare the specified unit file(s). These requirements then serve
as the measure of security threats for the file instead of the initial hard coded set of
requirements that the 'security' verb of systemd-analyze relied on.

Example Run:

A snapshot of the user defined testfile.json file is shown below instead of the complete file
for readability purposes.

{
"PrivateDevices":
    {"description_good": "Service has no access to hardware devices",
    "description_bad": "Service potentially has access to hardware devices",
    "weight": 1000,
    "range": 1
    },
"PrivateMounts":
    {"description_good": "Service cannot install system mounts",
    "description_bad": "Service may install system mounts",
    "weight": 1000,
    "range": 1
    },
"PrivateNetwork":
    {"description_good": "Service has no access to the host's network",
    "description_bad": "Service has access to the host's network",
    "weight": 2500,
    "range": 1
    },
"PrivateTmp":
    {"description_good": "Service has no access to other software's temporary files",
    "description_bad": "Service has access to other software's temporary files",
    "weight": 1000,
    "range": 1
    },
"PrivateUsers":
    {"description_good": "Service does not have access to other users",
    "description_bad": "Service has access to other users",
    "weight": 1000,
    "range": 1
    }
}

1. I created the jsontest.service file in order to test the --security-policy= option as follows:

maanya-goenka@debian:~/systemd (custom-security)$ cat<<EOF>jsontest.service
> [Service]
> ExecStart = echo hello
> PrivateNetwork = yes
> PrivateDevices = yes
> PrivateMounts = yes
> EOF

The security analysis table outputted below has been truncated to include only the first few lines for readability.

maanya-goenka@debian:~/systemd (custom-security)$ sudo build/systemd-analyze security --root= --offline=true
--security-policy=src/analyze/testfile.json jsontest.service
/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                                         DESCRIPTION
✓ PrivateNetwork                                               Service has no access to the host's network
✗ UserOrDynamicUser                                            Service runs as root user
✗ CapabilityBoundingSet_CAP_SET_UID_GID_PCAP                   Service may change UID/GID identities/capabilities
✓ PrivateMounts                                                Service cannot install system mounts
✓ PrivateDevices                                               Service has no access to hardware devices

→ Overall exposure level for jsontest.service: 8.3 EXPOSED 🙁

maanya-goenka@debian:~/systemd (custom-security)$ echo $? 0

2. In order to ensure that the JSON data was actually being correctly parsed, I made some changes to the JSON
file, specifically to the id "PrivateNetwork" as follows:

Before:
--------

"PrivateNetwork":
    {"description_good": "Service has no access to the host's network",
    "description_bad": "Service has access to the host's network",
    "weight": 2500,
    "range": 1
    }

After:
--------

"PrivateNetwork":
    {"description_good": "Service runs without access to host network",
    "description_bad": "Service has access to the host's network",
    "weight": 6000,
    "range": 1
    }

As expected, the new description for the description_good field of the Private Network id was updated in
the analysis table outputted below and the overall exposure level of the unit file decreased because
the weight assigned to 'Private Network' (which is set to yes) increased from 2500 to 6000.

maanya-goenka@debian:~/systemd (custom-security)$ sudo build/systemd-analyze security --root= --offline=true
--security-policy=src/analyze/testfile.json jsontest.service

/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                                         DESCRIPTION
✓ PrivateNetwork                                               Service runs without access to the host's network
✗ UserOrDynamicUser                                            Service runs as root user
✗ CapabilityBoundingSet_CAP_SET_UID_GID_PCAP                   Service may change UID/GID identities/capabilities
✓ PrivateMounts                                                Service cannot install system mounts
✓ PrivateDevices                                               Service has no access to hardware devices

→ Overall exposure level for jsontest.service: 7.8 EXPOSED 🙁

maanya-goenka@debian:~/systemd (custom-security)$ echo $? 0

3. When paired with security's --threshold= option, systemd-analyze exits with a non-zero error status indicating
that the overall exposure level for the unit file (=78) is greater than the set threshold (=70). The same
jsontest.service file is used for the demo run below:

maanya-goenka@debian:~/systemd (custom-security)$ sudo build/systemd-analyze security --root= --offline=true
--security-policy=src/analyze/testfile.json --threshold=70 jsontest.service

/usr/lib/systemd/system/plymouth-start.service:15: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's
process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'.
Support for KillMode=none is deprecated and will eventually be removed.
/usr/lib/systemd/system/gdm.service:30: Standard output type syslog is obsolete, automatically updating to journal. Please update your
unit file, and consider removing the setting altogether.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating
/var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.

  NAME                                                         DESCRIPTION
✓ PrivateNetwork                                               Service runs without access to host network
✗ UserOrDynamicUser                                            Service runs as root user
✗ CapabilityBoundingSet_CAP_SET_UID_GID_PCAP                   Service may change UID/GID identities/capabilities
✓ PrivateMounts                                                Service cannot install system mounts
✓ PrivateDevices                                               Service has no access to hardware devices

→ Overall exposure level for jsontest.service: 7.8 EXPOSED 🙁

maanya-goenka@debian:~/systemd (custom-security)$ echo $? 1

new option

4 years agoudev: use link information obtained through netlink 20537/head
Yu Watanabe [Mon, 30 Aug 2021 15:41:36 +0000 (00:41 +0900)] 
udev: use link information obtained through netlink

4 years agoudev: introduce link_info_get()
Yu Watanabe [Fri, 27 Aug 2021 08:02:59 +0000 (17:02 +0900)] 
udev: introduce link_info_get()

4 years agoudev: rename struct netnames -> NetNames
Yu Watanabe [Mon, 23 Aug 2021 17:22:12 +0000 (02:22 +0900)] 
udev: rename struct netnames -> NetNames

4 years agoudev: use passed rtnl in net_setup_link builtin command
Yu Watanabe [Sun, 29 Aug 2021 23:30:12 +0000 (08:30 +0900)] 
udev: use passed rtnl in net_setup_link builtin command

4 years agoudev: pass rtnl to builtin commands
Yu Watanabe [Sun, 29 Aug 2021 23:20:05 +0000 (08:20 +0900)] 
udev: pass rtnl to builtin commands

4 years agoudev: simplify get_virtfn_info()
Yu Watanabe [Fri, 27 Aug 2021 08:53:27 +0000 (17:53 +0900)] 
udev: simplify get_virtfn_info()

4 years agoMerge pull request #20592 from poettering/homed-fix-smb
Lennart Poettering [Tue, 31 Aug 2021 12:20:53 +0000 (14:20 +0200)] 
Merge pull request #20592 from poettering/homed-fix-smb

various fixes to make homed's smb backend work correctly again

4 years agoudev: drop redundant chase_symlinks()
Yu Watanabe [Fri, 27 Aug 2021 08:36:22 +0000 (17:36 +0900)] 
udev: drop redundant chase_symlinks()

`sd_device_new_from_syspath()` internally calls chase_symlinks().

4 years agoudev: fix potential memleak
Yu Watanabe [Fri, 27 Aug 2021 08:27:26 +0000 (17:27 +0900)] 
udev: fix potential memleak

4 years agosd-netlink: introduce sd_netlink_message_get_max_attribute()
Yu Watanabe [Fri, 27 Aug 2021 07:30:19 +0000 (16:30 +0900)] 
sd-netlink: introduce sd_netlink_message_get_max_attribute()

4 years agosd-netlink: specify appropriate netlink attribute type
Yu Watanabe [Wed, 25 Aug 2021 16:29:21 +0000 (01:29 +0900)] 
sd-netlink: specify appropriate netlink attribute type

4 years agosd-netlink: support more rtnl attributes
Yu Watanabe [Wed, 25 Aug 2021 16:20:39 +0000 (01:20 +0900)] 
sd-netlink: support more rtnl attributes

4 years agobasic/linux: add more bridge headers
Yu Watanabe [Wed, 25 Aug 2021 07:52:32 +0000 (16:52 +0900)] 
basic/linux: add more bridge headers

4 years agonetwork/netdev: append IFLA_INFO_DATA attribute only when it is necessary
Yu Watanabe [Wed, 25 Aug 2021 16:05:11 +0000 (01:05 +0900)] 
network/netdev: append IFLA_INFO_DATA attribute only when it is necessary

4 years agotmpfiles.d: remove .Test-unix, it's obsolete
Peter Hutterer [Tue, 31 Aug 2021 05:20:12 +0000 (15:20 +1000)] 
tmpfiles.d: remove .Test-unix, it's obsolete

See libxtrans commit 0794b1b712a90b40e2b019c9edc6f96874493c52. The code
to generate this socket was removed 5 years ago and even before it was
conditional on #define TEST_t. There is no reference to that #define in
either the X server nor libX11's git history, or in any of the current
libX*.

Let's assume this is well and truly obsolete.

4 years agohomed: remove misplaced assert() 20592/head
Lennart Poettering [Tue, 31 Aug 2021 08:47:40 +0000 (10:47 +0200)] 
homed: remove misplaced assert()

4 years agohomed: add missing SYNTHETIC_ERRNO()
Lennart Poettering [Tue, 31 Aug 2021 08:47:29 +0000 (10:47 +0200)] 
homed: add missing SYNTHETIC_ERRNO()

4 years agohomed: fix log message referring to fsck, when we actually mean mount
Lennart Poettering [Tue, 31 Aug 2021 08:47:02 +0000 (10:47 +0200)] 
homed: fix log message referring to fsck, when we actually mean mount

4 years agohomed: make sure to use right asssesors for GID + access mode
Lennart Poettering [Tue, 31 Aug 2021 08:46:06 +0000 (10:46 +0200)] 
homed: make sure to use right asssesors for GID + access mode

Don't reach directly into the UserRecord struct, but use the right
assessors, so that the "unspecified" case is covered.

4 years agohomed: add missing capabilities for SMB/CIFS backend
Lennart Poettering [Tue, 31 Aug 2021 08:04:06 +0000 (10:04 +0200)] 
homed: add missing capabilities for SMB/CIFS backend

In 2020 mount.cifs started to require a bunch for caps to work. let's
add them to the capability bounding set.

Also, SMB support obviously needs network access, hence open that up.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1962920
4 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

4 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

4 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

4 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

4 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.

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

4 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

4 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
4 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

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

4 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.

4 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)

4 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

4 years agosd-journal: verify field object hashes 20575/head
Vito Caputo [Mon, 30 Aug 2021 05:22:05 +0000 (22:22 -0700)] 
sd-journal: verify field object hashes

journal_file_verify() doesn't actually verify field object hashes
against their contents, despite journald storing a hash with the
payload.  This commit adds that verification.

4 years agosd-journal: move payload hashing to helper function
Vito Caputo [Mon, 30 Aug 2021 05:15:39 +0000 (22:15 -0700)] 
sd-journal: move payload hashing to helper function

Preparatory commit for adding field object hash verification to
journal_file_verify() / `journalctl --verify`

4 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

4 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

4 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.

4 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.

4 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()

4 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.

4 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

4 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.

4 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()

4 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

4 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

4 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.

4 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()

4 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

4 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

4 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

4 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.

4 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

4 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.

4 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

4 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.

4 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

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

4 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

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

4 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

4 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.

4 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.

4 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

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

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

4 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.

4 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.

4 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

4 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

4 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

4 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

4 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

4 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.

4 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;
...
```

4 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>
4 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.

4 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().

4 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.

4 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

4 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

4 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