]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name... 17555/head
Yu Watanabe [Mon, 9 Nov 2020 16:14:38 +0000 (01:14 +0900)] 
ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but driver name is empty

Inspired by #17532.

3 years agoethtool: add several assertions
Yu Watanabe [Mon, 9 Nov 2020 16:04:36 +0000 (01:04 +0900)] 
ethtool: add several assertions

3 years agoMerge pull request #17549 from yuwata/tiny-fixes
Lennart Poettering [Mon, 9 Nov 2020 15:04:01 +0000 (16:04 +0100)] 
Merge pull request #17549 from yuwata/tiny-fixes

tiny fixes

3 years agoMerge pull request #17548 from yuwata/license-update
Zbigniew Jędrzejewski-Szmek [Mon, 9 Nov 2020 08:34:31 +0000 (09:34 +0100)] 
Merge pull request #17548 from yuwata/license-update

License: LGPL-2.1+ -> LGPL-2.1-or-later, and GPL-2.0+ -> GPL-2.0-or-later

3 years agocore: reduce scope of variants 17549/head
Yu Watanabe [Mon, 9 Nov 2020 05:40:02 +0000 (14:40 +0900)] 
core: reduce scope of variants

Fixes #17543.

3 years agosd-bus: fix possible division by 0
Yu Watanabe [Mon, 9 Nov 2020 05:33:16 +0000 (14:33 +0900)] 
sd-bus: fix possible division by 0

Fixes #17541.

3 years agohome: fix copy-and-paste mistake
Yu Watanabe [Mon, 9 Nov 2020 05:00:14 +0000 (14:00 +0900)] 
home: fix copy-and-paste mistake

Fixes #17542.

3 years agolicense: GPL-2.0+ -> GPL-2.0-or-later 17548/head
Yu Watanabe [Mon, 9 Nov 2020 04:25:50 +0000 (13:25 +0900)] 
license: GPL-2.0+ -> GPL-2.0-or-later

3 years agolicense: LGPL-2.1+ -> LGPL-2.1-or-later
Yu Watanabe [Mon, 9 Nov 2020 04:23:58 +0000 (13:23 +0900)] 
license: LGPL-2.1+ -> LGPL-2.1-or-later

