]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoresolved: randomize RR order in answers each time we get something from the cache 18565/head
Lennart Poettering [Thu, 5 Nov 2020 13:10:40 +0000 (14:10 +0100)] 
resolved: randomize RR order in answers each time we get something from the cache

This allows some minimal, crappy load balancing.

Fixes: #16297
4 years agoanswer: minor refactor – move link local check into RR code
Lennart Poettering [Thu, 5 Nov 2020 12:34:22 +0000 (13:34 +0100)] 
answer: minor refactor – move link local check into RR code

4 years agoanswer: add helper for randomizing RR of answers
Lennart Poettering [Thu, 5 Nov 2020 12:33:52 +0000 (13:33 +0100)] 
answer: add helper for randomizing RR of answers

4 years agorandom-util: add random_u64_range() that acquires a random number from a certain...
Lennart Poettering [Wed, 11 Nov 2020 13:44:35 +0000 (14:44 +0100)] 
random-util: add random_u64_range() that acquires a random number from a certain range, unbiased

So far we have been quite sloppy with this and ignored modulus and range
bias. Let's do something about, and add the option to do better.

4 years agoNEWS: add a note about no longer probind mmcblk*boot*
Luca Boccassi [Sat, 13 Feb 2021 16:05:51 +0000 (16:05 +0000)] 
NEWS: add a note about no longer probind mmcblk*boot*

4 years agoNEWS: fix typo: as → at
Ansgar Burchardt [Sat, 13 Feb 2021 15:04:55 +0000 (16:04 +0100)] 
NEWS: fix typo: as → at

4 years agono blkid for mmcblk[0-9]boot[0-9]
Alan Perry [Sat, 13 Feb 2021 03:08:28 +0000 (19:08 -0800)] 
no blkid for mmcblk[0-9]boot[0-9]

Don't run blkid on mmcblk[0-9]boot[0-9] devices because they contain
bootloaders or boot parameters, and not partitions or file systems.

4 years agoMerge pull request #18401 from anitazha/oomdxattr
Zbigniew Jędrzejewski-Szmek [Sat, 13 Feb 2021 09:00:31 +0000 (10:00 +0100)] 
Merge pull request #18401 from anitazha/oomdxattr

oomd: implement avoid/omit support for cgroups

4 years agoAdded Trekstor Yourbook C11B to 60-sensor.hwdb
Nick [Fri, 12 Feb 2021 16:57:26 +0000 (16:57 +0000)] 
Added Trekstor Yourbook C11B to 60-sensor.hwdb

Added the Trekstor Yourbook C11B which is equivalent to Trekstor Primebook C11B.

4 years agoudev: make net_setup_link builtin quiet when link vanishes while we operate on it
Lennart Poettering [Fri, 12 Feb 2021 20:16:27 +0000 (21:16 +0100)] 
udev: make net_setup_link builtin quiet when link vanishes while we operate on it

Fixes: #16175
4 years agocore: slightly improve error message on load errors
Lennart Poettering [Fri, 12 Feb 2021 22:39:49 +0000 (23:39 +0100)] 
core: slightly improve error message on load errors

Let's be a bit more helpful when refusing jobs on units that failed to
load properly. We already have explicit D-Bus errors for the error
conditions that are common and expected (such as "not found"), but for
the rest we so far generate a fairly cryptic message.

Let's try to be friendlier towards users and suggest what to do on such
errors.

Fixes: #16487
4 years agoMerge pull request #18555 from yuwata/network-address-set-flag-on-remove
Yu Watanabe [Sat, 13 Feb 2021 08:44:58 +0000 (17:44 +0900)] 
Merge pull request #18555 from yuwata/network-address-set-flag-on-remove

network: address: also set IFA_FLAGS on remove

4 years agoMerge pull request #18455 from yuwata/network-change-link-state-only-when-new-address...
Yu Watanabe [Sat, 13 Feb 2021 08:43:27 +0000 (17:43 +0900)] 
Merge pull request #18455 from yuwata/network-change-link-state-only-when-new-address-or-route-will-be-assigned