3 years agohwdb: Add support for HP ZBook Studio G5 keyboard (#17525)
fwSmit [Sat, 7 Nov 2020 11:20:03 +0000 (12:20 +0100)] 
hwdb: Add support for HP ZBook Studio G5 keyboard (#17525)

I tested this on my ZBook Studio G5. I'm not sure if this works for other ZBook studio machines.

I have two more notes on this PR:
- some keys send multiple scancodes. I matched only on one of them, because I couldn't figure out how to match
on all of them. This results in the others still being visible:
Event: time 1604520228.146226, -------------- SYN_REPORT ------------
Event: time 1604520228.151533, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1604520228.151533, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1604520228.151533, -------------- SYN_REPORT ------------
Event: time 1604520228.259862, type 4 (EV_MSC), code 4 (MSC_SCAN), value 38
Event: time 1604520228.259862, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1604520228.259862, -------------- SYN_REPORT ------------
Event: time 1604520228.259944, type 4 (EV_MSC), code 4 (MSC_SCAN), value 66
Event: time 1604520228.259944, type 1 (EV_KEY), code 218 (KEY_CONNECT), value 0
Event: time 1604520228.259944, -------------- SYN_REPORT ------------
Event: time 1604520228.266513, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1604520228.266513, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1604520228.266513, -------------- SYN_REPORT ------------

I wanted to set the display key to switchvideomode, but another key is already set to that, so I set it to displaytoggle instead.

3 years agoresolved: fix non-initialized memory access
Lennart Poettering [Fri, 6 Nov 2020 17:08:38 +0000 (18:08 +0100)] 
resolved: fix non-initialized memory access

Fix for bug introduced in 1ed314087fab3988f3221b1b736a7e711f174349.

3 years agoMerge pull request #17534 from poettering/resolved-more-tweaks
Lennart Poettering [Fri, 6 Nov 2020 21:39:09 +0000 (22:39 +0100)] 
Merge pull request #17534 from poettering/resolved-more-tweaks

seven smaller resolved tweaks

3 years agoresolved: slightly extend debug log output about outgoing messages 17534/head
Lennart Poettering [Fri, 6 Nov 2020 10:46:39 +0000 (11:46 +0100)] 
resolved: slightly extend debug log output about outgoing messages

3 years agoresolved: don't resolve "local." via LLMNR
Lennart Poettering [Thu, 5 Nov 2020 13:16:03 +0000 (14:16 +0100)] 
resolved: don't resolve "local." via LLMNR

It's the mDNS top-level domain, hence don't consider it for LLMNR, ever.

Fixes: #16233
3 years agoresolved: add comments for various query flags
Lennart Poettering [Thu, 5 Nov 2020 08:45:12 +0000 (09:45 +0100)] 
resolved: add comments for various query flags

3 years agoresolved: show all answer flags when dumping answer
Lennart Poettering [Wed, 4 Nov 2020 20:01:49 +0000 (21:01 +0100)] 
resolved: show all answer flags when dumping answer

3 years agoresolved: add minor optimization path to dns_answer_merge()
Lennart Poettering [Wed, 4 Nov 2020 19:42:02 +0000 (20:42 +0100)] 
resolved: add minor optimization path to dns_answer_merge()

3 years agoresolved: suppress misleading debug message about ignored resolv.conf line
Lennart Poettering [Thu, 5 Nov 2020 14:49:15 +0000 (15:49 +0100)] 
resolved: suppress misleading debug message about ignored resolv.conf line

3 years agoerrno: ETIMEDOUT is also a connection error
Lennart Poettering [Fri, 6 Nov 2020 13:30:25 +0000 (14:30 +0100)] 
errno: ETIMEDOUT is also a connection error

3 years agojournalctl: show boot id in the reboot context separator
Ronan Pigott [Wed, 28 Oct 2020 06:53:23 +0000 (23:53 -0700)] 
journalctl: show boot id in the reboot context separator

3 years agohwdb: Fix Pinebook Pro's brightness up/down and sleep keys
Jian-Hong Pan [Thu, 5 Nov 2020 04:22:08 +0000 (12:22 +0800)] 
hwdb: Fix Pinebook Pro's brightness up/down and sleep keys

Pinebook Pro's display brightness up & down keys do not work until the
keys are mapped to the corresponding codes.

Also, the sleep key is mapped to KEY_POWER code originally. This quirk
maps the sleep key to the KEY_SLEEP code.

This idea comes from the pinebookpro-post-install package [1] of Manjaro
ARM, which is the preloaded OS on Pinebook Pro.

[1]: https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/-/commit/7ab1a134ea9d5b55d99de567d1ebee4ebd6f6640

3 years agoseccomp: allow turning off of seccomp filtering via env var
Lennart Poettering [Mon, 2 Nov 2020 13:51:10 +0000 (14:51 +0100)] 
seccomp: allow turning off of seccomp filtering via env var

Fixes: #17504
(While we are it, also move $SYSTEMD_SECCOMP_LOG= env var description
into the right document section)

Also suggested in: https://github.com/systemd/systemd/issues/17245#issuecomment-704773603

3 years agoupdate TODO
Lennart Poettering [Wed, 4 Nov 2020 14:46:51 +0000 (15:46 +0100)] 
update TODO

3 years agoselinux: also try the netlink-based fallback and continue on permission error
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 18:47:26 +0000 (19:47 +0100)] 
selinux: also try the netlink-based fallback and continue on permission error

Fedora Rawhide still has the old policy, so selinux prevents our selinux code
from checking if selinux is enabled. But it seems smart to fall back to the old
API anyway.

Follow-up for fd5e402fa9377f2860e02bdb5b84d5f5942e73f4.

Both the reference policy [1] and Fedora selinux policy [2] needed to be
updated, so it's likely that this will impact other distros too.

[1] https://github.com/SELinuxProject/refpolicy/pull/308
[2] https://github.com/fedora-selinux/selinux-policy/pull/464

3 years agoshared/seccomp-util: move stime() to @obsolete
Topi Miettinen [Mon, 2 Nov 2020 11:10:24 +0000 (13:10 +0200)] 
shared/seccomp-util: move stime() to @obsolete

Quoting the manual page of stime(2): "Starting with glibc 2.31, this function
is no longer available to newly linked applications and is no longer declared
in <time.h>."

3 years agosd-login: fix parsing in sd_uid_is_on_seat
Zbigniew Jędrzejewski-Szmek [Tue, 3 Nov 2020 14:13:20 +0000 (15:13 +0100)] 
sd-login: fix parsing in sd_uid_is_on_seat

Bug introduced in 81823e6c12771721e9a729f6280a9de26fd70bad:
logind uses spaces not commas to separate items.

3 years agoMerge pull request #17521 from poettering/resolved-more-fixes
Zbigniew Jędrzejewski-Szmek [Wed, 4 Nov 2020 08:38:09 +0000 (09:38 +0100)] 
Merge pull request #17521 from poettering/resolved-more-fixes

six fixes to resolved

3 years agoMerge pull request #17517 from keszybz/revert-hwdb-trailing-colon
Zbigniew Jędrzejewski-Szmek [Wed, 4 Nov 2020 08:26:31 +0000 (09:26 +0100)] 
Merge pull request #17517 from keszybz/revert-hwdb-trailing-colon

Revert hwdb trailing colon

3 years agoMerge pull request #17493 from Villemoes/va-arg-simplifications
Zbigniew Jędrzejewski-Szmek [Wed, 4 Nov 2020 08:22:15 +0000 (09:22 +0100)] 
Merge pull request #17493 from Villemoes/va-arg-simplifications

Some vararg simplifications

3 years agoresolved: handle RRs where we don't have a signer 17521/head
Lennart Poettering [Tue, 3 Nov 2020 19:34:21 +0000 (20:34 +0100)] 
resolved: handle RRs where we don't have a signer

If we encounter an RR that has no matching signature, then we don't know
whether it was expanded from a wildcard or not. We need to accept that
and not make the NSEC test fail, just skip over the RR.

3 years agoresolved: drop unused family argument from manager_routable()
Lennart Poettering [Wed, 28 Oct 2020 14:12:32 +0000 (15:12 +0100)] 
resolved: drop unused family argument from manager_routable()

3 years agoresolved: fix dumping of DnsAnswer objects
Lennart Poettering [Wed, 28 Oct 2020 13:54:12 +0000 (14:54 +0100)] 
resolved: fix dumping of DnsAnswer objects

3 years agoresolved: put size limit in DnsAnswer size to UINT16_MAX
Lennart Poettering [Tue, 3 Nov 2020 17:31:03 +0000 (18:31 +0100)] 
resolved: put size limit in DnsAnswer size to UINT16_MAX

The three answer sections can only carry up to UINT16_MAX entries, hence
put a hard upper limit on how far DnsAnswer can grow. The three count
fields in the DNS packet header are 16 bit only, hence the limit.

If code actually tries to add more than 64K RRs it will get ENOSPC with
this new checking.

And similar to DnsQuestion.

3 years agoresolved: check return value of memdup() correctly for OOM
Lennart Poettering [Tue, 3 Nov 2020 17:06:47 +0000 (18:06 +0100)] 
resolved: check return value of memdup() correctly for OOM

3 years agoman: remove misplaced comma
Lennart Poettering [Thu, 29 Oct 2020 17:58:04 +0000 (18:58 +0100)] 
man: remove misplaced comma

3 years agoPartially revert "hwdb: reindent commments and say that "*" should always be trailing" 17517/head
Zbigniew Jędrzejewski-Szmek [Tue, 3 Nov 2020 13:28:14 +0000 (14:28 +0100)] 
Partially revert "hwdb: reindent commments and say that "*" should always be trailing"

This partially reverts commit 62ad1c6495c098a09b36bb20bb37a9b8a11df76f.

I kept the reindents and other cosmetic changes, but removed the statements
about trailing ":*".

3 years agoRevert "parse_hwdb: enforce the ":*" suffix"
Zbigniew Jędrzejewski-Szmek [Tue, 3 Nov 2020 13:26:51 +0000 (14:26 +0100)] 
Revert "parse_hwdb: enforce the ":*" suffix"

This reverts commit ad2d8e61eeab27f3e36572c7981362227357f420.

3 years agostrv.c: simplify strv_new_ap 17493/head
Rasmus Villemoes [Fri, 30 Oct 2020 09:54:15 +0000 (10:54 +0100)] 
strv.c: simplify strv_new_ap

Instead of duplicating the code for x and the varargs, handle them all the same
way by using for loops.

3 years agosignal-util: make sigaction_many_ap a little more concise
Rasmus Villemoes [Fri, 30 Oct 2020 09:27:55 +0000 (10:27 +0100)] 
signal-util: make sigaction_many_ap a little more concise

There's no reason to duplicate the stop condition sig < 0, nor the sigaction()
call.

3 years agostring-util: improve overflow checking
Rasmus Villemoes [Fri, 30 Oct 2020 09:18:04 +0000 (10:18 +0100)] 
string-util: improve overflow checking

The current overflow checking is broken in the corner case of the strings'
combined length being exactly SIZE_MAX: After the loop, l would be SIZE_MAX,
but we're not testing whether the l+1 expression overflows.

Fix it by simply pre-accounting for the final '\0': initialize l to 1 instead
of 0.

3 years agostring-util: simplify logic in strjoin_real()
Rasmus Villemoes [Fri, 30 Oct 2020 09:13:27 +0000 (10:13 +0100)] 
string-util: simplify logic in strjoin_real()

The loops over (x, then all varargs, until a NULL is found) can be written much
simpler with an ordinary for loop. Just initialize the loop variable to x, test
that, and in the increment part, fetch the next va_arg(). That removes a level
of indentation, and avoids doing a separate strlen()/stpcpy() call for x.

While touching this code anyway, change (size_t)-1 to the more readable
SIZE_MAX.

3 years agoPartially revert "hwdb: add trailing ":*" everywhere"
Zbigniew Jędrzejewski-Szmek [Tue, 3 Nov 2020 13:17:53 +0000 (14:17 +0100)] 
Partially revert "hwdb: add trailing ":*" everywhere"

This reverts commit c0443b97b71d5f70a0622061f589307bec5502c6.

I got various cases wrong:
"usb:v04F3p2B7Cd5912dc00dsc00dp00ic03isc00ip00in00"
"usb:v0627p0001:QEMU USB Tablet"
"input:b0003v0627p0001e0001-e0,1,2,4,k110,111,112,r0,1,8,B,am4,lsfw"

OTOH:
-evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnASUSTeKComputerInc.:pnN53SV:*
+evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnASUSTeKComputerInc.:pnN53SV*
is OK. Other parts follow after 'pn'.

-mouse:*:name:*Trackball*:*
-mouse:*:name:*trackball*:*
-mouse:*:name:*TrackBall*:*
+mouse:*:name:*Trackball*:
+mouse:*:name:*trackball*:
+mouse:*:name:*TrackBall*:
... and anything else with :name should be OK too, because our imports always
include ":" at the end:
IMPORT{builtin}="hwdb 'joystick:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'"
Including '*' at the end makes the pattern work even if we decide to add
something to the match string later.

Fixes #17499.

3 years agofileio: beef up READ_FULL_FILE_CONNECT_SOCKET to allow setting sender socket name
Lennart Poettering [Mon, 2 Nov 2020 11:07:51 +0000 (12:07 +0100)] 
fileio: beef up READ_FULL_FILE_CONNECT_SOCKET to allow setting sender socket name

This beefs up the READ_FULL_FILE_CONNECT_SOCKET logic of
read_full_file_full() a bit: when used a sender socket name may be
specified. If specified as NULL behaviour is as before: the client
socket name is picked by the kernel. But if specified as non-NULL the
client can pick a socket name to use when connecting. This is useful to
communicate a minimal amount of metainformation from client to server,
outside of the transport payload.

Specifically, these beefs up the service credential logic to pass an
abstract AF_UNIX socket name as client socket name when connecting via
READ_FULL_FILE_CONNECT_SOCKET, that includes the requesting unit name
and the eventual credential name. This allows servers implementing the
trivial credential socket logic to distinguish clients: via a simple
getpeername() it can be determined which unit is requesting a
credential, and which credential specifically.

Example: with this patch in place, in a unit file "waldo.service" a
configuration line like the following:

    LoadCredential=foo:/run/quux/creds.sock

will result in a connection to the AF_UNIX socket /run/quux/creds.sock,
originating from an abstract namespace AF_UNIX socket:

    @$RANDOM/unit/waldo.service/foo

(The $RANDOM is replaced by some randomized string. This is included in
the socket name order to avoid namespace squatting issues: the abstract
socket namespace is open to unprivileged users after all, and care needs
to be taken not to use guessable names)

The services listening on the /run/quux/creds.sock socket may thus
easily retrieve the name of the unit the credential is requested for
plus the credential name, via a simpler getpeername(), discarding the
random preifx and the /unit/ string.

This logic uses "/" as separator between the fields, since both unit
names and credential names appear in the file system, and thus are
designed to use "/" as outer separators. Given that it's a good safe
choice to use as separators here, too avoid any conflicts.

This is a minimal patch only: the new logic is used only for the unit
file credential logic. For other places where we use
READ_FULL_FILE_CONNECT_SOCKET it is probably a good idea to use this
scheme too, but this should be done carefully in later patches, since
the socket names become API that way, and we should determine the right
amount of info to pass over.

3 years agoupdate TODO
Lennart Poettering [Mon, 2 Nov 2020 14:30:16 +0000 (15:30 +0100)] 
update TODO

3 years agopo: Update Turkish translation
Muhammet Kara [Sun, 1 Nov 2020 13:10:19 +0000 (16:10 +0300)] 
po: Update Turkish translation

3 years agonetwork: selinux hook handling to enumerate nexthop
Purushottam choudhary [Wed, 28 Oct 2020 16:41:49 +0000 (22:11 +0530)] 
network: selinux hook handling to enumerate nexthop

When selinux is enabled, the call of
manager_rtnl_enumerate_nexthop() fails.

This fix is to facilitate selinux hook handling for enumerating
nexthop.

In manager_rtnl_enumerate_nexthop() there is a check
if "Not supported" is returned by the send_netlink() call.

This check expects that -EOPNOTSUPP is returned,
the selinux hook seems to return -EINVAL instead.

This happens in kernel older than 5.3
(more specificallytorvalds/linux@65ee00a) as it does not support
nexthop handling through netlink.

And if SELinux is enforced in the order kernel, callingRTM_GETNEXTHOP
returns -EINVAL.

Thus adding a call in the manager_rtnl_enumerate_nexthop for the
extra return -EINVAL.

3 years agoFix typo
Sorin Ionescu [Sat, 31 Oct 2020 08:07:27 +0000 (04:07 -0400)] 
Fix typo

3 years agoautomount: make user unmounting for automount units more debuggable
Lennart Poettering [Tue, 27 Oct 2020 08:56:08 +0000 (09:56 +0100)] 
automount: make user unmounting for automount units more debuggable

Let's add an explicit log message plus an error state for automount
units, if users explicitly unmounted our autofs mount.

Prompted by: #17448

3 years agopid1: various minor watchdog modernizations
Lennart Poettering [Tue, 27 Oct 2020 08:57:28 +0000 (09:57 +0100)] 
pid1: various minor watchdog modernizations

Just some clean-ups.

3 years agoMerge pull request #17399 from afq984/udev-escaped-string
Yu Watanabe [Fri, 30 Oct 2020 00:52:45 +0000 (09:52 +0900)] 
Merge pull request #17399 from afq984/udev-escaped-string

Allow escaped string in udev rules

3 years agoMerge pull request #17444 from BtbN/fix_ib_dhcp4
Zbigniew Jędrzejewski-Szmek [Thu, 29 Oct 2020 18:27:29 +0000 (19:27 +0100)] 
Merge pull request #17444 from BtbN/fix_ib_dhcp4

networkd: fix DHCP on InfiniBand interfaces

3 years agoMerge pull request #17472 from keszybz/spdx-license-headers
Zbigniew Jędrzejewski-Szmek [Thu, 29 Oct 2020 18:05:05 +0000 (19:05 +0100)] 
Merge pull request #17472 from keszybz/spdx-license-headers

More SPDX license headers

3 years agoMerge pull request #17476 from poettering/resolved-tweaks
Zbigniew Jędrzejewski-Szmek [Thu, 29 Oct 2020 17:58:56 +0000 (18:58 +0100)] 
Merge pull request #17476 from poettering/resolved-tweaks

three small resolved cleanups

3 years agohwdb: Add accel orientation quirk for Predia Basic tablet
Hans de Goede [Thu, 29 Oct 2020 10:29:41 +0000 (11:29 +0100)] 
hwdb: Add accel orientation quirk for Predia Basic tablet

Add a quirk to fix the accelerometer orientation on the
Predia Basic tablet.

3 years agodocument udev escaped string in udev(7) 17399/head
Yu, Li-Yu [Thu, 29 Oct 2020 12:58:16 +0000 (20:58 +0800)] 
document udev escaped string in udev(7)

3 years agoudev: add fuzzer for udev_rule_parse_value
Yu, Li-Yu [Sat, 24 Oct 2020 18:01:29 +0000 (02:01 +0800)] 
udev: add fuzzer for udev_rule_parse_value

3 years agoudev: test udev_rule_parse_value()
Yu, Li-Yu [Tue, 20 Oct 2020 16:38:44 +0000 (00:38 +0800)] 
udev: test udev_rule_parse_value()

3 years agoudev: escaped string syntax e"..." in rule files
Yu, Li-Yu [Tue, 20 Oct 2020 16:38:21 +0000 (00:38 +0800)] 
udev: escaped string syntax e"..." in rule files

* Existing valid rule files written with KEY="value" are not affected
* Now, KEY=e"value\n" becomes valid. Where `\n` is a newline character
* Escape sequences supported by src/basic/escape.h:cunescape() is
  supported

3 years agoheaders: use custom LicenseRef- spdx tag for various "public domain" files 17472/head
Zbigniew Jędrzejewski-Szmek [Thu, 29 Oct 2020 09:54:38 +0000 (10:54 +0100)] 
headers: use custom LicenseRef- spdx tag for various "public domain" files

There is no spdx tag defined for those versions of "public domain", but we can
add a custom tag, see
https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/.

crc32.h is updated to match crc32.c.

3 years agoheaders: add spdx tags to imported files with a known license
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 17:32:27 +0000 (18:32 +0100)] 
headers: add spdx tags to imported files with a known license