network: change link state only when new address or route will be assigned

4 years agoNEWS: mention new systemctl verb and fix typo
Luca Boccassi [Fri, 12 Feb 2021 23:34:35 +0000 (23:34 +0000)] 
NEWS: mention new systemctl verb and fix typo

4 years agoman: document ManagedOOMPreference= 18401/head
Anita Zhang [Fri, 29 Jan 2021 01:35:17 +0000 (17:35 -0800)] 
man: document ManagedOOMPreference=

4 years agooom: add unit file settings for oomd avoid/omit xattrs
Anita Zhang [Thu, 28 Jan 2021 10:31:44 +0000 (02:31 -0800)] 
oom: add unit file settings for oomd avoid/omit xattrs

4 years agoMerge pull request #18568 from keszybz/v248-prep
Lennart Poettering [Fri, 12 Feb 2021 20:43:31 +0000 (21:43 +0100)] 
Merge pull request #18568 from keszybz/v248-prep

Start preparing for v238-rc1

4 years agoresolved: never route DNSSEC traffic to LLMNR/mDNS
Lennart Poettering [Tue, 3 Nov 2020 19:07:02 +0000 (20:07 +0100)] 
resolved: never route DNSSEC traffic to LLMNR/mDNS

LLMNR/mDNS don't support DNSSEC, hence there's no point in routing any
lookups asking for DNSSEC there.

This speeds up looking up DNSSEC RRs for top-level domains, since we
don't have to wait for LLMNR to complete.

4 years agoNEWS: start preparing for v248 18568/head
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 17:50:41 +0000 (18:50 +0100)] 
NEWS: start preparing for v248

4 years agohwdb: update for v248
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:15:53 +0000 (16:15 +0100)] 
hwdb: update for v248

As usual, it seems to be additions and updates, no major removals.

4 years agosyscall-tables: add missing preposition and fix file name path
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:29:26 +0000 (16:29 +0100)] 
syscall-tables: add missing preposition and fix file name path

I added an extension in 1f6f8cc8039a204609ddab79791ef22ee6340da0 but
forgot to fix the consumer script.

4 years agoMerge pull request #18558 from poettering/have-tpm2
Lennart Poettering [Fri, 12 Feb 2021 14:49:20 +0000 (15:49 +0100)] 
Merge pull request #18558 from poettering/have-tpm2

ask the uefi firmware if TPM2 support is available

4 years agotest-network: merge test_address_static and test_address_preferred_lifetime_zero_ipv6 18555/head
Yu Watanabe [Fri, 12 Feb 2021 06:01:20 +0000 (15:01 +0900)] 
test-network: merge test_address_static and test_address_preferred_lifetime_zero_ipv6

4 years agonetwork: address: do not set IFA_F_PERMANENT flag
Yu Watanabe [Fri, 12 Feb 2021 05:44:42 +0000 (14:44 +0900)] 
network: address: do not set IFA_F_PERMANENT flag

The flag is automatically set by kernel when the valid lifetime is
infinite. Note that the flag in netlink message for IPv4 address is
ignored. See set_ifa_lifetime() in kernel's net/ipv4/devinet.c.
But the flag is honored for IPv6 address. And if the flag is set with
finite valid lifetime, the address will not removed automatically by
the kernel.

4 years agonetwork: address: also set IFA_FLAGS on remove
Yu Watanabe [Thu, 11 Feb 2021 17:56:43 +0000 (02:56 +0900)] 
network: address: also set IFA_FLAGS on remove

If an address is assigned with IFA_F_MANAGETEMPADDR, then the flag must
be also set on remove. Otherwise, temporary addresses will not be
removed. See also inet6_rtm_deladdr() in kernel's net/ipv6/addrconf.c.

Fixes #13218.

4 years agonetwork: dhcp6: change link state into "configuring" only when a new address or route... 18455/head
Yu Watanabe [Wed, 3 Feb 2021 16:00:59 +0000 (01:00 +0900)] 
network: dhcp6: change link state into "configuring" only when a new address or route will be assigned