I added the header in the cases where the license text is present and it is
easy to find the appropriate SPDX header.

For "public domain" stuff: SDPX treats each "public domain" license as unique [1],
but luckily the one in siphash24.c is one of the identified variants. There are
some other cases which specify "public domain" but there doesn't seem to be a
SPDX identifier.

[1] https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files

gunicode.[ch] are imported from glib, which is licensed as LGPL2.1+,
see https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gunicode.h.

3 years agotime-wait-sync: drop gpl snail mail boilerplate
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 17:18:57 +0000 (18:18 +0100)] 
time-wait-sync: drop gpl snail mail boilerplate

No idea why this chunk was left when we removed the other copies.

3 years agotree-wide: use the usual SPDX header for our own files
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 17:18:20 +0000 (18:18 +0100)] 
tree-wide: use the usual SPDX header for our own files

3 years agojournalctl: drop format_journal_url() if gcrypt is not used
Yu Watanabe [Thu, 29 Oct 2020 07:11:40 +0000 (16:11 +0900)] 
journalctl: drop format_journal_url() if gcrypt is not used

Follow-up for f1b823596f8a4dc6b1f76206b7473bac71e3840b.

3 years agoUpdate org.freedesktop.hostname1 documentation
Luca Weiss [Wed, 28 Oct 2020 21:11:23 +0000 (22:11 +0100)] 
Update org.freedesktop.hostname1 documentation