4 years agonetwork: ndisc: change link state into "configuring" only when a new address or route...
Yu Watanabe [Wed, 3 Feb 2021 16:00:42 +0000 (01:00 +0900)] 
network: ndisc: change link state into "configuring" only when a new address or route will be assigned

4 years agonetwork: dhcp6: fix condtion check
Yu Watanabe [Wed, 3 Feb 2021 15:52:28 +0000 (00:52 +0900)] 
network: dhcp6: fix condtion check

4 years agonetwork: set return value at the end of the function
Yu Watanabe [Wed, 3 Feb 2021 15:44:03 +0000 (00:44 +0900)] 
network: set return value at the end of the function

The later netlink_call_async() call may fail. We should not touch the
return value when the function failed.

4 years agonetwork: make address_configure() or friends return 1 when the address is new
Yu Watanabe [Wed, 3 Feb 2021 15:40:08 +0000 (00:40 +0900)] 
network: make address_configure() or friends return 1 when the address is new

4 years agoMerge pull request #18544 from yuwata/tree-wide-use-error-in-xxx_from_string
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 11:16:23 +0000 (12:16 +0100)] 
Merge pull request #18544 from yuwata/tree-wide-use-error-in-xxx_from_string

tree-wide: use error in xxx_from_string()

4 years agoMerge pull request #18554 from yuwata/network-address-set-NLM_F_REPLACE-flag-automati...
Yu Watanabe [Fri, 12 Feb 2021 04:47:58 +0000 (13:47 +0900)] 
Merge pull request #18554 from yuwata/network-address-set-NLM_F_REPLACE-flag-automatically

network: automatically set NLM_F_REPLACE flag

4 years agocondition: if spelunking through /sys/class/tpmrm doesn't work ask EFI if TPM2 exists 18558/head
Lennart Poettering [Thu, 11 Feb 2021 22:12:46 +0000 (23:12 +0100)] 
condition: if spelunking through /sys/class/tpmrm doesn't work ask EFI if TPM2 exists

This makes ConditionSecurity=tpm2 work reliably during early boot: if
Linux doesn't know about the TPM2 then maybe the firmware does.

4 years agobootctl: show whether the firmware has TPM2 support
Lennart Poettering [Thu, 11 Feb 2021 22:11:56 +0000 (23:11 +0100)] 
bootctl: show whether the firmware has TPM2 support

4 years agoefi-loader: add efi_has_tpm2() helper
Lennart Poettering [Thu, 11 Feb 2021 22:10:07 +0000 (23:10 +0100)] 
efi-loader: add efi_has_tpm2() helper

The helper checks if the UEFI firmware is hooked up to a TPM2 chip. This
is useful to know in trusted boot scenarios, in particular during early
boot in auto-enroll scenarios where we want to know whether TPM2 is
available or not, and the Linux drivers are not loaded yet, and where it
might or not be worth waiting for it.

4 years agoefivars: debug log if we fail to detect whether /sys/firmware/efi/ exists
Lennart Poettering [Thu, 11 Feb 2021 22:09:54 +0000 (23:09 +0100)] 
efivars: debug log if we fail to detect whether /sys/firmware/efi/ exists

4 years agotree-wide: use free_and_strdup_warn() 18544/head
Yu Watanabe [Wed, 10 Feb 2021 20:48:10 +0000 (05:48 +0900)] 
tree-wide: use free_and_strdup_warn()

4 years agonetwork: automatically set NLM_F_REPLACE flag 18554/head
Yu Watanabe [Tue, 9 Feb 2021 16:20:37 +0000 (01:20 +0900)] 
network: automatically set NLM_F_REPLACE flag

The difference between sd_rtnl_message_new_addr() and
sd_rtnl_message_new_addr_update() is only whether NLM_F_REPLACE flag
will be set or not.

If an address is already assigned, then we need to set NLM_F_REPLACE
flag, otherwise, address_configure() will be fail.

This makes address_configure() judge whether we should use the flag or
not.