This documents the polkit actions for `SetDeployment()` and `SetLocation()` which previously were undocumented.

3 years agoMerge pull request #17435 from poettering/event-shuffle-refactor
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:21:13 +0000 (18:21 +0100)] 
Merge pull request #17435 from poettering/event-shuffle-refactor

sd-event: split up sd_event_source_set_enable() function

3 years agoMerge pull request #17454 from keszybz/journal-dlopen-cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:20:27 +0000 (18:20 +0100)] 
Merge pull request #17454 from keszybz/journal-dlopen-cleanup

Journal dlopen cleanup and qrcode printing test

3 years agoMerge pull request #17467 from keszybz/unconditionally-pull-in-cryptsetup-remote
Zbigniew Jędrzejewski-Szmek [Wed, 28 Oct 2020 17:00:04 +0000 (18:00 +0100)] 
Merge pull request #17467 from keszybz/unconditionally-pull-in-cryptsetup-remote

Unconditionally pull in cryptsetup-remote.target in the initramfs

3 years agonetworkctl: use and print full hardware address 17444/head
Timo Rothenpieler [Wed, 28 Oct 2020 12:34:28 +0000 (13:34 +0100)] 
networkctl: use and print full hardware address

Intentionally not checking the iftype for the ieee_oui lookup to support
other ethernet-like devices.