4 years agonetwork: address: also logs preferred lifetime
Yu Watanabe [Tue, 9 Feb 2021 15:50:24 +0000 (00:50 +0900)] 
network: address: also logs preferred lifetime

4 years agotree-wide: propagate error in xxx_from-string()
Yu Watanabe [Wed, 10 Feb 2021 20:21:42 +0000 (05:21 +0900)] 
tree-wide: propagate error in xxx_from-string()

4 years agonetwork: dhcp: use string table
Yu Watanabe [Wed, 10 Feb 2021 20:06:19 +0000 (05:06 +0900)] 
network: dhcp: use string table

4 years agostring-table: introduce DEFINE_STRING_TABLE_LOOKUP_FROM_STRING()
Yu Watanabe [Wed, 10 Feb 2021 20:19:18 +0000 (05:19 +0900)] 
string-table: introduce DEFINE_STRING_TABLE_LOOKUP_FROM_STRING()

4 years agonetwork: route: use _WITH_FALLBACK macros
Yu Watanabe [Wed, 10 Feb 2021 19:52:42 +0000 (04:52 +0900)] 
network: route: use _WITH_FALLBACK macros

4 years agonetworkd: lldp: use string table
Yu Watanabe [Wed, 10 Feb 2021 19:34:14 +0000 (04:34 +0900)] 
networkd: lldp: use string table

4 years agostring-table: introduce DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN()
Yu Watanabe [Wed, 10 Feb 2021 19:42:33 +0000 (04:42 +0900)] 
string-table: introduce DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN()

4 years agotree-wide: use error codes in xxx_from_string()
Yu Watanabe [Wed, 10 Feb 2021 19:21:46 +0000 (04:21 +0900)] 
tree-wide: use error codes in xxx_from_string()

4 years agoconf-parser: use return codes in xxx_from_string()
Yu Watanabe [Wed, 10 Feb 2021 18:27:22 +0000 (03:27 +0900)] 
conf-parser: use return codes in xxx_from_string()

Follow-up for #11484.

4 years agoMerge pull request #18550 from keszybz/coverity-inspired-fixes
Luca Boccassi [Thu, 11 Feb 2021 15:44:25 +0000 (15:44 +0000)] 
Merge pull request #18550 from keszybz/coverity-inspired-fixes

Coverity inspired fixes

4 years agoMerge pull request #17902 from bugaevc/fix-container-detection
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 11:56:01 +0000 (12:56 +0100)] 
Merge pull request #17902 from bugaevc/fix-container-detection

improve container detection

4 years agohomework: fix unitialized variable 18550/head
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 11:00:09 +0000 (12:00 +0100)] 
homework: fix unitialized variable

Coverity CID#1444703.

4 years agohomework: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 10:59:22 +0000 (11:59 +0100)] 
homework: reduce scope of iterator variables

4 years agobasic/locale-util: reduce variable scope
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:55:01 +0000 (09:55 +0100)] 
basic/locale-util: reduce variable scope

4 years agofsck: make sure we don't read an unitialized variable
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:50:49 +0000 (09:50 +0100)] 
fsck: make sure we don't read an unitialized variable

This use on %n was completely unnecessary: fprintf returns the number of
characters written. And the issue was that if fprintf failed for whatever
reason, it would not process the %n and m would be unitialized. Rework the
code a bit to simplify it.

Coverity CID#1444708.

4 years agosd-journal: add forgotten unmap in error path
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:35:52 +0000 (09:35 +0100)] 
sd-journal: add forgotten unmap in error path

Bug introduced in 4b5bc5396c090ee41c45cab9052372d296c4a2f4 :(

Coverity CID#1444709.

4 years agoshared/generator: add missing initializer
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:23:22 +0000 (09:23 +0100)] 
shared/generator: add missing initializer

Coverity CID#1444710.

4 years agoudev: add assert to make coverity happy
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:17:46 +0000 (09:17 +0100)] 
udev: add assert to make coverity happy

Coverity says:
CID 1446387 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
8. negative_shift: In expression 1U << (int)cmd, shifting by a negative amount
has undefined behavior. The shift amount, cmd, is -22.