3 years agodhcp4: fix DHCP on InfiniBand interfaces
Timo Rothenpieler [Mon, 26 Oct 2020 13:09:13 +0000 (14:09 +0100)] 
dhcp4: fix DHCP on InfiniBand interfaces

With these patches applied, networkd is successfully able to get an
address from a DHCP server on an IPoIB interface.

1)
Makes networkd pass the actual interface type to the dhcp client,
instead of hardcoding it to Ethernet.

2)
Fixes some issues in handling the larger (20 Byte) IB MAC addresses in
the dhcp code.

3)
Add a new field to networkds Link struct, which holds the interface
broadcast address.

3.1)
Modify the DHCP code to also expect the broadcast address as parameter.
On an Ethernet-Interface the Broadcast address never changes and is always
all 6 bytes set to 0xFF.
On an IB one however it is not neccesarily always the same, thus
fetching the actual address from the interface is neccesary.

4)
Only the last 8 bytes of an IB MAC are stable, so when using an IB MAC to
generate a client ID, only pass those 8 bytes.

3 years agonetwork: store full hardware address in Link struct
Timo Rothenpieler [Mon, 26 Oct 2020 17:07:49 +0000 (18:07 +0100)] 
network: store full hardware address in Link struct

This passes the legacy ethernet address to functions in a lot of places,
which all will need migrated to handle arbitrary size hardware addresses
eventually.