I don't think there's any issue, unless we forget to set token->data
appropriately. Let's add an assert.

4 years agoMerge pull request #18545 from poettering/netlink-seqno-fix
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 07:24:39 +0000 (08:24 +0100)] 
Merge pull request #18545 from poettering/netlink-seqno-fix

sd-netlink seqnum fixes

4 years agonetworkd: add UseFQDN option for DHCPv6
Vinnie Magro [Fri, 29 Jan 2021 00:24:34 +0000 (16:24 -0800)] 
networkd: add UseFQDN option for DHCPv6

Similar to DHCPv4's UseHostname option, add a UseFQDN config option in
[DHCPv6] to set the system's transient hostname if the FQDN option is
set in the DHCPv6 response from the server.

4 years agoMerge pull request #17823 from poettering/resolved-just-bypass
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 23:10:25 +0000 (00:10 +0100)] 
Merge pull request #17823 from poettering/resolved-just-bypass

resolved: just the dnssec bypass logic

4 years agosd-netlink: spread out sequence numbers a bit 18545/head
Lennart Poettering [Wed, 10 Feb 2021 22:05:51 +0000 (23:05 +0100)] 
sd-netlink: spread out sequence numbers a bit

An (imperfect) fix for #14760.

This makes collisions unlikely, but still theoretically possible.

Fixes: #14760
4 years agosd-netlink: reduce indentation levels a bit
Lennart Poettering [Wed, 10 Feb 2021 17:12:58 +0000 (18:12 +0100)] 
sd-netlink: reduce indentation levels a bit

4 years agosd-netlink: use getsockopt_int() where appropriate
Lennart Poettering [Wed, 10 Feb 2021 17:11:20 +0000 (18:11 +0100)] 
sd-netlink: use getsockopt_int() where appropriate

4 years agosd-netlink: revamp message serial handling
Lennart Poettering [Wed, 10 Feb 2021 16:59:46 +0000 (17:59 +0100)] 
sd-netlink: revamp message serial handling

Let's use uint32_t everywhere to maintain the seqno, since that's what
the kernel does. Prviously in the reply_callback logic we used 64bit,
for no apparent reason.

Using 32bit also provides us with the benefit that we can avoid using
uint64_hash_ops, and can use trivial_hash_ops instead for the reply
hashmap, so that we can store the seqno in the key pointer directly.

While we are at it, let's make sure we never run into serial collisions
internally (32bit is a lot, but not that much), and let's put a limit on
outstanding serials, to catch programming errors.

4 years agotmpfiles: explicitly say we need /proc/ to run
Lennart Poettering [Wed, 10 Feb 2021 16:11:34 +0000 (17:11 +0100)] 
tmpfiles: explicitly say we need /proc/ to run

I don't think it's realistic to operate without /proc/. Hence, let's
make this explicit.

If one day someone finds a way to do what we need without /proc/ we can
certainly drop this check again, but for now I think it's a lot
friendlier to users to make this explicitly early on instead continuing
to run and then not do what we need to do, oftentimes failing in cryptic
ways.

After all, invoking the tool without /proc/ is not an error that was
specific to some of the lines we process, but it's systematic error that
will show its ugly face in many codepaths down the line.

Fixes: #14745
4 years agonetwork: use SD_BUS_METHOD_WITH_ARGS() macro
Yu Watanabe [Wed, 10 Feb 2021 16:32:01 +0000 (01:32 +0900)] 
network: use SD_BUS_METHOD_WITH_ARGS() macro

4 years agocore: improve log message when unit deactivates cleanly
Lennart Poettering [Wed, 10 Feb 2021 15:15:20 +0000 (16:15 +0100)] 
core: improve log message when unit deactivates cleanly

Whenever a unit deactivates sucessfully we so far generated a message
"unit xyz: succeeded". This is a bit confusing, since various unit types
cannot really "succeed", e.g. a device unit can't really "suceed", not
can a swap unit. In particular in the latter case people would probably
assume that a swap unit that "suceeded" would actually mean a swap was
active now, but the opposite is actually true.

Let's improve this by saying "Deactivated successfully", which hopefully
clears this up.

(I thought about saying "terminated" or "completed" or "finished" or so
instead, but that too doesn#t make sense if you think about unit types
like swaps or devices.)

4 years agoMerge pull request #18440 from bluca/portable_upgrade
Lennart Poettering [Wed, 10 Feb 2021 20:26:14 +0000 (21:26 +0100)] 
Merge pull request #18440 from bluca/portable_upgrade

portable: add 'reattach' verb and DBUS interface

4 years agotmpfiles: v/q/Q: Add env var to skip check for rootfs in subvolume
Adrian Vovk [Tue, 9 Feb 2021 21:20:32 +0000 (16:20 -0500)] 
tmpfiles: v/q/Q: Add env var to skip check for rootfs in subvolume

4 years agovirt: detect cgroups namespaces 17902/head
Sergey Bugaev [Sun, 20 Dec 2020 11:43:01 +0000 (14:43 +0300)] 
virt: detect cgroups namespaces

detect_container() is now able to detect if we're running in a cgroup namespace.

4 years agovirt: detect Docker and Podman containers
Sergey Bugaev [Sat, 19 Dec 2020 18:00:22 +0000 (21:00 +0300)] 
virt: detect Docker and Podman containers

Docker doesn't set $container, so it cannot be detected that way. Instead, we
check for presence of /.dockerinit, which it creates. Podman does set
$container, but some Red Hat images (in particular, Fedora images) override
$container to equal "oci". So to correctly detect Podman containers, we check
for presence of /run/.containerenv, which is created by Podman and is now the
official way to get information about the container from within the container.

Fixes https://github.com/systemd/systemd/issues/15393

4 years agoportable: add 'reattach' verb and DBUS interface 18440/head
Luca Boccassi [Mon, 1 Feb 2021 14:29:40 +0000 (14:29 +0000)] 
portable: add 'reattach' verb and DBUS interface

Add 'reattach' verb to portablectl, and corresponding DBUS interface
to systemd-portabled.
Takes the same parameters as 'attach', but it will do a 'detach' (and
it will refuse to proceed if it cannot be done) first, matching on
the unversioned prefix of the new image. Eg:

portablectl reattach /tmp/foo_2.raw

will cause foo_1.raw to be detached, and foo_2.raw to be attached.

The key difference with a manual 'detach old' plus 'attach new' is that
the running units are not disturbed until after the attach completed,
and if --now is passed they are then restarted.
A 'detach' is not allowed normally if the units are running.

By using a restart-after-deploy method, 'reattach' allows for minimal
interruption of service and also for features that only work on restart
(eg: file descriptor store) to work as intended.

The DBUS interface returns two lists: first the removals from the detach
that were not immediately re-added in the attach, so that the caller
can stop the relevant units, and then the list of additions that are
either new or updates, so that the caller can restart/enable the
relevant units. portablectl already implements this with the existing
--now/--enable switches.

4 years agoportable: allow Detach to match images with different version suffixes
Luca Boccassi [Fri, 5 Feb 2021 21:24:54 +0000 (21:24 +0000)] 
portable: allow Detach to match images with different version suffixes

4 years agotest: setup var/tmp in the test image as well
Luca Boccassi [Tue, 2 Feb 2021 21:13:44 +0000 (21:13 +0000)] 
test: setup var/tmp in the test image as well

4 years agotest: add empty /etc/resolv.conf in test image
Luca Boccassi [Tue, 2 Feb 2021 17:16:41 +0000 (17:16 +0000)] 
test: add empty /etc/resolv.conf in test image

Portable services have a BindPath pointing to it, so it needs to
be available in the image

4 years agotest-50-dissect: move minimal image setup to common setup function
Luca Boccassi [Fri, 28 Aug 2020 13:17:31 +0000 (14:17 +0100)] 
test-50-dissect: move minimal image setup to common setup function

So that it can be re-used for other tests by simply setting
TEST_INSTALL_VERITY_MINIMAL=1 in test.sh, without having to
replicate the setup commands.