3 years agosd-netlink: introduce netlink_message_{read,append}_hw_addr
Timo Rothenpieler [Mon, 26 Oct 2020 15:22:13 +0000 (16:22 +0100)] 
sd-netlink: introduce netlink_message_{read,append}_hw_addr

Hardware addresses come in various shapes and sizes, these new functions
and accomapying data structures account for that instead of hard-coding
a hardware address to the 6 bytes of an ethernet MAC.

3 years agoMerge pull request #17471 from keszybz/man-update-fedora-version
Lennart Poettering [Wed, 28 Oct 2020 09:09:12 +0000 (10:09 +0100)] 
Merge pull request #17471 from keszybz/man-update-fedora-version

Update fedora version in man pages

3 years agoresolved: advertise smaller UDP datagram size on extra stubs 17476/head
Lennart Poettering [Wed, 28 Oct 2020 08:57:46 +0000 (09:57 +0100)] 
resolved: advertise smaller UDP datagram size on extra stubs

3 years agoresolved: remove redundant conditionalization
Lennart Poettering [Tue, 27 Oct 2020 17:00:33 +0000 (18:00 +0100)] 
resolved: remove redundant conditionalization

If all protocols are listed there's no point in having the if check.

Follow-up for 8b4198373b976035e0dfc347f50b61eab40c8e00

3 years agoresolved: use structured initialization everywhere
Lennart Poettering [Tue, 27 Oct 2020 13:28:25 +0000 (14:28 +0100)] 
resolved: use structured initialization everywhere

3 years agoMerge pull request #17455 from poettering/packet-auxdata
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 19:20:57 +0000 (20:20 +0100)] 
Merge pull request #17455 from poettering/packet-auxdata

add Timestamping= to socket units and some other .socket unit tweaks

3 years agoMerge pull request #17438 from anitazha/systoomd_quick
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 17:43:34 +0000 (18:43 +0100)] 
Merge pull request #17438 from anitazha/systoomd_quick