4 years agoMerge pull request #18542 from yuwata/bash-completion-update
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 18:31:11 +0000 (19:31 +0100)] 
Merge pull request #18542 from yuwata/bash-completion-update

bash-completion: add missing options

4 years agoMerge pull request #18536 from poettering/uid-refs-simplify
Yu Watanabe [Wed, 10 Feb 2021 18:18:15 +0000 (03:18 +0900)] 
Merge pull request #18536 from poettering/uid-refs-simplify

dynamic uid/gid reference handling simplifications

4 years agoMerge pull request #11484 from keszybz/udevadm-error-logs
Yu Watanabe [Wed, 10 Feb 2021 18:17:47 +0000 (03:17 +0900)] 
Merge pull request #11484 from keszybz/udevadm-error-logs

Use real return codes in _from_string() functions

4 years agobash-completion: loginctl: add -P option 18542/head
Yu Watanabe [Wed, 10 Feb 2021 17:50:41 +0000 (02:50 +0900)] 
bash-completion: loginctl: add -P option

4 years agobash-completion: coredumpctl: add --json and -n options
Yu Watanabe [Wed, 10 Feb 2021 17:50:22 +0000 (02:50 +0900)] 
bash-completion: coredumpctl: add --json and -n options

4 years agotest: count call instructions as well
Frantisek Sumsal [Wed, 10 Feb 2021 09:16:09 +0000 (10:16 +0100)] 
test: count call instructions as well

Binaries on the latest Arch Linux use `call` instructions instead of
`callq`, which breaks the ASan detection and eventually the image
building process (due to insufficient space).

4 years agoTranslations update from Weblate (#18537)
Weblate (bot) [Wed, 10 Feb 2021 15:55:41 +0000 (16:55 +0100)] 
Translations update from Weblate (#18537)

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
4 years agoci: build on Fedora ELN as well
Frantisek Sumsal [Wed, 10 Feb 2021 14:06:40 +0000 (15:06 +0100)] 
ci: build on Fedora ELN as well

ELN builds with a slightly different content set and RHEL-like options,
which should, theoretically, help a bit with RHEL stuff.

4 years agoMerge pull request #18506 from keszybz/fuzz-systemctl-parse-argv
Yu Watanabe [Wed, 10 Feb 2021 15:29:22 +0000 (00:29 +0900)] 
Merge pull request #18506 from keszybz/fuzz-systemctl-parse-argv

Fuzzer for systemctl argline parsing

4 years agoMerge pull request #18521 from poettering/coredumpctl-table
Lennart Poettering [Wed, 10 Feb 2021 14:58:56 +0000 (15:58 +0100)] 
Merge pull request #18521 from poettering/coredumpctl-table

coredumpctl improvements (mostly about table formatting)

4 years agocore: fix manager_ref_gid() parameter name in header 18536/head
Lennart Poettering [Wed, 10 Feb 2021 14:47:56 +0000 (15:47 +0100)] 
core: fix manager_ref_gid() parameter name in header

It should match what we do for manager_ref_uid() and in the .c file.

4 years agomanager: simplify uid-ref/gid-ref a code a bit
Lennart Poettering [Wed, 10 Feb 2021 14:46:47 +0000 (15:46 +0100)] 
manager: simplify uid-ref/gid-ref a code a bit

Let's drop unused function arguments, and needless double pointers where
we can.

no actual change in behaviour, just simplifications

(I tried to track down #14026 without success, and this came out of it)

4 years agotest-string-util: add missing comma 11484/head
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 07:00:33 +0000 (08:00 +0100)] 
test-string-util: add missing comma

Coverity CID#1446368.

4 years agoresolved: rework a few functions to return early on error
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 08:55:39 +0000 (10:55 +0200)] 
resolved: rework a few functions to return early on error

The implementation is a bit ugly because we set the output variable
twice. But we were already doing this on error, so this is not
significantly worse. Doing this allows us to avoid goto's, and the
compiler should be able to figure this out and only set once.

4 years agomachinectl: write arg_* only after verifying the value
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:07:19 +0000 (16:07 +0100)] 
machinectl: write arg_* only after verifying the value

4 years agotree-wide: propagate error code from _from_string() functions
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:06:36 +0000 (16:06 +0100)] 
tree-wide: propagate error code from _from_string() functions

Now that we know we have something useful, no need to make an answer up.

4 years agoReturn -EINVAL from _from_string() functions
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 15:26:31 +0000 (16:26 +0100)] 
Return -EINVAL from _from_string() functions

We'd return -1 (-EPERM), even though we have a general rule to use real errno
values. The particular case that caught my attention was:

$ sudo udevadm control -l asdf
Failed to parse log priority 'asdf': Operation not permitted

... but "git grep 'r =.*_from_string' src/" return 110 hits. Confusingly, some
of the _from_string functions already return a proper errno value, so not all
of those are broken, but probably quite a few.

4 years agotree-wide: use -EINVAL for enum invalid values
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:17:47 +0000 (17:17 +0100)] 
tree-wide: use -EINVAL for enum invalid values

As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617.

This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.

Note that tests are broken after this commit. They will be fixed in the next one.

4 years agoudev: make sure UdevBuiltinCommand is properly converted
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 07:32:23 +0000 (08:32 +0100)] 
udev: make sure UdevBuiltinCommand is properly converted

4 years agosd-bus: drop some bitfields in sd_bus_slot
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 13:03:10 +0000 (14:03 +0100)] 
sd-bus: drop some bitfields in sd_bus_slot

A hole was/is present after the booleans, so changing them to be one byte each
doesn't change the structure size (122 bits on amd64). If we add more stuff
later, it might make sense to turn some of those into bitfields again. For now,
let's take the easy route. EINVAL fits into type now.

Code size it minimally reduced:
-rwxrwxr-x 1 zbyszek zbyszek 4109792 Feb 10 14:00 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek 4109712 Feb 10 14:01 build/libsystemd.so.0.30.0

4 years agogithub: expressly ask for logs in github issue template
Lennart Poettering [Wed, 10 Feb 2021 13:11:44 +0000 (14:11 +0100)] 
github: expressly ask for logs in github issue template

Apparently it's not obvious that logs are a good thing to provide, hence
let's explicitly ask for them.

4 years agosd-netlink: pahole optimization of sd_netlink_slot
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 18:51:50 +0000 (19:51 +0100)] 
sd-netlink: pahole optimization of sd_netlink_slot

By rearranging the fields, we can avoid one of the holes (on amd64).
By adding more space for .type, -EINVAL can be used as a value later on.
The structure is reduced from 96 to 88 bytes (on amd64).

Text size is also smaller:
-rwxrwxr-x 1 zbyszek zbyszek 4109832 Feb  9 19:50 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek 4109792 Feb  9 19:51 build/libsystemd.so.0.30.0

4 years agoshared/json: make JsonVariant.type field wider
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:08:06 +0000 (17:08 +0100)] 
shared/json: make JsonVariant.type field wider

pahole shows that this doesn't make a difference, but we can fit -EINVAL
into .type without warnings.

4 years agosd-event: drop one bitfield from sd_event_source
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:02:18 +0000 (17:02 +0100)] 
sd-event: drop one bitfield from sd_event_source

pahole analysis confirms that the structure size does not change (there
was/is a hole after the sequence of bitfields anyway).

4 years agocore: drop bitfields in Manager object
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:43:03 +0000 (16:43 +0100)] 
core: drop bitfields in Manager object

Every bitfield may make the object a little smaller, but requires additional
code when accessing the field. So it only makes sense in objects that are
created in many many copies. The Manager is pretty much a singleton.

-rwxrwxr-x 1 zbyszek zbyszek 4443840 Feb  9 16:14 build/systemd
-rwxrwxr-x 1 zbyszek zbyszek 4442552 Feb  9 16:42 build/systemd

We save 1288 bytes of code by "wasting" a few bytes on storage. (The speed
advantages are probably more important, but harder to measure…)