Additional fix ups from #17417

3 years agomeson: fix setting of ENABLE_OOMD
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:19:15 +0000 (10:19 +0100)] 
meson: fix setting of ENABLE_OOMD

-Doomd=auto (the default) didn't work as intended because the initial correct
value was overwritten later by logic that didn't check for 'auto'.

3 years agotest: add a simple test for the qr printing code 17454/head
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 11:20:38 +0000 (12:20 +0100)] 
test: add a simple test for the qr printing code

Ideally, we'd read back what we wrote, but that would have been
much more complicated. But just writing stuff is useful to test under
valgrind or manually.

3 years agojournal,homectl: unify implementations of libqrencode loading and fss key printing
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 11:11:21 +0000 (12:11 +0100)] 
journal,homectl: unify implementations of libqrencode loading and fss key printing

We had two of each: both homectl and journalctl had the whole dlopen()
wrapper, and journalctl had two implementations (slightly different) of the
code to print the fss:// pattern.

print_qrcode() now returns -EOPNOTSUPP when compiled with qrcode support. Both
callers ignore the return value, so this changes nothing.

No functional change.

3 years agonetwork: actually update radv mac
Timo Rothenpieler [Tue, 27 Oct 2020 09:55:41 +0000 (10:55 +0100)] 
network: actually update radv mac

3 years agoman: update fedora version 17471/head
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:56 +0000 (16:01 +0100)] 
man: update fedora version

F33 was released today!

3 years agoman/machinectl: fix pull-raw example
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 15:01:16 +0000 (16:01 +0100)] 
man/machinectl: fix pull-raw example

We do not allow machine names with "_", so the command would fail as written.
Share the example with the systemd-nspawn page instead.

3 years agounits: turn on timestamping for journald sockets 17455/head
Lennart Poettering [Mon, 26 Oct 2020 16:41:06 +0000 (17:41 +0100)] 
units: turn on timestamping for journald sockets

To make things simple and robust when debugging journald, we'll leave
the SO_TIMESTAMP invocations in the C code in place, even if they are
now typically redundant, given that the sockets are already passed into
the process with SO_TIMESTAMP turned on now.

3 years agoman: document the new Timestamping= option
Lennart Poettering [Mon, 26 Oct 2020 16:40:55 +0000 (17:40 +0100)] 
man: document the new Timestamping= option

3 years agocore: add Timestamping= option for socket units
Lennart Poettering [Mon, 26 Oct 2020 16:39:14 +0000 (17:39 +0100)] 
core: add Timestamping= option for socket units

This adds a way to control SO_TIMESTAMP/SO_TIMESTAMPNS socket options
for sockets PID 1 binds to.

This is useful in journald so that we get proper timestamps even for
ingress log messages that are submitted before journald is running.

We recently turned on packet info metadata from PID 1 for these sockets,
but the timestamping info was still missing. Let's correct that.

3 years agoconf-parser: add a flavour of DEFINE_CONFIG_PARSE_ENUM() that allows specifiying...
Lennart Poettering [Mon, 26 Oct 2020 16:38:55 +0000 (17:38 +0100)] 
conf-parser: add a flavour of DEFINE_CONFIG_PARSE_ENUM() that allows specifiying the precie from_string() function to call

3 years agojournald: remove pointless conditionalization
Lennart Poettering [Mon, 26 Oct 2020 15:31:07 +0000 (16:31 +0100)] 
journald: remove pointless conditionalization

Let's not have #ifdeffery both in the consumers and the providers of the
selinux glue code. Unless the code is particularly complex, let's do the
ifdeffery only in the provider of the selinux glue code, and let's keep
the consumers simple and just invoke it.

3 years agosocket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET
Lennart Poettering [Mon, 26 Oct 2020 15:19:24 +0000 (16:19 +0100)] 
socket-util: make socket_set_recvpktinfo control PACKET_AUXDATA sockopt on AF_PACKET

Just for the sake of completness.

3 years agoman: add references to fifo(7) and mq_overview(7) man pages
Lennart Poettering [Mon, 26 Oct 2020 15:19:10 +0000 (16:19 +0100)] 
man: add references to fifo(7) and mq_overview(7) man pages

3 years agotree-wide: cast result of get_process_comm() to (void) where we ignore it
Lennart Poettering [Tue, 27 Oct 2020 08:55:59 +0000 (09:55 +0100)] 
tree-wide: cast result of get_process_comm() to (void) where we ignore it

3 years agosd-event: split out enable and disable codepaths from sd_event_source_set_enabled() 17435/head
Lennart Poettering [Fri, 23 Oct 2020 19:21:58 +0000 (21:21 +0200)] 
sd-event: split out enable and disable codepaths from sd_event_source_set_enabled()

So far half of sd_event_source_set_enabled() was doing enabling, the
other half was doing disabling. Let's split that into two separate
calls.

(This also adds a new shortcut to sd_event_source_set_enabled(): if the
caller toggles between "ON" and "ONESHOT" we'll now shortcut this, since
the event source is already enabled in that case and shall remain
enabled.)

This heavily borrows and is inspired from Michal Sekletár's #17284
refactoring.

3 years agosd-event: split out helper functions for reshuffling prioqs
Michal Sekletár [Fri, 23 Oct 2020 16:29:27 +0000 (18:29 +0200)] 
sd-event: split out helper functions for reshuffling prioqs

We typically don't just reshuffle a single prioq at once, but always
two. Let's add two helper functions that do this, and reuse them
everywhere.

(Note that this drops one minor optimization:
sd_event_source_set_time_accuracy() previously only reshuffled the
"latest" prioq, since changing the accuracy has no effect on the
earliest time of an event source, just the latest time an event source
can run. This optimization is removed to simplify things, given that
it's not really worth the effort as prioq_reshuffle() on properly
ordered prioqs has practically zero cost O(1)).

(Slightly generalized, commented and split out of #17284 by Lennart)

3 years agounits: unconditionally pull in remote-cryptsetup.target in the initramfs 17467/head
Jonathan Lebon [Tue, 27 Oct 2020 12:29:38 +0000 (13:29 +0100)] 
units: unconditionally pull in remote-cryptsetup.target in the initramfs

[zjs: Replaces #17149.

I took half of the patch in
https://github.com/systemd/systemd/pull/17149#issuecomment-698399194,
hence I'm keeping Jonathan's authorship.

The original reasoning for 6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we
enable remote-cryptsetup.target via presets, and since presets are not used for
the initrd, we need a different target. But since parts of the unit and target
tree are shared between the initramfs and the main system, we can't just create
a separate target for the initramfs. All the targets that depend on this one
would need to be split also. That condition is true for initrd-fs.target, but
not for sysinit.target.

So let's instead just uncoditionally pull in remote-cryptsetup.target in the
initramfs. It should normally be empty, so there should be no impact on boots
that don't have units in the target.

Jonathan's patch used initrd-root-fs.target, this version instead uses
initrd-root-device.target. initrd-root-device.target is ordered before
sysroot.mount, which means that the decrypted devices will be available earlier
too.]

3 years agoRevert "units: add initrd-cryptsetup.target"
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 12:26:01 +0000 (13:26 +0100)] 
Revert "units: add initrd-cryptsetup.target"

This reverts commit 6c5496c492a8d74e54d22bf8824160cab1e63c10.

sysinit.target is shared between the initrd and the host system. Pulling in
initrd-cryptsetup.target into sysinit.target causes the following warning at
boot:
Oct 27 10:42:30 workstation-uefi systemd[1]: initrd-cryptsetup.target: Starting requested but asserts failed.
Oct 27 10:42:30 workstation-uefi systemd[1]: Assertion failed for initrd-cryptsetup.target.

3 years agomeson: simplify with_runlevels ternany op usage
Zbigniew Jędrzejewski-Szmek [Tue, 27 Oct 2020 09:49:11 +0000 (10:49 +0100)] 
meson: simplify with_runlevels ternany op usage

3 years agocore: clean up inactive/failed {service|scope}'s cgroups when the last process exits
Anita Zhang [Fri, 23 Oct 2020 05:44:22 +0000 (22:44 -0700)] 
core: clean up inactive/failed {service|scope}'s cgroups when the last process exits

If processes remain in the unit's cgroup after the final SIGKILL is
sent and the unit has exceeded stop timeout, don't release the unit's
cgroup information. Pid1 will have failed to `rmdir` the cgroup path due
to processes remaining in the cgroup and releasing would leave the cgroup
path on the file system with no tracking for pid1 to clean it up.

Instead, keep the information around until the last process exits and pid1
sends the cgroup empty notification. The service/scope can then prune
the cgroup if the unit is inactive/failed.

3 years agosyscall-names: add process_madvise which is planned for 5.10
Zbigniew Jędrzejewski-Szmek [Sun, 25 Oct 2020 12:54:20 +0000 (13:54 +0100)] 
syscall-names: add process_madvise which is planned for 5.10

It was added in v5.9-11793-gecb8ac8b1f and is still present in v5.10-rc1, so it
seems likely that it'll be in 5.10 too.

3 years agol10n: update Czech Translation
AsciiWolf [Mon, 26 Oct 2020 21:48:34 +0000 (22:48 +0100)] 
l10n: update Czech Translation

3 years agodocs: update coding style for `return (void) func(...)` 17438/head
Anita Zhang [Tue, 27 Oct 2020 07:16:25 +0000 (00:16 -0700)] 
docs: update coding style for `return (void) func(...)`

Seems that people think it's useful for brevity so make it explicit in
the CODING_STYLE.