1
0
mirror of https://github.com/systemd/systemd synced 2026-03-19 19:44:48 +01:00

Compare commits

...

2265 Commits

Author SHA1 Message Date
Lennart Poettering
c5aad0fcbc Revert "core: do not set noexec on sysfs/procfs"
This reverts commit b33cd6b3eec52fc50c6c34d6f07a41cc6254c27f.
2021-06-30 22:09:32 +02:00
Zbigniew Jędrzejewski-Szmek
dc9880d475
Merge pull request #20020 from anitazha/oomd_with_mem
oomd: check that memory use also exceeds threshold before doing a swap kill
2021-06-30 21:59:34 +02:00
Luca Boccassi
e01030633c core: when recursively bind-remounting nested mounts, use options from top one
When mount points are stacked, bind_remount_recursive_with_mountinfo()
uses the existing mount options of the "lower" level mount (ie: the
first one that was mounted on a mount point). But the actual mount
point in use is the "top" one (ie: the last one that was mounted on a
mount point), so in practice if the mount options are different between
the layers, the bottom options are used by mistake on the top mount,
which is not what we want. This is because libmount returns the "bottom"
one first.

If the hashmap returns EEXIST, which means the same key (path) with different
value (options) is already present, update the hashmap instead of discarding
the result. This way, the last/top mount options are always used when
mounts are stacked on a mount point.

This was found to cause problems as LXC version 4.x stacks two /sys mounts,
the bottom one read-write and the top one read-only. systemd accidentally
remounts the top-one read-write, breaking various expectations since a
read-only /sys is the way we decide whether we are running in a container
or not (in this particular case, networkd tests are broken as networkd
expects to be able to modify network settings with a writable /sys).

Future versions of LXC will no longer do this double-stacking, but we
need to support running inside older versions too.

This was triggered by https://github.com/systemd/systemd/commit/6720e356c137
as that causes a recursive remount of '/', which processes '/sys' as one
of the submounts, from make_nosuid(). But it's likely that other combinations
of options could trigger this as well.

Before:

root@systemd-debug:/# systemd-run -t --wait --property ProtectSystem=yes findmnt
Running as unit: run-u9.service
Press ^] three times within 1s to disconnect TTY.
TARGET                         SOURCE                           FSTYPE    OPTIONS
/                              /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│                                                               ext4      ro,nosuid,relatime,errors=remount-ro,stripe=
├─/dev                         none                             tmpfs     rw,nosuid,relatime,size=492k,mode=755
│ ├─/dev/.lxc/proc             proc                             proc      rw,nosuid,relatime
│ ├─/dev/.lxc/sys              sys                              sysfs     rw,nosuid,relatime
│ ├─/dev/console               devpts[/2]                       devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/pts                   devpts                           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/ptmx                  devpts[/ptmx]                    devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty1                  devpts[/0]                       devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty2                  devpts[/1]                       devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty3                  devpts[/2]                       devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/tty4                  devpts[/3]                       devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptm
│ ├─/dev/shm                   tmpfs                            tmpfs     rw,nosuid,nodev
│ ├─/dev/hugepages             hugetlbfs                        hugetlbfs rw,nosuid,relatime,pagesize=2M
│ └─/dev/mqueue                mqueue                           mqueue    rw,nosuid,nodev,noexec,relatime
├─/proc                        proc                             proc      rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys                  proc[/sys]                       proc      ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/net            proc[/sys/net]                   proc      rw,nosuid,nodev,noexec,relatime
│ │ └─/proc/sys/kernel/random/boot_id
│ │                            none[/.lxc-boot-id]              tmpfs     ro,nosuid,nodev,noexec,relatime,size=492k,mo
│ └─/proc/sysrq-trigger        proc[/sysrq-trigger]             proc      ro,nosuid,nodev,noexec,relatime
├─/sys                         sysfs                            sysfs     rw,nosuid,nodev,noexec,relatime
│ └─/sys                       sysfs                            sysfs     rw,nosuid,nodev,noexec,relatime
│   ├─/sys/devices/virtual/net sysfs                            sysfs     rw,relatime
│   │ └─/sys/devices/virtual/net
│   │                          sysfs[/devices/virtual/net]      sysfs     rw,nosuid,relatime
│   ├─/sys/fs/fuse/connections fusectl                          fusectl   rw,nosuid,nodev,noexec,relatime
│   └─/sys/fs/cgroup           cgroup                           cgroup2   rw,nosuid,nodev,noexec,relatime,nsdelegate,m
├─/run                         tmpfs                            tmpfs     ro,nosuid,nodev,size=4912348k,nr_inodes=8192
│ ├─/run/credentials           tmpfs[/systemd/inaccessible/dir] tmpfs     ro,nosuid,nodev,noexec,size=4912348k,nr_inod
│ └─/run/systemd/incoming      tmpfs[/systemd/propagate/run-u9.service]
│                                                               tmpfs     ro,nosuid,nodev,size=4912348k,nr_inodes=8192
├─/tmp                         tmpfs                            tmpfs     rw,nosuid,nodev,size=12280872k,nr_inodes=409
│ └─/tmp                       tmpfs[/systemd-private-b730df90da424397a3f246cb15dcdbb1-run-u9.service-K6EUwf/tmp]
│                                                               tmpfs     rw,nosuid,nodev,size=12280872k,nr_inodes=409
└─/var/tmp                     /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/var/tmp/systemd-private-b730df90da424397a3f246cb15dcdbb1-run-u9.service-vEHyRi/tmp]
                                                                ext4      rw,nosuid,relatime,errors=remount-ro,stripe=
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 14.249s
CPU time consumed: 37ms

After:

root@systemd-debug:/# systemd-run -t --wait --property ProtectSystem=yes findmnt
Running as unit: run-u3.service
Press ^] three times within 1s to disconnect TTY.
TARGET                         SOURCE                      FSTYPE    OPTIONS
/                              /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│                                                          ext4      rw,relatime,errors=remount-ro,stripe=32699
├─/dev                         none                        tmpfs     rw,relatime,size=492k,mode=755
│ ├─/dev/.lxc/proc             proc                        proc      rw,relatime
│ ├─/dev/.lxc/sys              sys                         sysfs     rw,relatime
│ ├─/dev/console               devpts[/2]                  devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/pts                   devpts                      devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/ptmx                  devpts[/ptmx]               devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty1                  devpts[/0]                  devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty2                  devpts[/1]                  devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty3                  devpts[/2]                  devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/tty4                  devpts[/3]                  devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode
│ ├─/dev/shm                   tmpfs                       tmpfs     rw,nosuid,nodev
│ ├─/dev/hugepages             hugetlbfs                   hugetlbfs rw,relatime,pagesize=2M
│ └─/dev/mqueue                mqueue                      mqueue    rw,nosuid,nodev,noexec,relatime
├─/proc                        proc                        proc      rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys                  proc[/sys]                  proc      ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/net            proc[/sys/net]              proc      rw,nosuid,nodev,noexec,relatime
│ │ └─/proc/sys/kernel/random/boot_id
│ │                            none[/.lxc-boot-id]         tmpfs     ro,nosuid,nodev,noexec,relatime,size=492k,mode=75
│ └─/proc/sysrq-trigger        proc[/sysrq-trigger]        proc      ro,nosuid,nodev,noexec,relatime
├─/sys                         sysfs                       sysfs     rw,nosuid,nodev,noexec,relatime
│ └─/sys                       sysfs                       sysfs     ro,nosuid,nodev,noexec,relatime
│   ├─/sys/devices/virtual/net sysfs                       sysfs     rw,relatime
│   │ └─/sys/devices/virtual/net
│   │                          sysfs[/devices/virtual/net] sysfs     rw,nosuid,nodev,noexec,relatime
│   ├─/sys/fs/fuse/connections fusectl                     fusectl   rw,nosuid,nodev,noexec,relatime
│   └─/sys/fs/cgroup           cgroup                      cgroup2   rw,nosuid,nodev,noexec,relatime,nsdelegate,memory
├─/run                         tmpfs                       tmpfs     rw,nosuid,nodev,size=4912348k,nr_inodes=819200,mo
│ ├─/run/credentials           tmpfs[/systemd/inaccessible/dir]
│ │                                                        tmpfs     ro,nosuid,nodev,noexec,size=4912348k,nr_inodes=81
│ └─/run/systemd/incoming      tmpfs[/systemd/propagate/run-u3.service]
│                                                          tmpfs     ro,nosuid,nodev,size=4912348k,nr_inodes=819200,mo
├─/tmp                         tmpfs                       tmpfs     rw,nosuid,nodev,size=12280872k,nr_inodes=409600
├─/boot                        /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/boot]
│                                                          ext4      ro,relatime,errors=remount-ro,stripe=32699
└─/usr                         /dev/sda2[/var/lib/lxc/systemd-debug/rootfs/usr]
                                                           ext4      ro,relatime,errors=remount-ro,stripe=32699
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 14ms
CPU time consumed: 5ms

Host (LXC):

root@systemd-debug:/# findmnt
TARGET                         SOURCE               FSTYPE    OPTIONS
/                              /dev/sda2[/var/lib/lxc/systemd-debug/rootfs]
│                                                   ext4      rw,relatime,errors=remount-ro,stripe=32699
├─/run                         tmpfs                tmpfs     rw,nosuid,nodev,size=4912348k,nr_inodes=819200,mode=755
├─/tmp                         tmpfs                tmpfs     rw,nosuid,nodev,size=12280872k,nr_inodes=409600
├─/dev                         none                 tmpfs     rw,relatime,size=492k,mode=755
│ ├─/dev/pts                   devpts               devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/ptmx                  devpts[/ptmx]        devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty1                  devpts[/0]           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty2                  devpts[/1]           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty3                  devpts[/2]           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/tty4                  devpts[/3]           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666,ma
│ ├─/dev/shm                   tmpfs                tmpfs     rw,nosuid,nodev
│ ├─/dev/hugepages             hugetlbfs            hugetlbfs rw,relatime,pagesize=2M
│ ├─/dev/mqueue                mqueue               mqueue    rw,nosuid,nodev,noexec,relatime
│ ├─/dev/console               devpts[/2]           devpts    rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/.lxc/proc             proc                 proc      rw,relatime
│ └─/dev/.lxc/sys              sys                  sysfs     rw,relatime
├─/proc                        proc                 proc      rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys                  proc[/sys]           proc      ro,nosuid,nodev,noexec,relatime
│ │ ├─/proc/sys/kernel/random/boot_id
│ │ │                          none[/.lxc-boot-id]  tmpfs     ro,nosuid,nodev,noexec,relatime,size=492k,mode=755
│ │ └─/proc/sys/net            proc[/sys/net]       proc      rw,nosuid,nodev,noexec,relatime
│ └─/proc/sysrq-trigger        proc[/sysrq-trigger] proc      ro,nosuid,nodev,noexec,relatime
└─/sys                         sysfs                sysfs     rw,nosuid,nodev,noexec,relatime
  └─/sys                       sysfs                sysfs     ro,nosuid,nodev,noexec,relatime
    ├─/sys/devices/virtual/net sysfs                sysfs     rw,relatime
    │ └─/sys/devices/virtual/net
    │                          sysfs[/devices/virtual/net]
    │                                               sysfs     rw,nosuid,nodev,noexec,relatime
    ├─/sys/fs/fuse/connections fusectl              fusectl   rw,nosuid,nodev,noexec,relatime
    └─/sys/fs/cgroup           cgroup               cgroup2   rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recurs

Fixes https://github.com/systemd/systemd/issues/20032
2021-06-30 21:57:35 +02:00
Zbigniew Jędrzejewski-Szmek
abaf5edd08 Revert "Introduce ExitType"
This reverts commit cb0e818f7cc2499d81ef143e5acaa00c6e684711.

After this was merged, some design and implementation issues were discovered,
see the discussion in #18782 and #19385. They certainly can be fixed, but so
far nobody has stepped up, and we're nearing a release. Hopefully, this feature
can be merged again after a rework.

Fixes #19345.
2021-06-30 21:56:47 +02:00
Zbigniew Jędrzejewski-Szmek
58551e6ebc
Merge pull request #20074 from yuwata/fix-typo
tree-wide: fix typo
2021-06-30 17:26:51 +02:00
Franck Bui
b25389d2bb login: XGI Z7/Z9 (XG20 core) graphic chip requires master-of-seat to be set
This graphic chip doesn't have a DRM driver and fallback to vesa-framebuffer
driver.

Without this patch, users of such chip suddenly see their GUI broken without
any indication or reason of what happened (no error message). Hence this
regression is near to impossible to troubleshoot for end users.
2021-06-30 16:18:41 +01:00
Yu Watanabe
387f695526 tree-wide: "a" -> "an" 2021-06-30 23:33:00 +09:00
Yu Watanabe
3d62af7d23 tree-wide: fix "the the" and "a a" 2021-06-30 23:32:43 +09:00
Zbigniew Jędrzejewski-Szmek
759f76534f
Merge pull request #20021 from wat-ze-hex/socket-bind-ip-proto-2021-06-23
core/bpf: support IP protocol in SocketBind{Allow|Deny}=
2021-06-30 14:46:27 +02:00
Yu Watanabe
857f0e0ae3 man: fix typo 2021-06-30 20:47:57 +09:00
Anita Zhang
cb5ce676d9 oomd: check mem free and swap free before doing a swap-based kill
https://bugzilla.redhat.com/show_bug.cgi?id=1974763
2021-06-30 03:51:05 -07:00
Anita Zhang
eeeaa42284 oomd: get memory total and free as part of system context 2021-06-30 03:50:35 -07:00
Anita Zhang
47136b9d9a oomd: switch system context parsing to use /proc/meminfo
Makes it easier in the next commits to unify on one way to read swap and
memory info.
2021-06-30 03:47:26 -07:00
laineantti
eed5c718a6 hwdb: add accel matrix for One-netbook OneMix 2s 2021-06-30 19:41:48 +09:00
Albert Brox
f1bda7ead2
Improve tmpfiles unsafe transition log message (#20048) 2021-06-30 11:54:15 +02:00
Julia Kartseva
120338ae33 man: document ip proto in SocketBind{Allow|Deny}= 2021-06-30 00:36:33 -07:00
Julia Kartseva
60477eb98a dbus: extend SocketBind{Allow|Deny}= with ip proto 2021-06-30 00:36:33 -07:00
Julia Kartseva
5587ce7f6c fragment: add ip protocol to SocketBind{Allow|Deny}=
Add ip protocol token to SocketBind{Allow|Deny}= property parser.

Use parse_socket_bind_item helper.

Replace int32_t with int in cgroup item for socket-bind as it was
requested in [0].

Update tests.

[0] https://github.com/systemd/systemd/pull/19942#discussion_r652150024
2021-06-30 00:36:33 -07:00
Julia Kartseva
8bd095aa9a shared: add parser for SocketBind{Allow|Deny}=
Parse address family, ip protocol and ports, any of them can be
optional. If neither is specified, a special value 'any' is expected.
Helper is placed in shared to be reused in both fragment and dbus.
Add unit tests with valid and invalid examples.
2021-06-30 00:36:26 -07:00
Julia Kartseva
159d68c3e0 shared: add ip_protocol_{from|to}_tcp_udp helpers
Thin wrappers of ip_protocol_{from|to}_name targeting IPPROTO_TCP and
IPPROTO_UDP only.
Used to parse IP protocol configuration restricted only to TCP and UDP,
e.g. in SocketBind{Allow|Deny}= unit property.

These helpers are inspired by af_{from|to}_ipv4_ipv6 and potentially
extendable with other IP protocols if there is a use-case to expose
them.
2021-06-29 14:37:07 -07:00
Julia Kartseva
560d76243f bpf: add ip proto matching to socket-bind prog
Lookup ip protocol in a socket address to allow or deny binding a socket
to the address.
Matching rule is extended with 'protocol' field. If its value is 0
(IPPROTO_IP) ip protocol comparison is omitted and matching is passed to
the next token which is ip ports.

Documentation is updated.
2021-06-29 14:37:07 -07:00
Dan Streetman
9fcfc0470d Add systemd-resolve backwards compatibility section to resolvectl docs 2021-06-30 06:15:11 +09:00
Luca Boccassi
d46be5a6ac
Merge pull request #20047 from keszybz/doc-fix
Update dnssec-trust-anchors comment syntax description and put rrs in index
2021-06-29 12:52:38 +01:00
Raul Tambre
12c0bb31a7 resolved: Fix link to resolv.conf manpage
Seems to typically located in volume 5 these days on Linux systems that systemd targets.
2021-06-29 12:50:53 +01:00
Alexander Tsoy
1f00a50c69 resolved: do not try to copy empty NSEC types bitmaps
dns_resource_record_copy() assumes that NSEC types bitmap is non-empty
which results in a null pointer dereference inside bitmap_copy() in some
cases. Fix this by calling bitmap_copy() conditionally.
2021-06-29 10:47:18 +02:00
Zbigniew Jędrzejewski-Szmek
d080734dcb man: add "DNS resource record types" section 2021-06-29 10:44:18 +02:00
Zbigniew Jędrzejewski-Szmek
9a024bf18d man: add markup to dns resource record labels 2021-06-29 10:44:18 +02:00
Franck Bui
9952f11a84
Merge pull request #20039 from yuwata/sd-device-get-sysattr-value-embedded-nul
sd-device: allow to read sysattr which contains embedded NUL
2021-06-28 15:43:29 +02:00
Raul Tambre
d3a047b9d1 man: Don't link to a manpage that's within our documentation
For example on systemd.network this results in the link taking one to another site with the manpage instead of the document that's on the same site.
2021-06-28 18:49:27 +09:00
Luca Boccassi
6cf4f7d10e
Merge pull request #20043 from yuwata/sd-netlink-cleanups
sd-netlink: several trivial cleanups
2021-06-28 10:35:34 +01:00
Zbigniew Jędrzejewski-Szmek
0b497bc46f man/dnssec-trust-anchors: update comment syntax description
Let's just use the same phrase as in systemd.syntax(7).
Fixes #20045.
2021-06-27 15:50:04 +02:00
dgcampea
e8f4bf33d8 man: fix incorrect description regarding DynamicUser= and StateDirectory= 2021-06-27 14:08:05 +01:00
Luca Boccassi
56175bc45d
Merge pull request #20042 from yuwata/udev-rule-fix-cid-1457766
udev: fix an issue and add a testcase
2021-06-26 23:03:36 +01:00
Yu Watanabe
11537375e3 sd-netlink: use usec_sub_unsigned() and USEC_INFINITY
And shorten code more.
2021-06-27 03:58:34 +09:00
Yu Watanabe
2b01228800 sd-netlink: shorten code a bit
This also reduces scope of variables, fixes and reduces indentations,
drop unnecessary initializations.
2021-06-27 03:58:34 +09:00
Yu Watanabe
7bb9f0d014 sd-netlink: do not call lookup_nlmsg_type() for known generic netlink family 2021-06-27 03:58:30 +09:00
Yu Watanabe
0f97cfb9be sd-netlink: rename variables and functions for generic netlink
`id` or `type` is ambiguous. Let's use `nlmsg_type`. Also, use `ret` for
function arguments to store results.

This also adds several assertions.
2021-06-27 03:02:22 +09:00
Yu Watanabe
eee15fff40 sd-netlink: do not trigger assertion by calling socket_broadcast_group_unref() with an arbitrary group number
socket_broadcast_group_unref() is only called in netlink_slot_disconnect(),
so the assertion should not be triggered as the match slot was
successfully created.

But, we usually design `_ref/unref()` functions as they can be called
for any inputs. So, let's also follow the design rule here.
2021-06-27 02:47:34 +09:00
Yu Watanabe
db4735b7db sd-netlink: shorten code a bit
This also fixes comments, a log message, and coding style nits.
2021-06-27 02:47:25 +09:00
Yu Watanabe
33989b967e udev-test: add a testcase for string_escape=replace 2021-06-27 00:02:24 +09:00
Yu Watanabe
7dc846f99a udev: reduce scope of variables
Then, hopefully, we can easily find the bug fixed by the previous
commit.
2021-06-26 23:52:38 +09:00
Yu Watanabe
7db6b67275 udev: fix use of invalid pointer
Fixes a bug introduced by ea0f4578a7e90f5227817058bfb11bb91dbb1431.

Fixes CID#1457766.
2021-06-26 23:35:02 +09:00
Yu Watanabe
57ccd9f6c0 core/namespace: drop unnecessary initializations 2021-06-26 11:32:59 +01:00
Yu Watanabe
11c89a85eb udev: update log messages
Suggested at https://github.com/systemd/systemd/pull/19312#discussion_r658556983.
2021-06-26 10:12:13 +02:00
Yu Watanabe
70160c6eee sd-device: allow to read sysattr which contains embedded NUL
This effectively reverts the commit 2a394d0bf2f0afd8b9ed5faeb33f23459e3c6504.

But drop trailing '\r' of the read value, as sd_device_set_sysattr_value() drops it.

Fixes #20025.
2021-06-26 10:48:28 +09:00
Yu Watanabe
3b955af56f networkctl: drop unused member in struct VxLanInfo 2021-06-26 08:39:25 +09:00
Zbigniew Jędrzejewski-Szmek
2e9ee9cf15
Merge pull request #20028 from keszybz/hwdb-update-v249
Hwdb update for v249-rc2
2021-06-25 16:17:20 +02:00
Yu Watanabe
c8de9b0ec5 man: document about NAMING_REPLACE_STRICTLY network interface naming policy
Follow-up for b4d885f0e861b2d1bb5a62311c61a96f5222b026 and
068b0f77289411ef9f92f5d701759e98145a06e4.
2021-06-25 14:51:24 +01:00
Luca Boccassi
5b8fdb1873 NEWS: mention MS_NOSUID for namespaced services by default 2021-06-25 14:04:34 +01:00
Zbigniew Jędrzejewski-Szmek
6969135f6a NEWS: update contributor list for v249-rc2 2021-06-25 14:26:29 +02:00
Zbigniew Jędrzejewski-Szmek
14e97d24ae NEWS: update with net-naming scheme changes and ConditionOSRelease 2021-06-25 14:26:29 +02:00
Zbigniew Jędrzejewski-Szmek
6ccd05e3ad hwdb: update autosuspend 2021-06-25 14:23:15 +02:00
Zbigniew Jędrzejewski-Szmek
a557c7c6d0 hwdb: update 2021-06-25 14:23:15 +02:00
Zbigniew Jędrzejewski-Szmek
aeecab3804 dbus-socket: fix check of Listen* arguments
We checked the wrong field, which was always NULL here, so we would always
reject the assignment. We would also print the wrong string in the error
message:

$ sudo systemd-run --socket-property ListenFIFO=/tmp/fifo3 cat
Failed to start transient socket unit: Invalid socket path: FIFO
2021-06-25 14:21:23 +02:00
Zbigniew Jędrzejewski-Szmek
a768492a33
Merge pull request #20023 from yuwata/re-enable-nosuid-mount-flag
core: reenable nosuid mount flag when NoNewPrivileges=yes
2021-06-25 14:21:05 +02:00
David Tardon
99df1cb6f5 remove a left-over break
By the "same logic as above...", we want to continue to fallback here,
but the break prohibits that.

This is a follow-up for ee1aa61c4710ae567a2b844e0f0bb8cb0456ab8c .
2021-06-25 14:20:52 +02:00
Luca Boccassi
db4c8a2516 ExtensionImages: log explicit error when extension-release metadata does not match
When an ExtensionImages= extension-release metadata does not match, the
log messages (unless debug level is set) are pretty much incomprehensible:

systemd[463]: run-u11.service: Failed to set up mount namespacing: /run/systemd/unit-extensions/0: Stale file handle
systemd[463]: run-u11.service: Failed at step NAMESPACE spawning /usr/bin/echo: Stale file handle

Add an explicit log message if we get ESTALE from the dissect code, to
make it clear what's happening without needing to enable debugging:

systemd[463]: Failed to mount image /tmp/app3.raw, extension-release metadata does not match the lower layer's: ID=debian VERSION_ID=11 SYSEXT_LEVEL=11
2021-06-25 13:34:16 +02:00
Yu Watanabe
4dce1b9f05 udev/scsi: use the scsi device type number directly
Previously, the value is once stringified, and later again parsed,
that is completely redundant.

Follow-up for 1001167ca5e4cfdc6230562e4fb9029e5f624d53.

Replaces #20013.
2021-06-25 13:31:19 +02:00
Mike Crowe
7875170f01 resolvectl: Only strip ifname suffixes when being resolvconf
Only treat interface names containing dots specially when resolvectl is
pretending to be resolvconf to fix
https://github.com/systemd/systemd/issues/20014 .

Move the special suffix-stripping behaviour of ifname_mangle out to the
new ifname_resolvconf_mangle to be called from resolvconf only.
2021-06-25 12:52:39 +02:00
Zbigniew Jędrzejewski-Szmek
157306439e
Merge pull request #19312 from yuwata/udev-escape-slash-nvme
udev: make OPTIONS="string_escape=replace" take effect on ENV{key}= assiginment
2021-06-25 10:11:04 +02:00
Zbigniew Jędrzejewski-Szmek
07b1d28a16
Merge pull request #19883 from ddstreet/activation-policy-down-required-for-online-no
Activation policy down required for online no
2021-06-25 09:26:25 +02:00
Zbigniew Jędrzejewski-Szmek
a2e2917162
Merge pull request #19941 from bluca/condition_os_release
core: add ConditionOSRelease= directive
2021-06-25 09:22:50 +02:00
Yu Watanabe
5181630f26 core: do not set nosuid mount option when SELinux is enabled
The mount option has special meaning when SELinux is enabled. To make
NoNewPrivileges=yes not break SELinux enabled systems, let's not set the
mount flag on such systems.
2021-06-25 15:37:35 +09:00
Yu Watanabe
6720e356c1 Revert "Revert "Mount all fs nosuid when NoNewPrivileges=yes""
This reverts commit 1753d3021564671fba3d3196a84da657d15fb632.

Let's re-enable that feature now. As reported when the original commit
was merged, this causes some trouble on SELinux enabled systems. So,
in the subsequent commit, the feature will be disabled when SELinux is enabled.
But, anyway, this commit just re-enable that feature unconditionally.
2021-06-25 15:16:34 +09:00
Lennart Poettering
de61a04b18 tree-wide: make specifier expansion --root= aware
This fixes repart's, systemctl's, sysusers' and tmpfiles' specifier
expansion to honour the root dir specified with --root=. This is
relevant for specifiers such as %m, %o, … which are directly sourced
from files on disk.

This doesn't try to be overly smart: specifiers referring to runtime
concepts (i.e. boot ID, architecture, hostname) rather than files on the
medium are left as is. There's certainly a point to be made that they
should fail in case --root= is specified, but I am not entirely convinced
about that, and it's certainly something we can look into later if
there's reason to.

I wondered for a while how to hook this up best, but given that quite a
large number of specifiers resolve to data from files on disks, and most
of our tools needs this, I ultimately decided to make the root dir a
first class parameter to specifier_printf().

Replaces: #16187
Fixes: #16183
2021-06-24 22:30:14 +02:00
Andrea Pappacoda
0c651d32d4 docs: update autofs Kconfig name 2021-06-24 20:11:03 +02:00
Juergen Hoetzel
274b0d3fc1 docs: EFI separator needs to be backslash-escaped in markdown 2021-06-24 20:09:52 +02:00
Frantisek Sumsal
eb70d9450c test: correctly mask supporting services in tests, take #2
Due to a little misunderstanding the last patch doesn't work as
expected, since test_create_image() is called only for the first image
(usually TEST-01-BASIC), and all subsequent images are then (possibly)
modified with test_append_files().

Follow-up to 179ca4d2b1b5579014773a128462475f99b7a91b.
2021-06-24 16:26:19 +01:00
Lennart Poettering
86e24d608a
Merge pull request #20001 from keszybz/test-path-simplify-less
Do not call path_simplify() when not needed
2021-06-24 15:33:09 +02:00
Lennart Poettering
6abd991c71 sd-journal: add missing bracket in journal verify log message 2021-06-24 15:25:29 +02:00
Luca Boccassi
5bf7d8f04d
Merge pull request #20000 from dtardon/replace-strtoul
replace strtoul by safe_ato*
2021-06-24 14:18:58 +01:00
David Tardon
04d54d5011 udev-builtin-keyboard: drop unnecessary {} 2021-06-24 15:12:34 +02:00
David Tardon
1001167ca5 udev: replace strtoul by safe_ato* 2021-06-24 15:12:29 +02:00
Zbigniew Jędrzejewski-Szmek
280e4b368e
Merge pull request #20004 from yuwata/readdir-ensure-type
dirent-util: introduce readdir_ensure_type()
2021-06-24 15:11:06 +02:00
Lennart Poettering
4ef65db34b openssl-util: include the headers the file actually uses definitions from 2021-06-24 15:09:14 +02:00
Zbigniew Jędrzejewski-Szmek
c1e4c62235
Merge pull request #19997 from keszybz/selinux-opt
Drop libselinux dependency from libsystemd
2021-06-24 15:07:29 +02:00
Luca Boccassi
1e26f8a60b core: add ConditionOSRelease= directive 2021-06-24 13:57:48 +01:00
Luca Boccassi
70b6ee6110 basic/extract-word: add EXTRACT_RETAIN_SEPARATORS flag
Makes the helpers avoid skipping over the separator(s) in the
input string
2021-06-24 13:41:17 +01:00
Dan Streetman
61764fe4e2 test: add test to verify RequiredForOnline= setting with ActivationPolicy=
Add test to verify that the RequiredForOnline= value is correct based on
the configuration of ActivationPolicy=
2021-06-24 08:33:29 -04:00
Dan Streetman
003015af5a networkctl: add field 'Required For Online' 2021-06-24 08:32:21 -04:00
Dan Streetman
7c644a6966 network: default RequiredForOnline=false if ActivactionPolicy= not set to up
If ActivationPolicy= is set to down, always-down, or manual, then any
matching link will delay boot (due to delaying network-online.target).

If RequiredForOnline= wasn't explicitly set, then default it to false
if ActivationPolicy= is down or manual. If ActivationPolicy=always-down,
then force RequiredForOnline=no.
2021-06-24 08:32:21 -04:00
Lennart Poettering
b80ef40caf ask-password: add "-n" switch for disabling trailing newline
This is similar to the "-n" switch of the "echo" command.
2021-06-24 13:25:39 +02:00
Luca Boccassi
6222acc2b5
Merge pull request #20002 from yuwata/sd-dhcp-client-ignore-forcerenew
sd-dhcp-client: ignore FORCERENEW
2021-06-24 10:01:10 +01:00
Zbigniew Jędrzejewski-Szmek
ac19bdd04b core: avoid calling path_simplify() unnecessarilly for u.requires_mounts_for keys
We would always call path_simplify() before doing a lookup, which requires the
path key to be duplicated first. But the hashmap lookup doesn't require this…
So let's opportunistically skip the allocation if the key is already present.

Inspired by https://github.com/systemd/systemd/pull/19973.
2021-06-24 10:59:45 +02:00
Zbigniew Jędrzejewski-Szmek
0fb789af20 test-hash-funcs: add new file to test that path set ignores dot components 2021-06-24 10:59:45 +02:00
Zbigniew Jędrzejewski-Szmek
da90c261af gitignore: add jekyll cache directory
Follow-up for 2d4efd1dba568e59b149fbb82b51201951e8e178.
2021-06-24 10:20:29 +02:00
Zbigniew Jędrzejewski-Szmek
c3b8bacd7b shared/selinux-util: rework switching of the getenforce() function
The approach with function pointer was neat, but it gets in the way
when we want to resolve the symbol dynamically: static initialization
is not possible. It also makes the code more complicated than necessary.
In this case, a simple boolean is sufficient.
2021-06-24 10:20:29 +02:00
Zbigniew Jędrzejewski-Szmek
cd503dbb6b shared/dlfcn-util: add sentinel helper or for dlsym_many_or_warn()
I didn't do this before to avoid churn in all the users.
2021-06-24 10:20:29 +02:00
Zbigniew Jędrzejewski-Szmek
d32f7a8e9b shared/tpm2-util: simplify and convert to the new helper
The function would return 0 or 3. I don't think the return code was
used for anything, so let's avoid the explicit calculation and return
0 or 1.
2021-06-24 10:20:27 +02:00
Zbigniew Jędrzejewski-Szmek
1622ef77ee various: convert to the new dlopen_or_warn() helper 2021-06-24 10:16:46 +02:00
Zbigniew Jędrzejewski-Szmek
fff25ab22e dlfcn-util: invert function naming and add helper that does the whole job
We warn when the operation fails, not when it succeeds. Hence this should be
"<do>_or_<handle failure>", not "<do>_and_<handle failure>". We *could* use
whatever convention we want, but rust and perl are rather consistent in using
the logical convention. We don't care about perl that much, but having a naming
convention inverted wrt. rust would be rather confusing.

Also, pretty much every implementation does similar steps, so add a nice
wrapper which combines opening of the library and loading of the symbols.

Also add missing sentinel attribute in dlopen_or_warn().
2021-06-24 10:16:43 +02:00
Zbigniew Jędrzejewski-Szmek
87501ac0eb meson: drop libseccomp and libselinux from libbasic linkage
This means libsystemd.so is without them now. This is important
because countless programs link to libsystemd.so, and do not need
to pull in selinux now. And libselinux.so pulls in libpcre2, so
we trim a nice dependency tree.

I'm not sure why libseccomp was listed there. No code seems to
refer to it.

$ diff -u <(ldd ../systemd/build/libsystemd.so|sed 's/0x.*/0x…/') <(ldd build/libsystemd.so|sed 's/0x.*/0x…/')
@@ -4,11 +4,9 @@
 	libzstd.so.1 => /lib64/libzstd.so.1 (0x…
 	liblz4.so.1 => /lib64/liblz4.so.1 (0x…
 	libcap.so.2 => /lib64/libcap.so.2 (0x…
-	libselinux.so.1 => /lib64/libselinux.so.1 (0x…
 	libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x…
 	libpthread.so.0 => /lib64/libpthread.so.0 (0x…
 	libc.so.6 => /lib64/libc.so.6 (0x…
 	/lib64/ld-linux-x86-64.so.2 (0x…
-	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x…
 	libdl.so.2 => /lib64/libdl.so.2 (0x…
 	libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x…

$ diff -u <(ldd ../systemd/build/libudev.so|sed 's/0x.*/0x…/') <(ldd build/libudev.so|sed 's/0x.*/0x…/')
@@ -1,8 +1,5 @@
 	linux-vdso.so.1 (0x…
 	librt.so.1 => /lib64/librt.so.1 (0x…
-	libselinux.so.1 => /lib64/libselinux.so.1 (0x…
 	libpthread.so.0 => /lib64/libpthread.so.0 (0x…
 	libc.so.6 => /lib64/libc.so.6 (0x…
 	/lib64/ld-linux-x86-64.so.2 (0x…
-	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x…
-	libdl.so.2 => /lib64/libdl.so.2 (0x…
2021-06-24 10:11:16 +02:00
Zbigniew Jędrzejewski-Szmek
b25a930f0e basic,shared: move a bunch of files to src/shared/
The goal is to move everything that requires selinux or smack
away from src/basic/. This means that src/basic/label.[ch] must move,
which implies btrfs-util.[ch], copy.[ch], and a bunch of other files
which form a cluster of internal use.

This is just moving text around, so there should be no functional difference.

test-blockdev-util is new, because path_is_encrypted() is moved to
blockdev-util.c, and so far we didn't have any tests for code there.
2021-06-24 10:11:00 +02:00
Zbigniew Jędrzejewski-Szmek
2d32453bc8 basic,shared: move dlopen helpers to shared/
This was added in 88d775b734644f26fb490836769c2bc275498fde,
with the apparent intent of using in shared/ and the rest of our code.
It doesn't matter much for our code, since libdl is part of glibc anyway,
but moving it removes one linkage from libsystemd. (libshared was already
linking to libdl explicitly).
2021-06-24 10:05:50 +02:00
Zbigniew Jędrzejewski-Szmek
6a818c3cb4 basic: move acquire_data_fd() and fd_duplicate_data_fd() to new data-fd-util.c
fd_duplicate_data_fd() is renamed to copy_data_fd(). This makes
the two functions have nicely similar names.

Now fd-util.[ch] is again about low-level file descriptor manipulations.
copy_data_fd() is a complex function that internally wraps the other
functions in copy.c. I want to move copy.c and the whole cluster of
related code from basic/ to shared/ later on, and this is a preparatory
step for that.
2021-06-24 10:05:22 +02:00
Zbigniew Jędrzejewski-Szmek
37350b81b5 Move hwdb creation code to src/shared/
hwdb_update() is the main entry point, and it is called from
"udevadm hwdb" and "systemd-hwdb", so it belongs in shared/.
2021-06-24 09:47:15 +02:00
Zbigniew Jędrzejewski-Szmek
2686114332 basic,shared: move quota-util.[ch] to src/shared/
No need for this to in basic/.
2021-06-24 09:47:15 +02:00
Zbigniew Jędrzejewski-Szmek
65ddc2c5ff basic: drop one btrfs-related function and move another
This will become useful later, it is the first step to moving btrfs-util.[ch]
out of src/basic/.
2021-06-24 09:42:08 +02:00
Yu Watanabe
38e980a6a5 sd-dhcp-client: tentatively ignore FORCERENEW command
This makes DHCP client ignore FORCERENEW requests, as unauthenticated
FORCERENEW requests causes a security issue (TALOS-2020-1142, CVE-2020-13529).

Let's re-enable this after RFC3118 (Authentication for DHCP Messages)
and/or RFC6704 (Forcerenew Nonce Authentication) are implemented.

Fixes #16774.
2021-06-24 11:25:26 +09:00
Yu Watanabe
551ad0b7de sd-dhcp-client: logs when dhcp client unexpectedly gains a new lease
Previously, such situation is handled silently.
2021-06-24 11:25:26 +09:00
Yu Watanabe
d57b62be0d sd-dhcp-client: shorten code a bit 2021-06-24 11:25:26 +09:00
Yu Watanabe
67d8cd8193 sd-dhcp-client: check error earlier and reduce indentation 2021-06-24 11:25:26 +09:00
Anders Wenhaug
4dbad977ff docs: add coding style example
Add example of how to structure else-blocks following a multiline block.
2021-06-24 10:06:40 +09:00
Yu Watanabe
f565b8676f dirent-util: use readdir_ensure_type() in readdir_no_dot() and FOREACH_DIRENT() 2021-06-24 04:29:40 +09:00
Yu Watanabe
98f7a4c8bb dirent-util: introduce readdir_ensure_type() 2021-06-24 04:19:38 +09:00
Zbigniew Jędrzejewski-Szmek
6d216bdd07 test-path-util: check that dot components are irrelevant for path comparisons 2021-06-23 18:11:49 +02:00
Zbigniew Jędrzejewski-Szmek
a79726113a TODO: elide initrd-parse-etc.service if possible 2021-06-23 18:11:49 +02:00
Zbigniew Jędrzejewski-Szmek
aa45911b79 man/50-xdg-data-dirs: add quotes as suggested by shellcheck 2021-06-23 18:11:49 +02:00
Zbigniew Jędrzejewski-Szmek
9c6535367d basic,shared: move make_mount_point_inode_*() to shared/
Those pull in selinux for labelling, and we should avoid selinux in basic/.
2021-06-23 10:34:58 +02:00
Zbigniew Jędrzejewski-Szmek
f69c2926f8 meson: sort file list
At least emacs thinks this is the right way.
2021-06-23 10:29:37 +02:00
Yu Watanabe
5118e8e71d udev: remove unsafe characters from ID_SERIAL for nvme
Fixes #19309.
2021-06-23 17:11:27 +09:00
Yu Watanabe
91c27ac686 man: update description of "string_escape=" udev option 2021-06-23 17:11:23 +09:00
Yu Watanabe
ea0f4578a7 udev: replace unsafe characters on assigning ENV{key}="val" when OPTIONS="string_escape=replace" is set
Strictly speaking, this breaks backward compatibility, as previously
`ENV{key}="val"` ignored `string_escape=` option. But, introducing
a new option such as `string_escape=hoge` sounds overkill for me.
The default escape mode is `ESCAPE_UNSET`, so I hope this merely break
existing rules.
2021-06-23 16:40:52 +09:00
Yu Watanabe
51c2f543d1 udev: fix key name in debug log 2021-06-23 16:33:14 +09:00
Yu Watanabe
068b0f7728 udev: refuse invalid ifname earlier 2021-06-23 16:32:42 +09:00
Yu Watanabe
b4d885f0e8 udev: introduce new netif naming scheme flag to strictly replace ifname 2021-06-23 16:10:26 +09:00
Yu Watanabe
d37f3e3ec5 udev: only network interface can be renamed 2021-06-23 16:02:43 +09:00
Yu Watanabe
e1ecfef16f udev-util: introduce udev_replace_ifname() 2021-06-23 16:02:05 +09:00
Yu Watanabe
5a3586db9a socket-util: split out checking valid character for ifname into ifname_valid_char() 2021-06-23 15:59:44 +09:00
Yu Watanabe
b905f3bbba
Merge pull request #19990 from mrc0mmand/test-tweaks
A couple of stability-related test tweaks
2021-06-23 01:45:04 +09:00
Yu Watanabe
de806cd6b6
Merge pull request #19991 from bluca/bash_compl_unbound_vars
completion: fix 'unbound variables' errors
2021-06-23 01:44:30 +09:00
Luca Boccassi
36ec026830 completion: fix 'unbound variables' errors
Fixes https://github.com/systemd/systemd/issues/19987
2021-06-22 14:56:47 +01:00
Luca Boccassi
6a0667d2b6 completion/systemd-delta,-resolve: autocomplete with parameters 2021-06-22 14:56:47 +01:00
Luca Boccassi
df7ca94009 completion/hostnamectl: do not dereference non-existing OPTS[ARGUNKNOWN] 2021-06-22 14:56:47 +01:00
Lennart Poettering
abfbfee36c
Merge pull request #19986 from keszybz/test-mount-util-more
Add smoke test for mount_flags_to_string()
2021-06-22 15:03:57 +02:00
Hristo Venev
2e8a32afbc networkd: Permit all-zero RoutingPolicyRule prefixes
For example this `From` address range is no longer ignored:

    [RoutingPolicyRule]
    From=0.0.0.0/8
2021-06-22 20:19:12 +09:00
Frantisek Sumsal
ffd0815171
Merge pull request #19969 from bluca/test_02_qemu
test-loop-block: run in qemu
2021-06-22 12:58:07 +02:00
Frantisek Sumsal
179ca4d2b1 test: correctly mask supporting services in tests
It turns out the "supporting services" were run in _all_ tests if
TEST-01-BASIC was run as the first test (which is usually the case),
since with the original condition in test_create_image() we would skip
the masking and then propagate the change to the default image used by
other tests. This has been causing multiple bogus test timeouts
(especially when the hwdb was being rebuilt in tests with short
timeouts, like TEST-52-HONORFIRSTSHUTDOWN).

Let's "fix" this by making the call to mask_supporting_services()
uncoditional and override the test_create_image() function in
TEST-01-BASIC to avoid the masking in this single case.
2021-06-22 12:34:31 +02:00
simmon
d8301aef51 po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-06-22 12:24:35 +02:00
Frantisek Sumsal
907300c3c3 test: ignore the "freezing" & "thawing" intermediate states
When checking the unit state after `systemctl freeze|thaw` we can be
"too fast" and get the intermediate state (freezing/thawing) which we're
not interested in. Let's wait a bit and try to get the state again in
such cases to avoid unnecessary flakiness.

```
[   29.390203] testsuite-38.sh[218]: + state=thawing
[   29.390203] testsuite-38.sh[218]: + '[' thawing = running ']'
[   29.390203] testsuite-38.sh[218]: + echo 'error: unexpected freezer state, expected: running, actual: thawing'
[   29.390203] testsuite-38.sh[218]: error: unexpected freezer state, expected: running, actual: thawing
[   29.390203] testsuite-38.sh[218]: + exit 1
```
2021-06-22 12:12:34 +02:00
Zbigniew Jędrzejewski-Szmek
51bb6a103e test-mount-util: add output test for mount_flags_to_string() 2021-06-22 14:42:03 +09:00
Zbigniew Jędrzejewski-Szmek
917578880f test-mount-util: add usual print headers 2021-06-22 14:42:03 +09:00
Yu Watanabe
4bee2333cf mount-util: add one more assertion 2021-06-22 14:42:03 +09:00
Luca Boccassi
b152adbfa9 test-loop-block: run in qemu
test-loop-block needs to run in qemu, so we are currently not
testing it in the CI. Run it by itself in a separate job from
TEST-02-UNITTESTS to avoid slowing that suite down.

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

Disable it in the bionic-* CI for now, as it's affected by
the same uevent ordering issue as TEST-50-DISSECT which makes
it flaky.
2021-06-21 20:55:19 +01:00
Luca Boccassi
fa1fdd3099 test: move custom result checks from TEST-02-UNITTESTS to test-functions 2021-06-21 20:45:56 +01:00
Luca Boccassi
85d3f13254 test: allow to call units/testsuite-02.sh from other scripts 2021-06-21 19:47:38 +01:00
Luca Boccassi
1d5574516f test: do not fail TEST-02-UNITTESTS if they are all skipped
The return code is initialized to fail if /testok is not found, but
that also covers the case where all tests are skipped.
2021-06-21 19:47:38 +01:00
Luca Boccassi
7d3f9bf493 test: do not lose logs of late failures in TEST-02-UNITTESTS
Due to set -e, if the wait() fails (eg: because of an assert in the
waited task), report_result() never runs and logs are lost
2021-06-21 19:47:38 +01:00
Luca Boccassi
35cde9e935 test: install nls modules, required by vfat
kernel: FAT-fs (loop0p2): codepage cp437 not found
kernel: FAT-fs (loop0p2): IO charset ascii not found
2021-06-21 19:47:38 +01:00
Zbigniew Jędrzejewski-Szmek
b5ce2feebc
Merge pull request #19977 from yuwata/nspawn-fix-strextend
nspawn: replace strextend_with_separator() -> strextendf_with_separator()
2021-06-21 19:24:39 +02:00
Lennart Poettering
6e766d9874
cryptenroll: fix minor typo in --help (#19985)
We use "+" as separator for PCR indexes now, but we forgot to replace
one "," by "+"
2021-06-22 00:56:52 +09:00
Yu Watanabe
9b23679e53 mount-util: use EXTRACT_KEEP_QUOTE to handle mount options
Otherwise, the quotes which wrap SELinux options are dropped.
2021-06-21 21:34:50 +09:00
Yu Watanabe
25086b4c17 mount-util: reduce scope of variable 2021-06-21 21:34:10 +09:00
Yu Watanabe
f59551f18e test: add test cases for EXTRACT_KEEP_QUOTE and EXTRACT_UNQUOTE 2021-06-21 21:34:07 +09:00
Yu Watanabe
1104d11429 extract-word: introduce EXTRACT_KEEP_QUOTE flag 2021-06-21 21:14:20 +09:00
Yu Watanabe
1c092b62db mount-util: make mount_flags_to_string() show flag name instead of number
This also adds missing MS_NOSYMFOLLOW flag. Moreover, this makes the
function always add unhandled flags in number.
2021-06-21 21:14:20 +09:00
Yu Watanabe
d3d1559435 nspawn: replace strextend_with_separator() -> strextendf_with_separator()
Fixes a bug introduced by cfea7618f28562c053a1ee194108feaa502081ff.

Before this commit:
mode=1777,size=10%,nr_inodes=400k,uid=496107520,gid=496107520,context=,sys.id:sys.role:systemd.nspawn.container.fs:s0,
After this commit:
mode=1777,size=10%,nr_inodes=400k,uid=496107520,gid=496107520,context=sys.id:sys.role:systemd.nspawn.container.fs:s0

Fixes #19976.
2021-06-21 21:14:20 +09:00
Yu Watanabe
f75817172f time-util: coding style fixes
Follow-ups for 45eb4d2261ed0d943fd503a6d79ee3b7b7558c09.
2021-06-21 13:00:10 +01:00
Yu Watanabe
932feb79b3 virt: improve log message when we cannot read /sys/firmware/dmi/entries/0-0/raw
As the file is usually readable by only root.

Prompted by https://github.com/systemd/systemd/issues/19978#issuecomment-864561357.
2021-06-21 12:12:07 +01:00
Yu Watanabe
16ecf8066d
Merge pull request #19981 from gablank/relative-time-unit-singular
time-util: don't use plural units indiscriminately
2021-06-21 14:04:31 +09:00
Anders Wenhaug
45eb4d2261 time-util: don't use plural units indiscriminately
format_timestamp_relative currently returns the plural form of
years and months no matter the quantity, and in many cases (for
durations > 1 week) this is the same with days.

This patch changes this so that the function takes the quantity into account,
returning "1 month 1 week ago" instead of "1 months 1 weeks ago".
2021-06-20 21:54:37 +02:00
Jesse Stricker
df8fd03a7d hwdb: add rules for Lenovo U41-70 (80JV) 2021-06-19 04:57:17 +09:00
Frantisek Sumsal
df4161d878 Revert "ci: work around #19442 to make CI happy again"
The fix/workaround from #18851 should, hopefully, make this redundant.

This reverts commit 48a3cf58d5ad9cf2a4a4e6167171070b88c25369.
2021-06-18 14:51:33 +01:00
Lennart Poettering
ff0771bfc8 repart: make No-Auto GPT partition flag configurable too
This is useful for provisioning initially empty secondary A/B root file
systems. We don't want those to ever be considered for automatic
mounting, for example in "systemd-nspawn --image=", hence we should
create them with the No-Auto flag turned on. Once a file system image is
dropped into the partition the flag may be turned off by the updater
tool, so that it is considered from then on.

Thew new option for this is called NoAuto. I dislike negated options
like this, but this is taken from the naming in the spec, which in turn
inherited the name from the same flag for Microsoft Data Partitions. To
minimize confusion, let's stick to the name hence.
2021-06-18 14:34:01 +09:00
Lennart Poettering
1a27c323dd path-util: make path_equal() an inline wrapper around path_compare()
The two are completely identical, only the return code is inverted.
let's hence make it easy for the compiler to make it the same function
call even in lowest optimization modes.
2021-06-18 13:46:43 +09:00
Frantisek Sumsal
5384e84c46 test: wait until the unit leaves the 'inactive' state as well
In many CI runs I noticed a race where we check the "active" state a bit
too early where the unit is still in the "inactive" state, causing the
`is-failed` check to fail. Mitigate this by waiting even if the unit is
in the inactive state and introduce a "safe net" which checks whether
the unit is not restarting indefinitely or more than it should (as
described in the original issue #3166).

Example:
```
[    5.757784] testsuite-11.sh[216]: + systemctl --no-block start fail-on-restart.service
[    5.853657] testsuite-11.sh[222]: ++ systemctl show --value --property ActiveState fail-on-restart.service
[    5.946044] testsuite-11.sh[216]: + active_state=inactive
[    5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\a\t\i\n\g ]]
[    5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\e ]]
[    5.946044] testsuite-11.sh[216]: + systemctl is-failed fail-on-restart.service
[    5.946816] systemd[1]: fail-on-restart.service: Passing 0 fds to service
[    5.946913] systemd[1]: fail-on-restart.service: About to execute false
[    5.947011] systemd[1]: fail-on-restart.service: Forked false as 228
[    5.947093] systemd[1]: fail-on-restart.service: Changed dead -> start
[    5.947172] systemd[1]: Starting Fail on restart...
[    5.947272] systemd[228]: fail-on-restart.service: Executing: false
[    5.960553] testsuite-11.sh[227]: activating
[    5.965188] testsuite-11.sh[216]: + exit 1
[    6.011838] systemd[1]: Received SIGCHLD from PID 228 (4).
[    6.012510] systemd[1]: fail-on-restart.service: Main process exited, code=exited, status=1/FAILURE
[    6.012638] systemd[1]: fail-on-restart.service: Failed with result 'exit-code'.
[    6.012834] systemd[1]: fail-on-restart.service: Service will restart (restart setting)
[    6.012963] systemd[1]: fail-on-restart.service: Changed running -> failed
[    6.013081] systemd[1]: fail-on-restart.service: Unit entered failed state.
```
2021-06-18 13:46:29 +09:00
plattrap
e83580bfc6 Update systemd-resolved.service.8 help
Text currently refers to `/etc/nsswitch.conf` where it should refer to `/etc/resolv.conf`.
This is in the context of defining a nameserver IP and search domains.
2021-06-18 13:43:13 +09:00
Frantisek Sumsal
29bff80b5c test: drop the mawk-incompatible expression
The three-argument match() is a GNU AWK extension, thus breaking the
compatibility with mawk (used on Ubuntu/Debian, for example). Let's
replace it with a (hopefully) more portable sed expression to drop the
inadvertently introduced gawk dependency.

Fixes: #19957
2021-06-17 21:44:32 +01:00
Jeremy Szu
c1b8c966ec hwdb: Add mic mute key mapping for HP Elite Dragonfly
* HP confirmed there are two marketing name
   * HP Elite Dragonfly G2 Notebook PC
   * HP Elite Dragonfly Max Notebook PC
2021-06-17 18:32:50 +01:00
Lennart Poettering
17f8a7e972 update TODO 2021-06-17 15:11:37 +02:00
Eric Cook
682e043c42 shell-completion: revert c1072f6473bafa063cbf700c86524083d2857031
fixing https://github.com/systemd/systemd/issues/19689
2021-06-17 14:42:46 +02:00
Jan Macku
edf2ee22f5 core: Hide "Deactivated successfully" message
Show message "Deactivated successfully" in debug mode (when manager is
user) rather than in info mode. This message has low information value
for regular users and it might be a bit overwhelming on a system with
a lot of devices.
2021-06-17 13:10:30 +01:00
Luca Boccassi
63878c52be test: do not run 'meson configure' if NO_BUILD is set
There is no build tree and packages are used, so it cannot work. Unlikely
that static linking has been set for those builds anyway.

Fixes https://github.com/systemd/systemd/issues/19955
2021-06-17 17:21:17 +09:00
Joerg Behrmann
5601400e17 NEWS: fix typos 2021-06-17 08:52:46 +01:00
Zbigniew Jędrzejewski-Szmek
9a797ddc41 meson: allow "soft-static" allocations for uids and gids in the initrd
The general idea with users and groups created through sysusers is that an
appropriate number is picked when the allocation is made. The number that is
selected will be different on each system based on the order of creation of
users, installed packages, etc. Since system users and groups are not shared
between installations, this generally is not an issue. But it becomes a problem
for initrd: some file systems are shared between the initrd and the host (/run
and /dev are probably the only ones that matter). If the allocations are
different in the host and the initrd, and files survive switch-root, they will
have wrong ownership.

This makes the gids build-time-configurable for all groups and users where
state may survive the switch from initrd to the host.

In particular, all "hardware access" groups are like this: files in /dev will
be owned by them.  Eventually the new udev would change ownership, but there
would be a momemnt where the files were owned by the wrong group. The
allocations are "soft-static" in the language of Fedora packaging guidelines:
the uid/gid will be used if possible, but we'll fall back to a different
one. TTY_GID is the exception, because the number is used directly.

Similarly, the possibility to configure "soft-static" uids is added for daemons
which may usefully run in the initramfs: systemd-network (lease information and
interface state is serialized to /run), systemd-resolve (stub files and
interface state), systemd-timesync (/run/systemd/timesync).

Journal files are owned by the group systemd-journal, and acls are granted
for wheel and adm.

systemd-oom and systemd-coredump are excluded from this patch: I assume that
oomd is not useful in the initrd, and coredump leaves no state (it only creates
a pipe in /run?).

The defaults are not changed: if nothing is configured, dynamic allocation will
be used. I looked at a Debian system, and the numbers are all different than
on Fedora.

For Fedora, see the list of uids and gids at https://pagure.io/setup/blob/master/f/uidgid.
In particular, systemd-network and systemd-resolve got soft-static numbers to
make it easy to transition from a non-host-specific initrd to a host system
already a few years back (https://bugzilla.redhat.com/show_bug.cgi?id=1102002).

I also requested static allocations for sgx, input, render in
https://pagure.io/packaging-committee/issue/1078,
https://pagure.io/setup/pull-request/27.
2021-06-17 09:48:28 +02:00
Luca Boccassi
798d7d0a8a
Merge pull request #19948 from keszybz/set-driver-refactoring
A minor refactoring to sd-device internals
2021-06-16 13:48:18 +01:00
Luca Boccassi
aeffa4c3ed
Merge pull request #19947 from yuwata/network-dad-tiny-fixes
network: tiny fixes about IPv4ACD
2021-06-16 09:45:42 +01:00
Zbigniew Jędrzejewski-Szmek
ca0176fa6b sd-device: let device_set_driver() accept NULL too
Like previous commit, but for driver not subsystem.
2021-06-16 08:54:16 +02:00
Zbigniew Jędrzejewski-Szmek
df49a7323a sd-device: let device_set_subsystem() accept NULL
This makes device_shallow_clone() simpler.

Follow-up for 2255e8adee37c490bf8cf2daab791b6f746bb0a0.
2021-06-16 08:54:16 +02:00
Yu Watanabe
1cf4ed142d network: always enable IPv4 ACD for statically configured IPv4LL address 2021-06-16 13:19:26 +09:00
Yu Watanabe
f4c48492fe man: fix RFC number and its title 2021-06-16 10:32:28 +09:00
Yu Watanabe
bd5146c67e network: IFA_F_NODAD flag is only for IPv6 addresses 2021-06-16 08:33:54 +09:00
Lennart Poettering
ad64e3e8d6
Merge pull request #19942 from wat-ze-hex/socket-bind-ip-proto-2021-06-10
dbus: extend SocktBind{Allow|Deny}= with ip proto
2021-06-16 00:24:54 +02:00
Frantisek Sumsal
e7848266da test: add a testcase for issue #19895 2021-06-15 23:18:06 +01:00
Lennart Poettering
8f12ee7178
Merge pull request #19896 from keszybz/systemd-efi-options-hint
Print hint in bootctl when systemd-efi-options output is out-of-date
2021-06-16 00:03:08 +02:00
Lennart Poettering
fe1f0129e1
Merge pull request #19943 from poettering/v249rc1-rep
prepare v249-rc1
2021-06-16 00:02:31 +02:00
Zbigniew Jędrzejewski-Szmek
e9bbb6ef04
Merge pull request #19945 from yuwata/news
update NEWS
2021-06-15 23:04:39 +02:00
Yu Watanabe
566c8176da NEWS: fix typo 2021-06-16 06:01:25 +09:00
Yu Watanabe
2568bb1085 NEWS: drop journal file truncation feature
Follow-up for 0aa649b11d8176c823756c419cb75786787a2a62.
2021-06-16 05:54:02 +09:00
Julia Kartseva
a5f19be8b1 dbus: update SocketBind{Allow|Deny}= doc 2021-06-15 13:51:33 -07:00
Julia Kartseva
4883a04fe1 dbus: extend SocktBind{Allow|Deny}= with ip proto
Support filtering by ip protocol (L4) in SocketBind{Allow|Deny}=
properties.
The signature of dbus methods must be finalized before new release is
cut, hence reserve a parameter for ip protocol.
Implementation will follow.

Closes https://github.com/systemd/systemd/issues/19891
2021-06-15 13:45:20 -07:00
Zbigniew Jędrzejewski-Szmek
ad2d6880ea bootctl: print SystemdOptions from efivarfs if newer than our cache
The logic is that if the options are updated after boot, we *don't* use
the new value. But we still want to print out the changed contents in
bootctl as to not confuse people.

Fixes #19597.
Also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988450.

$ build/bootctl systemd-efi-options
quiet
Note: SystemdOptions EFI variable has been modified since boot. New value: debug

The hint is printed to stderr, so scripts should not be confused.
2021-06-15 22:01:42 +02:00
Zbigniew Jędrzejewski-Szmek
c67bd42b71 Inline some inerator variables 2021-06-15 22:01:42 +02:00
Zbigniew Jędrzejewski-Szmek
e6f055cbc4 basic/efivars: replace dynanamic creation of efivar names with static strings
Creating those string dynamically at runtime is slow and unnecessary.
Let's use static strings with a bit of macro magic and the let the compiler
coalesce as much as possible.

$ size build/src/shared/libsystemd-shared-248.so{.old,}
   text	   data	    bss	    dec	    hex	filename
2813453	  94572	   4584	2912609	 2c7161	build/src/shared/libsystemd-shared-248.so.old
2812309	  94564	   4584	2911457	 2c6ce1	build/src/shared/libsystemd-shared-248.so

A nice side-effect is that the same form is used everywhere, so it's easier to
figure out all variables that are used, and where each specific variable is
used.

C.f. 2b0445262ad9be2a9bf49956ab8e886ea2e48a0a.

Note: 'const char *foo = alloca(…);' seems OK. Our coding style document and
alloca(3) only warn against using alloca() in function invocations. Declaring
both stack variable and alloca at the same time should be fine: no matter in
which order they happen, i.e. if the pointer variable is above the contents,
or the contents are above the pointer, or even if the pointer is elided by the
compiler, everything should be fine.
2021-06-15 22:01:42 +02:00
Zbigniew Jędrzejewski-Szmek
7c7683f36c sd-id128: add SD_ID128_MAKE_UUID_STR
It's like SD_ID128_MAKE_STR, but with hyphens.
2021-06-15 22:01:39 +02:00
Lennart Poettering
ca1e8584c6 meson: bump version for 249-rc1 release 2021-06-15 21:59:44 +02:00
Lennart Poettering
558a9af70f hwbd: run "ninja -C build update-hwdb" again 2021-06-15 21:59:44 +02:00
Lennart Poettering
8156422c8f seccomp: drop quotactl_path() again from filter sets
In the light of https://lwn.net/Articles/859679/ let's drop
quotactl_path() again from the filter set list, as it got backed out
again in 5.13-rc3.

It's likely going to be replaced by quotactl_fd() eventually, but that
hasn't made its way into the tree yet, hence let's not replace the entry
for now.

This partially reverts 34254e599a28529bdb89f91571adeaf7c76d9f43.
2021-06-15 21:30:36 +02:00
Yu Watanabe
7422405623 test: fix syscall existence check
Follow-up for 0643eb47a0418dc90d33853089dc9bc6ad63b0ca.

This also drops errnously introduced hashmap_put() in the commit.
2021-06-15 21:00:51 +02:00
Lennart Poettering
cf2ab2e7ea update TODO 2021-06-15 20:58:56 +02:00
Lennart Poettering
39d02a175f sd-id128: document everywhere that we treat all UUIDs as Variant 1
So in theory UUID Variant 2 (i.e. microsoft GUIDs) are supposed to be
displayed in native endian. That is of course a bad idea, and Linux
userspace generally didn't implement that, i.e. uuidd and similar.
Hence, let's not bother either, but let's document that we treat
everything the same as Variant 1, even if it declares something else.
2021-06-15 20:58:56 +02:00
Yu Watanabe
9b682672e4 network: use void* to correctly store SetLinkOperation in Request
Previously, when `link_request_queue()` is called in link_request_set_link(),
`SetLinkOperation` is casted with INT_TO_PTR(), and the value is assigned to
`void *object`. However the value was read directly through the member
`SetLinkOperation set_link_operation` of the union which `object`
beloging to. Thus, read value was always 0 on big-endian systems.

Fixes configuring link issue on s390x systems.
2021-06-15 20:58:20 +02:00
Michal Sekletár
b428efa54b udev: add basic set of user-space defined tracepoints (USDT)
Debugging udev issues especially during the early boot is fairly
difficult. Currently, you need to enable (at least) debug logging and
start monitoring uevents, try to reproduce the issue and then analyze
and correlate two (usually) huge log files. This is not ideal.

This patch aims to provide much more focused debugging tool,
tracepoints. More often then not we tend to have at least the basic idea
about the issue we are trying to debug further, e.g. we know it is
storage related. Hence all of the debug data generated for network
devices is useless, adds clutter to the log files and generally
slows things down.

Using this set of tracepoints you can start asking very specific
questions related to event processing for given device or subsystem.
Tracepoints can be used with various tracing tools but I will provide
examples using bpftrace.

Another important aspect to consider is that using tracepoints you can
debug production systems. There is no need to install test packages with
added logging, no debuginfo packages, etc...

Example usage (you might be asking such questions during the debug session),

Q: How can I list all tracepoints?
A: bpftrace -l 'usdt:/usr/lib/systemd/systemd-udevd:udev:*'

Q: What are the arguments for each tracepoint?
A: Look at the code and search for use of DEVICE_TRACE_POINT macro.

Q: How many times we have executed external binary?
A: bpftrace -e 'usdt:/usr/lib/systemd/systemd-udevd:udev:spawn_exec { @cnt = count(); }'

Q: What binaries where executed while handling events for "dm-0" device?
A  bpftrace -e 'usdt:/usr/lib/systemd/systemd-udevd:udev:spawn_exec / str(arg1) == "dm-0"/ { @cmds[str(arg4)] = count(); }'

Thanks to Thomas Weißschuh <thomas@t-8ch.de> for reviewing this patch
and contributions that allowed us to drop the dependency on dtrace tool
and made the resulting code much more concise.
2021-06-15 18:28:28 +02:00
Yu Watanabe
b2e8fdc896
Merge pull request #19928 from yuwata/riscv32
riscv32 support
2021-06-16 00:53:30 +09:00
Yu Watanabe
0aa649b11d Revert "journal-file: truncate archived journals"
This reverts commit 592d419ce6e283c443901be4a69c95984821ff06.

The commit makes journald unstable, and is just an optimization
for the size of journal. Hence, it is safe to revert the commit.

Fixes #19895.
2021-06-15 15:50:36 +02:00
Luca Boccassi
e4948b0f0a
Merge pull request #19921 from yuwata/service-verify-bus-type
core/service: fix assertion when Type=dbus but BusName= is not specified
2021-06-15 12:21:53 +01:00
Yu Watanabe
e19b0746f1 unit: use alias name of man page 2021-06-15 12:14:26 +01:00
Matt Johnston
e65357b658 man: fix sd_bus_add_node_enumerator() ret_nodes
ret_nodes is NULL terminated, the return value isn't a count.
2021-06-15 11:29:44 +01:00
Yu Watanabe
21d03e6c63 man: add an example to configure default route on device with table
Prompted by #19911.
2021-06-15 11:29:20 +01:00
Luca Boccassi
c35949a51c
Merge pull request #19930 from yuwata/update-comments
Update comments
2021-06-15 11:28:51 +01:00
Yu Watanabe
fc75007b32 missing_syscall: add riscv32 support 2021-06-15 19:07:36 +09:00
Yu Watanabe
18adce1566 syscalls: add riscv32 2021-06-15 19:07:32 +09:00
Yu Watanabe
d34e3b76e5 syscalls: update tables 2021-06-15 19:07:11 +09:00
Yu Watanabe
a3f5f4a5c0 fix typo 2021-06-15 14:19:30 +09:00
Yu Watanabe
7802194ac0 tree-wide: add missing whitespace at the end of comments 2021-06-15 14:09:29 +09:00
Yu Watanabe
f7bef77a16
Merge pull request #19924 from yuwata/sd-event-fix-assertion
sd-event: fix assrtion in sleep_between()
2021-06-15 13:34:03 +09:00
Khem Raj
0643eb47a0
test-seccomp: Check for __NR_ppoll before use (#19858)
some newer architectures like riscv32 do not have __NR_ppoll from get go
2021-06-15 13:12:30 +09:00
Yu Watanabe
9868493e17
Merge pull request #19913 from yuwata/network-fix-counter
network: add missing increment of Link::set_flags_messages
2021-06-15 10:51:24 +09:00
Lennart Poettering
05a2166a06 repart: show partitions we don't grow/create as "unchanged"
The previous string was "unknown", but that's wrong, because we *do*
know what we are going to do with those partitions: we leave them
unmodified, hence say "unchanged" in the output, to be clearer.
2021-06-15 05:39:33 +09:00
Lennart Poettering
9c07c9ec0e repart: align all sizes in table to the right 2021-06-15 05:39:33 +09:00
Frantisek Sumsal
785256a320 test: correctly configure the NUMA node memory pool
The currently hardcoded value works with the default configuration, but
breaks when QEMU_MEM != 512M (in sanitizer runs, for example).

```
# QEMU_MEM=1G make -C test/TEST-36-NUMAPOLICY/ run
make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-36-NUMAPOLICY'
TEST-36-NUMAPOLICY RUN: test NUMAPolicy= and NUMAMask= options
+ /bin/qemu-kvm -smp 8 -net none -m 1G -nographic -kernel /boot/vmlinuz-5.12.5-300.fc34.x86_64 -drive format=raw'
qemu-kvm: total memory for NUMA nodes (0x20000000) should equal RAM size (0x40000000)
E: QEMU failed with exit code 1
```
2021-06-15 05:37:28 +09:00
Yu Watanabe
2502e7befe
Merge pull request #19905 from yuwata/network-set-mac-try-again
network: try to bring down interface before setting MAC address
2021-06-15 05:35:45 +09:00
Yu Watanabe
710fa1b3fb network: update wlan information when IFF_LOWER_UP flag is gained
Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860269320.
2021-06-15 05:14:22 +09:00
Yu Watanabe
7f80fa12c2 network: add brief comment about reconfiguring interfaces
This also renames link_reconfigure_internal() -> link_reconfigure_impl().
2021-06-15 05:12:25 +09:00
Yu Watanabe
ecb3deccdc network: do not partially update wlan information on failure 2021-06-15 04:32:31 +09:00
Yu Watanabe
7149bde4ba network: add missing increment of Link::set_flags_messages
link_up_or_down() will decrement the counter when the subsequent
RTM_GETLINK netlink method is finished. So, we need to increment
the counter here.

Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860255692.
2021-06-15 03:58:59 +09:00
Yu Watanabe
2429808b29 test: add a test case for #19920 2021-06-15 03:06:09 +09:00
Yu Watanabe
0f97b7c338 core/service: fix assertion when Type=dbus but BusName= is not specified
Fixes #19920.
2021-06-15 03:06:09 +09:00
Yu Watanabe
2115b9b662 sd-event: always reshuffle time prioq on changing online/offline state
Before 81107b8419c39f726fd2805517a5b9faab204e59, the compare functions
for the latest or earliest prioq did not handle ratelimited flag.
So, it was ok to not reshuffle the time prioq when changing the flag.

But now, those two compare functions also compare the source is
ratelimited or not. So, it is necessary to reshuffle the time prioq
after changing the ratelimited flag.

Hopefully fixes #19903.
2021-06-15 02:34:26 +09:00
Yu Watanabe
5c08c7ab23 sd-event: make event_source_time_prioq_reshuffle() accept all event source type
But it does nothing for an event source which is neither a timer nor
ratelimited.
2021-06-15 02:34:16 +09:00
Yu Watanabe
a595fb5ca9 sd-event: use usec_add() 2021-06-15 01:01:48 +09:00
Yu Watanabe
06e131477d sd-event: use CMP() macro 2021-06-15 00:51:33 +09:00
Yu Watanabe
7e2bf71ca3 sd-event: drop unnecessary "else" 2021-06-15 00:44:04 +09:00
Topi Miettinen
1753d30215 Revert "Mount all fs nosuid when NoNewPrivileges=yes"
This reverts commit d8e3c31bd8e307c8defc759424298175aa0f7001.

A poorly documented fact is that SELinux unfortunately uses nosuid mount flag
to specify that also a fundamental feature of SELinux, domain transitions, must
not be allowed either. While this could be mitigated case by case by changing
the SELinux policy to use `nosuid_transition`, such mitigations would probably
have to be added everywhere if systemd used automatic nosuid mount flags when
`NoNewPrivileges=yes` would be implied. This isn't very desirable from SELinux
policy point of view since also untrusted mounts in service's mount namespaces
could start triggering domain transitions.

Alternatively there could be directives to override this behavior globally or
for each service (for example, new directives `SUIDPaths=`/`NoSUIDPaths=` or
more generic mount flag applicators), but since there's little value of the
commit by itself (setting NNP already disables most setuid functionality), it's
simpler to revert the commit. Such new directives could be used to implement
the original goal.
2021-06-15 00:33:22 +09:00
Luca Boccassi
2fbb5df8e9
Merge pull request #19898 from yuwata/network-multipath-route-without-interface-name
network: set link ifindex when multi-path routes specified without interface name
2021-06-14 14:27:50 +01:00
Luca Boccassi
feaf43158a
Merge pull request #19894 from yuwata/network-fix-configure-without-carrier
network: always check dynamic address assignments before entering con…
2021-06-14 14:23:09 +01:00
Luca Boccassi
1340574cf7
Merge pull request #19866 from yuwata/sd-device-new-from-ifindex
sd-device: introduce sd_device_new_from_ifindex()
2021-06-14 14:21:17 +01:00
Yu Watanabe
b5d0fd1e7f network: drop misleading debugging logs about MTU
This fixes the following spurious logs on enumerating links:
```
wlan0: Saved original MTU 1500 (min: 256, max: 2304)
wlan0: MTU is changed: 0 → 1500 (min: 256, max: 2304)
```
2021-06-14 14:19:02 +01:00
Yu Watanabe
d05c332c8d network: try to bring down before setting MAC address
Most real network devices refuse to set MAC address when its operstate
is not down. So, setting MAC address once failed, then let's bring down
the interface and retry to set.

Closes #6696.
2021-06-14 20:42:54 +09:00
Yu Watanabe
5388e103ea network: check the size of hardware address before setting MAC address
Also, skip to set MAC address when the current address equals to the
requrested one.
2021-06-14 20:42:50 +09:00
Jayanth Ananthapadmanaban
279082ed49 Add a network timeout option to journal-upload 2021-06-14 11:16:38 +02:00
Daniel Schaefer
5a750c49a9 doc: Add RISC-V to FAQ
Was added to the spec in 499f0f8209f33da0b6e3b0d6f3a13996edcc7555.
2021-06-13 18:20:09 +09:00
Zbigniew Jędrzejewski-Szmek
dce95d0b15 test/TEST-17-UDEV: use default image
No need to build a separate 700MB image to save 3080 bytes in the default image.
2021-06-12 11:19:04 +02:00
Yu Watanabe
4bcb862548 network: always check dynamic address assignments before entering configured state
Previously (v248 or earlier), even if no static address is configured,
the link did not enter configured state, as e.g. Link::static_addresses_configured
is false until the link gained its carrier.
But, after the commit 1187fc337577cecd685d331eeab656be186ba3b2, the
situation was changed. Static addresses, routes, and etc are requested even
if the link does not have its carrier, and thus the link enters configured
state when no static address and etc are specified.

This makes the link does not enter configured state before it gains its
carrier when at least one of dynamic address assignment protocols (e.g.
DHCP) except for NDISC is enabled.

Note that, unfortunately, netplan always enables ConfigureWithoutCarrier=
for all virtual devices, e.g. bridge. See,
978e20f902
So, we need to support e.g. the following strange config:
```
[Netowkr]
ConfigureWithoutCarrier=yes
DHCP=yes
```

Fixes #19855.
2021-06-12 08:51:16 +09:00
Yu Watanabe
740b638267 test-network: disable dynamic addressing protocols when ConfigureWithoutCarrier= is enabled 2021-06-12 08:51:16 +09:00
Yu Watanabe
705c7b1860 test-network: refuse routable state when no-carrier is expected
If we do not set the maximum operstate in wait-online, then routable
state is allowed when no-carrier state is expected.
2021-06-12 08:51:16 +09:00
Yu Watanabe
7a0fef8688 test-network: add a testcase for MultiPathRoute= without interface name 2021-06-12 05:37:57 +09:00
Yu Watanabe
08c2fcdc0d network: route: set link ifindex when multi-path routes specified without interface name
And do not set RTA_OIF attribute when multi-path routes are specified.
See kernel's fib_get_nhs() in net/ipv4/fib_semantics.c.

Fixes #19890.
2021-06-12 05:34:52 +09:00
Yu Watanabe
af7b405dff sd-dhcp: refuse to set iaid if we cannot find the interface 2021-06-12 03:19:08 +09:00
Yu Watanabe
8d71f2b3a6 dhcp: do not use ifindex when generating iaid in tests 2021-06-12 03:19:08 +09:00
Yu Watanabe
0299deab53 sd-dhcp: do not use detect_container() to guess udev is running or not 2021-06-12 03:19:08 +09:00
Yu Watanabe
27fce94ae6 nspawn: path_is_read_only_fs() may return negative errno
And we usually assume /sys is not read only on error.
2021-06-12 03:19:08 +09:00
Yu Watanabe
0ac655a63b tree-wide: use sd_device_new_from_ifindex/ifname() 2021-06-12 03:19:08 +09:00
Yu Watanabe
bd44a727f7 sd-device: introduce sd_device_new_from_ifname/ifindex() 2021-06-12 03:19:08 +09:00
Yu Watanabe
afdf6c3b60 netlink: make rtnl_resolve_link_alternative_name() optionally return the main interface name 2021-06-12 03:19:08 +09:00
Yu Watanabe
57bd6aa701 netlink: check input name is valid before calling netlink method 2021-06-12 03:19:08 +09:00
Yu Watanabe
f6e491547d netlink: move resolve_ifname() or friends to netlink-util.[ch] 2021-06-12 03:19:08 +09:00
Yu Watanabe
f0ad7aedd9 network: use link_get_by_name() 2021-06-12 03:19:08 +09:00
Zbigniew Jędrzejewski-Szmek
756755d0fc docs: update coding style a bit
Say that r should be declared at the top of the function.

Don't say that fixed buffers result in truncation, right after saying that they
must only be used if size is known.

Adjust order of examples to be consistent.
2021-06-11 18:45:31 +01:00
Zbigniew Jędrzejewski-Szmek
e77365b479
Merge pull request #19882 from keszybz/test-stat-util-more
Add a test for path_is_read_only_fs()
2021-06-11 18:44:58 +02:00
Lennart Poettering
8f56d1a859 update TODO 2021-06-11 16:13:49 +02:00
Michal Koutný
cc815b7fea core: Avoid spurious realization of unit cgroups
Cgroups may be unnecessarily realized when they are not needed. This
happens, e.g. for mount units parsed from /proc/$PID/mountinfo, check

        touch /run/ns_mount
        unshare -n sh -c "mount --bind /proc/self/ns/net /run/ns_mount"
        # no cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount
        systemctl daemon-reload
        # the vain cgroup exists
        file /sys/fs/cgroup/system.slice/run-ns_mount.mount

. (Such cgroups can account to a large number with many similar mounts.)

The code already accounts for "lazy" realization (see various checks for
Unit.cgroup_realized) but the unit_deserialize() in the reload/reexec
path performs unconditional realization.

Invalidate (and queue) the units for realization only if we know that
they were already realized in the past. This is a safe thing to do even
in the case the reload brings some new cgroup setting (controllers, BPF)
because units that aren't realized will use the updated setting when the
time for their realization comes. (It's not even needed to add a code
comment because the current formulation suggests the changed behavior.)
2021-06-11 10:34:22 +01:00
Zbigniew Jędrzejewski-Szmek
dbb3b26f1b man: clarify that global search domains apply to global servers, not all interfaces
Fixes #19257.
2021-06-11 10:32:42 +01:00
Zbigniew Jędrzejewski-Szmek
51db8fdb92 test-stat-util: don't fail under chroot
I wanted to see what is_path_read_only_fs() and is_path_temporary_fs() return
in a chroot, and various tests would fail. For most of our codebase, we can
assume that /proc and such are mounted, and it doesn't make sense to make the
tests work in a chroot. But let's do it here. (In general, it would be useful
for most stuff in src/basic/, since it's linked into libraries which might be
invoked in incorrectly set up environments and should not fail too badly.)
2021-06-11 07:40:53 +02:00
Luca Boccassi
7ad9bad71b
Merge pull request #19811 from anitazha/revert_mount_rl
sd-event: fix failure to exit rate limiting state
2021-06-10 23:41:55 +01:00
Luca Boccassi
390a22f4b1
Merge pull request #19864 from keszybz/serialization-cleanup
Serialization cleanup
2021-06-10 23:40:23 +01:00
nl6720
9dfb429a44 kbd-model-map: add Latvian keyboard layout mapping 2021-06-10 23:29:32 +01:00
Zbigniew Jędrzejewski-Szmek
6080987130
Merge pull request #18851 from yuwata/dissect-try-to-find-partition-on-timeout
dissect: try to find partition more frequently
2021-06-10 19:09:18 +02:00
Zbigniew Jędrzejewski-Szmek
c3988f36d3
Merge pull request #19870 from keszybz/install-foo-again
Tweak the install logic again
2021-06-10 18:56:03 +02:00
Lennart Poettering
31251469c0
Merge pull request #19878 from poettering/large-key-file-cryptsetup
add back support for large key files to systemd-cryptsetup
2021-06-10 17:10:32 +02:00
Štěpán Němec
6ae11e1220 docs/CODING_STYLE: fix some typos 2021-06-10 15:29:28 +01:00
Zbigniew Jędrzejewski-Szmek
ab18976b35 core/serialize: drop bogus deserialization of ipcns sockets
a70581ffb5c13c91c76ff73ba6f5f3ff59c5a915 added ExecRuntime.ipcns_storage_socket[], and
serialization in exec_runtime_serialize(), and deserialization in exec_runtime_deserialize_one(),
but also deserialization in exec_runtime_deserialize_compat(). exec_runtime_deserialize_compat()
is for deserializating ExecRuntime when it was serialized as part of the unit before
e8a565cb660a7a11f76180fe441ba8e4f9383771. There was never any code which would serialize
ExecRuntime.ipcns_storage_socket[] this way, so the deserialization attempts are pointless.
2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
cbc165d17e core/serialization: shorten code, treat all oom error the same 2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
1085c0eb69 core/serialization: drop misleadingly-named unit_can_serialize()
All unit types can be serialized. This function was really checking whether the
unit type has custom serialization/deserialization code. But we don't need a
function for this.

Also, the check that both .serialize() and .deserialize_item() are defined is
better written as an assert. Not we have a function which would skip
serialization/deserializaton for the unit if we forgot to set either of the
fields.
2021-06-10 14:17:58 +02:00
Zbigniew Jędrzejewski-Szmek
d8d0da1f19 test-stat-util: add a very basic test for test_path_is_read_only() 2021-06-10 13:45:55 +02:00
Zbigniew Jędrzejewski-Szmek
b845894c80 test-stat-util: add standard test logging 2021-06-10 13:45:55 +02:00
Lennart Poettering
871f35af85 cryptsetup: improve error message when key files to load are too large
Let's make this easier to grok for users.

Prompted-by: #19193
2021-06-10 10:55:02 +02:00
Lennart Poettering
f6dd48fae8 fileio: bump limit for read_full_file() and friends to 64M
Apparently people use such large key files. Specifically, people used 4M
key files, and we lowered the limit from 4M to 4M-1 back in 248.

This raises the limit to 64M for read_full_file() to avoid these
specific issues and give some non-trivial room beyond the 4M files seen
IRL.

Note that that a 64M allocation in glibc is always immediately done via
mmap(), and is thus a lot slower than shorter allocations. This means
read_virtual_file() becomes ridiculously slow if we'd use the large
limit, since we use it all the time for reading /proc and /sys metadata,
and read_virtual_file() typically allocates the full size with malloc()
in advance.  In fact it becomes so slow, that test-process-util kept
timing out on me all the time, once I blindly raised the limit.

This patch hence introduces two distinct limits for read_full_file() and
read_virtual_file(): the former is much larger than the latter and the
latter remains where it is. This is safe since the former uses an
exponentially growing realloc() loop while the latter uses the
aforementioend ahead-of-time full limit allocation.

Fixes: #19193
2021-06-10 10:51:00 +02:00
Zbigniew Jędrzejewski-Szmek
ad5fdd3912 shared/install: ignore enablement of template units w/o instance when presetting
When we have a unit which cannot be enabled:
 # foo@.service:
 ...
 [Install]
 WantedBy=foo.target  # there is no instance, so we don't know what to enable

we should throw an error when invoked directly with 'enable', but
not when doing 'preset' or 'preset-all'.

Fixes #19856.
2021-06-10 10:02:38 +02:00
Zbigniew Jędrzejewski-Szmek
9b69770a49 shared/install: pass UnitFileFlags down into the call chain
This just propagates the parameter down into leaf functions,
without any functional change.
2021-06-10 10:00:36 +02:00
Lennart Poettering
527653f827
Merge pull request #19857 from yuwata/tmpfile-fix
tmpfiles: fix an issue found by Coverity
2021-06-10 09:30:57 +02:00
Lennart Poettering
bb25f236d4
Merge pull request #19863 from keszybz/coverity-drop-unitialized-workarounds
Drop some -Wmaybe-unitialized workarounds to help coverity
2021-06-10 09:29:59 +02:00
Lennart Poettering
0629adf7c3
Merge pull request #19867 from yuwata/ether-addr-util
ether-addr-util: introduce hw_addr_equal() and friends
2021-06-10 09:29:36 +02:00
Zbigniew Jędrzejewski-Szmek
8331b221ba core/dbus: rename internal variable for clarity 2021-06-10 07:32:38 +02:00
Anita Zhang
c48bc311a5 man: add note about operation without swap in systemd-oomd 2021-06-10 07:24:18 +02:00
nerdopolis
3c3335c714 Clarify help information for --global 2021-06-10 07:23:05 +02:00
Lennart Poettering
81107b8419 sd-event: change ordering of pending/ratelimited events
Instead of ordering non-pending before pending we should order
"non-pending OR ratelimited" before "pending AND not-ratelimited".
This fixes a bug where ratelimited events were ordered at the end of the
priority queue and could be stuck there for an indeterminate amount of
time.
2021-06-09 21:02:22 -07:00
Yu Watanabe
c68cafbabe tmpfile: always get file descriptor of root or current directory
Fixes CID#1457467.
2021-06-10 05:42:03 +09:00
Zbigniew Jędrzejewski-Szmek
998571a7f4
Merge pull request #19871 from yuwata/man-network-missing-settings
man: add missing settings
2021-06-09 22:15:38 +02:00
Zbigniew Jędrzejewski-Szmek
67e9c83bad cryptsetup: remove unitialized workaround
Doesn't seem needed anymore.
2021-06-09 22:01:13 +02:00
Zbigniew Jędrzejewski-Szmek
21996f81b2 test-capability: drop work-around initialization
Since those workarounds have been added, work has been done to tighten
up log_*() return values. Seems we get no warning with
gcc-11.1.1-1.fc34.x86_64 and -O0/-O2.
2021-06-09 22:01:13 +02:00
Zbigniew Jędrzejewski-Szmek
59ca71a93d networkd: drop one workaround initialization
As for the other ones in src/network/, if they are removed, gcc warns when they
are removed.

Should fix Coverity CID#1457466.
2021-06-09 22:00:28 +02:00
Lennart Poettering
2f88100557
Merge pull request #19861 from poettering/hwdb-249
hwdb + syscall database updates for 249
2021-06-09 21:54:42 +02:00
Yu Watanabe
c3006a485c man: add missing settings
Fixes #19869.
2021-06-10 04:47:13 +09:00
Yu Watanabe
b9a4bc7070 network: sort settings about netdev 2021-06-10 04:46:44 +09:00
Yu Watanabe
85bc4c080d man: merge several settings about netdev 2021-06-10 04:46:40 +09:00
Zbigniew Jędrzejewski-Szmek
e1f2f7f194 shared/install: improve message about template mismatch
$ systemctl enable --root=/ serial-getty@.service
Failed to enable unit, unit getty.target is a non-template unit.
↓
Failed to enable serial-getty@.service, destination unit getty.target is a non-template unit.
2021-06-09 21:39:33 +02:00
Zbigniew Jędrzejewski-Szmek
4a203a5177 shared/install: remove custom error handling in unit_file_preset_all()
This had some purpose back in the day, but right now I cannot see what
difference this makes. It's hard to keep the list of all possible errors up to
date. So let's remove this, hopefully nothing breaks.
2021-06-09 21:39:33 +02:00
Zbigniew Jędrzejewski-Szmek
3aa96361ed shared/install: ignore failures for auxiliary files
If Also= fails, warn, but otherwise ignore the failure.

Fixes #19407.
2021-06-09 21:39:15 +02:00
Anita Zhang
0c81900965 test: add extended test for triggering mount rate limit
It's hard to trigger the failure to exit the rate limit state in
isolation as it needs multiple event sources in order to show that it
gets stuck in the queue. Hence why this is an extended test.
2021-06-09 12:04:56 -07:00
Peter Morrow
dbb8b5bcf7 man: fix missing markdown & minor errors
In #19771 there were a few missing markdown tags a few style issue.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2021-06-09 19:18:11 +01:00
Yu Watanabe
4b574fd813 ether-addr-util, network: introduce ETHER_ADDR_TO_STR() macro and use it 2021-06-10 00:37:50 +09:00
Yu Watanabe
f929f18c59 network: use hw_addr_equal() or friends 2021-06-10 00:29:59 +09:00
Yu Watanabe
30b977251c ether-addr-util: introduce hw_addr_compare(), hw_addr_equal(), and hw_addr_is_null() 2021-06-10 00:24:43 +09:00
Yu Watanabe
ca2b7cd813 ether-addr-util: drop redundant "addr" from struct hw_addr_data
Also, this makes always specifiy "struct" for hw_addr_data.
2021-06-10 00:19:50 +09:00
Lennart Poettering
91d0750dbf
Merge pull request #19854 from poettering/journal-enum-uniq-fix
fix journalctl -F
2021-06-09 15:37:01 +02:00
Lennart Poettering
34254e599a seccomp: add some recently added syscalls to filter groups 2021-06-09 15:36:19 +02:00
Zbigniew Jędrzejewski-Szmek
fe50aae5e1 core/serialization: call exec_runtime_deserialize_compat() independently of whether .serialize is defined
There is no reason to tie the two together: in principle we may have
in the future a unit type which does not define .serialize/.deserialize_item,
but we would still want to call the compat deserialization code for it.
2021-06-09 12:54:27 +02:00
Zbigniew Jędrzejewski-Szmek
6923020ec1 networkd: reorder conditional to handle errors first
This also avoid the implicit assumption that if r is not -ENOENT, 0, or 1,
it must be negative. The compiler cannot know this.
2021-06-09 12:48:52 +02:00
Lennart Poettering
86e2c53c7f hwdb: run ninja hwdb-update 2021-06-09 11:45:08 +02:00
Lennart Poettering
2ded911208 hwdb: run ninja update-hwdb-autosuspend 2021-06-09 11:41:13 +02:00
Lennart Poettering
5156e6804d syscalls: run ninja update-syscall-* 2021-06-09 11:40:14 +02:00
Lennart Poettering
00fb6caf70 update NEWS 2021-06-09 11:37:26 +02:00
Štěpán Němec
7833a46ca1 docs/CGROUP_DELEGATION: fix some typos 2021-06-09 11:04:17 +02:00
Lennart Poettering
bead169fe0
Merge pull request #19851 from poettering/bpf-firewall-tweaks
close bpf firewall reload gap
2021-06-09 09:47:23 +02:00
Lennart Poettering
2e1a8a5dab journal: don't try to reuse already calculated hash between files with keyed hash feature
When suppressing duplicate fields between files we so far tried to reuse
the already known hash value of the data fields between files. This was
fine as long as we used the same hash function everywhere. However,
since addition of the keyed hash feature for journal files this doesn't
work anymore, since the hashes will be different for different files.

Fixes: #19172
2021-06-09 09:34:55 +02:00
Lennart Poettering
8d5a1082b0 journal: remove an unnecessary 'else' 2021-06-09 09:34:55 +02:00
Lennart Poettering
0e0b05294b journal: make return parameters for sd_journal_enumerate_unique() optional 2021-06-09 09:34:50 +02:00
Lennart Poettering
f4cb1bfd57 journal: as per coding style don't clobber return parameters in sd_journal_get_cutoff_monotonic_usec() on failure 2021-06-09 09:34:50 +02:00
Lennart Poettering
900952ecd5 journal: use free_and_strdup() where appropriate 2021-06-09 09:34:50 +02:00
Lennart Poettering
d8671b1c6f journal: add some careful overflow checking 2021-06-09 09:34:50 +02:00
Yu Watanabe
21e43a7c51 tmpfile: several minor coding style fixes
This makes the followings:
- reduces scope of variables,
- drop unnecessary 'else'
- use CLOSE_AND_REPLACE() macro
- use strnull() for possible NULL string
2021-06-09 13:30:19 +09:00
Yu Watanabe
045d7232b5
Merge pull request #19852 from yuwata/network-stable-secret
network: introduce IPv6StableSecretAddress= to configure secret key for generating IPv6LL address
2021-06-09 12:30:57 +09:00
Lennart Poettering
e68778a3ac journald: when journald namespace instances log, they can do so safely to the main journald instance
Fixes: #18951
2021-06-09 12:30:22 +09:00
Yu Watanabe
0acd7f1c5f
Merge pull request #19831 from yuwata/network-next2
network: several interface up/down and setting MTU related updates
2021-06-09 12:27:37 +09:00
Luca Boccassi
165c23c6b2 NEWS: list more recent changes 2021-06-08 21:23:26 +01:00
Lennart Poettering
dbef3d163b bpf-firewall: close gap when updating the firewall
If we have BPF_F_ALLOW_MULTI support we can install the new program
before we drop the old (because we can install two program at the same
time). Let's do that, and thus fully close the firewall
gap.
2021-06-08 22:02:35 +02:00
Lennart Poettering
a947ebb515 bpf-program: document BPFProgram a bit 2021-06-08 22:02:35 +02:00
Lennart Poettering
b57d752326 bpf-program: serialize attached BPF programs across daemon reexec/reload
Alternative to #17495
2021-06-08 22:02:35 +02:00
Lennart Poettering
7a7cf83dc3 bpf-program: export hash_ops for BPFProgam objects 2021-06-08 22:02:35 +02:00
Lennart Poettering
06ad9d0c12 bpf-program: use structured initialization when allocating BPFProgram objects 2021-06-08 22:02:35 +02:00
Lennart Poettering
d63a3d350f bpf-link: prefix function names with "bpf_"
we generally do this for all bpf functions, do so here too.
2021-06-08 22:02:35 +02:00
Lennart Poettering
cd09a5f3c1 core: rename socket-bind.[ch] → bpf-socket-bind.[ch]
The other BPF infra has a file name prefix of "bpf-" hence do so here
too.
2021-06-08 22:02:32 +02:00
Yu Watanabe
baa95d2274 network: do not process requests which conditionalized with link flags while the flags are updating
E.g. nexthop requires IFF_UP flag, but the currently stored flag may be
outdated if we called link_down(). This makes such requests pending if
at least one of the flags are updating.
2021-06-09 04:59:23 +09:00
Yu Watanabe
2a057a7340 network: make several link settings critical 2021-06-09 04:59:23 +09:00
Yu Watanabe
712fd5d25a network: use request queue to handle always-up or -down activation policy 2021-06-09 04:59:23 +09:00
Yu Watanabe
68f5206349 network: use request queue to handle bound_to list 2021-06-09 04:59:23 +09:00
Yu Watanabe
aa9117c0c4 network: handle bound_by list even if IgnoreCarrierLoss=yes 2021-06-09 04:59:23 +09:00
Yu Watanabe
ad82f0c32b network: add brief comments about bound_to and bound_by list 2021-06-09 04:59:23 +09:00
Yu Watanabe
899b0e5eec network: apply activation policy only when it is once activated
Otherwise, e.g., if activation policy is always-up is set for bond
slave, then setting bond configuration may fail.
2021-06-09 04:59:23 +09:00
Yu Watanabe
da4929eeb9 network: do not drop requests on carrier lost
On carrier lost, then all requests which require carrier will not be
processed. And they will be processed when the interface gained its
carrier again. So, it is not necessary to drop requests here.
2021-06-09 04:59:23 +09:00
Yu Watanabe
e95c06c977 network: route: update error message 2021-06-09 04:59:23 +09:00
Yu Watanabe
e56e1a15b5 network: also adjust IPv6 MTU by the maximum MTU of the interface 2021-06-09 04:59:23 +09:00
Yu Watanabe
717ba5fc90 network: read the minimum and maximum MTU of the interface, and adjust requested MTU based on these values 2021-06-09 04:59:23 +09:00
Yu Watanabe
7558f9e717 network: use request queue to configure CAN interfaces
This also makes SR-IOV configurations are ignored for CAN interfaces,
as CAN interfaces seem not to support SR-IOV features.
2021-06-09 04:59:23 +09:00
Yu Watanabe
4681ab5547 test-network: add a test case for IPv6StableSecretAddress= 2021-06-09 04:56:52 +09:00
Yu Watanabe
9e1432d5cc network: introduce IPv6StableSecretAddress= setting
Previously, IPv6LinkLocalAddressGenerationMode= is not set, then we
define the address generation mode based on the result of reading
stable_secret sysctl value. This makes the mode is determined by whether
a secret address is specified in the new setting.

Closes #19622.
2021-06-09 04:56:48 +09:00
Lennart Poettering
0b05142494 bpf: various coding style fixes
Mostly logging related: let's downgrade logging in dlopen_bpf() for
example, and remove duplicate logging at various places. Add %m to log
messages and so on.
2021-06-08 21:54:49 +02:00
Lennart Poettering
0fd9c28cc9 bpf-firewall: move destruction of IP firewall objects to bpf-firewall.c
These are so many runtime objects, let's add a bpf_firewall_close()
helper that destroys them all, and call that from unit_free(), simply as
an excercise of encapsulating more BPF code in bpf-firewall.c.

This also brings the destruction order and variable declaration order in
struct Unit into the same systematic order.

No change in behaviour just some minor refactoring.
2021-06-08 21:54:49 +02:00
Zbigniew Jędrzejewski-Szmek
7ff9d99e9e test-libcrypt-util: print out default for password settings, run make_salt() a few times
Inspired by
https://fedoraproject.org/wiki/Changes/yescrypt_as_default_hashing_method_for_shadow.
2021-06-08 21:41:17 +02:00
Zbigniew Jędrzejewski-Szmek
a77f9dfbae resolved: fix strange function recursion
In dns_server_unlink_marked() and dns_server_mark_all() we done recursively.
People might have dozens of servers defined, and it's better to avoid recursion
when a simple loop suffices.

dns_server_unlink_marked() would only unmark the first marked server.

Fixes #19651.
2021-06-08 21:40:54 +02:00
Vito Caputo
592d419ce6 journal-file: truncate archived journals
Journal files have space allocated in 8MiB-aligned increments.

This can add up to substantial wasted space as many archived journals
accumulate without using all the allocated space.

This commit introduces truncating to the offset a subsequent append
would get written at when archiving.

Fixes https://github.com/systemd/systemd/issues/17613
2021-06-08 21:36:47 +02:00
Yu Watanabe
61730746f7 dissect: find partition more frequently
With the previous commit, the partition may be found after 45 sec. It is
too late. Let's find partition more frequently.
2021-06-09 02:54:44 +09:00
Yu Watanabe
05c3c620f7 dissect: try to find partition again on timeout
Not sure, but at the time the target partition device is created or
enumerated, some sysattrs or properties may not be ready.

So, let's find partition on timeout. The device may be ready at that
time.
2021-06-09 02:54:29 +09:00
Srinidhi Kaushik
7f7a50dd15 tmpfiles: extend "Age" to accept an "age-by" argument
For "systemd-tmpfiles --cleanup", when the "Age" parameter
is specified, the criteria for deletion is determined from
the path's last modification timestamp ("mtime"), its last
access timestamp ("atime") and its last status change
timestamp ("ctime").

For instance, if one of those paths to be cleaned up are
opened, it results in the modification of "atime", which
results file system entry to not be removed because the
default aging algorithm would skip the entry.

Add an optional "age-by" argument by extending the "Age"
parameter to restrict the clean-up for a particular type
of file timestamp, which can be specified in "tmpfiles.d"
as follows:

  [age-by:]cleanup-age, where age-by is "[abcmACBM]+"

For example:

  d /foo/bar - - - abM:1m -

Would clean-up any files that were not accessed and created,
or directories that were not modified less than a minute ago
in "/foo/bar".

Fixes: #17002
2021-06-08 18:24:58 +02:00
Lennart Poettering
66973219c0
Merge pull request #19166 from bluca/coredump_compress_on_the_fly
coredump: compress on the fly
2021-06-08 18:24:34 +02:00
Yu Watanabe
c50404aecc udev: make WakeOnLan= take multiple features
WAKE_XXX are flag, not enum.
2021-06-08 18:24:11 +02:00
Yu Watanabe
3da0caf5bb core/socket: do not assign another fd to SocketPort which already has a fd on deserialization
Otherwise, if a socket address is duplicated, then the previous fd is
closed.

Fixes #19843.
2021-06-08 18:23:47 +02:00
Lennart Poettering
fd5f48af5c
Merge pull request #19817 from keszybz/switch-root-serialization
Drop serialization of mounts and automounts over root switch
2021-06-08 18:22:58 +02:00
Allen Webb
c46c323385 tmpfiles: add '=' action modifier.
Add the '=' action modifier that instructs tmpfiles.d to check the file
type of a path and remove objects that do not match before trying to
open or create the path.

BUG=chromium:1186405
TEST=./test/test-systemd-tmpfiles.py "$(which systemd-tmpfiles)"

Change-Id: If807dc0db427393e9e0047aba640d0d114897c26
2021-06-08 17:23:26 +02:00
Peter Morrow
90a404f5d4 man: add details on overriding top level drop-ins
When using top level drop-ins it isn't immediately obvious that one can
make use of symlinking to disable a top-level drop in for a specific
unit.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2021-06-08 17:03:03 +02:00
Zbigniew Jędrzejewski-Szmek
755021d434 core: do not serialize mounts and automounts for switch-root
When e.g. tmp.mount is present in the initrd, and we serialize it, switch root,
and deserialize, the new systemd is confused because it thinks /tmp is mounted.
In general, it doesn't make sense to serialize anything that refers to paths in
the old root file system.

This fixes two errors for me:

1. tmp.mount was not mounted properly before local-fs.target. It would be
mounted as some point (I guess when we re-read /proc/self/mountinfo for some
other reason). In effect systemd-tmpfiles-setup.service would see one fs, and
some other units started later a different one. In particular gdm.service would
fail because the pre-created /tmp/.X11-unix with proper permissions would not
exist at time it was started.

2. # systemd[1]: proc-sys-fs-binfmt_misc.automount: Got hangup/error on autofs pipe from kernel. Likely our automount point has been unmounted by someone or something else?
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Failed with result 'unmounted'.
   # systemd[1]: Mounting proc-sys-fs-binfmt_misc.mount...
   # systemd[1]: Mounted proc-sys-fs-binfmt_misc.mount.
   # systemd[1]: Starting systemd-binfmt.service...
   # systemd[1]: Finished systemd-binfmt.service.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: proc-sys-fs-binfmt_misc.automount: Path /proc/sys/fs/binfmt_misc is already a mount point, refusing start.
   # systemd[1]: Failed to set up automount proc-sys-fs-binfmt_misc.automount.
   # systemd[1]: Stopping systemd-binfmt.service...
   # systemd[1]: systemd-binfmt.service: Deactivated successfully.
   # systemd[1]: Stopped systemd-binfmt.service.

I couldn't understand the error here, but in retrospect the first line is entirely
correct: "someone or something else" was the old systemd unmounting the old root.
2021-06-08 16:04:38 +02:00
Luca Boccassi
587f2a5e56 coredump: check cgroups memory limit if storing on tmpfs
When /var/lib/systemd/coredump/ is backed by a tmpfs, all disk usage
will be accounted under the systemd-coredump process cgroup memory
limit.
If MemoryMax is set, this might cause systemd-coredump to be terminated
by the kernel oom handler when writing large uncompressed core files,
even if the compressed core would fit within the limits.

Detect if a tmpfs is used, and if so check MemoryMax from the process
and slice cgroups, and do not write uncompressed core files that are
greater than half the available memory. If the limit is breached,
stop writing and compress the written chunk immediately, then delete
the uncompressed chunk to free more memory, and resume compressing
directly from STDIN.

Example debug log when this situation happens:

systemd-coredump[737455]: Setting max_size to limit writes to 51344896 bytes.
systemd-coredump[737455]: ZSTD compression finished (51344896 -> 3260 bytes, 0.0%)
systemd-coredump[737455]: ZSTD compression finished (1022786048 -> 47245 bytes, 0.0%)
systemd-coredump[737455]: Process 737445 (a.out) of user 1000 dumped core.
2021-06-08 14:05:56 +01:00
Luca Boccassi
5b6f8e13ad compress: return uncompressed size to the caller
Useful when compressing anonymous FDs that cannot be rewund
2021-06-08 14:05:56 +01:00
Luca Boccassi
93ff34e44a core: add MemoryAvailable unit property
Try to infer the unused memory that a unit can claim before the
memory.max limit is reached, including any limit set on any parent
slice above the unit itself.
2021-06-08 14:05:56 +01:00
Emilio Herrera
d477a094e8 po: Translated using Weblate (Spanish)
Currently translated at 62.9% (119 of 189 strings)

Co-authored-by: Emilio Herrera <ehespinosa57@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/es/
Translation: systemd/main
2021-06-08 11:28:46 +01:00
Zbigniew Jędrzejewski-Szmek
f75420a43a man: explain ConditionNeedsUpdate a bit more
We were effectively doing all post-upgrade scripts twice in Fedora. We got this
wrong, so it's likely other people will get it wrong too. So let's explain
what is actually needed to make this work, but also when it's not useful.
2021-06-08 10:47:11 +02:00
Yu Watanabe
16e09d51a7 meson: do not share compiler flags except for emitting warnings
Follow-up for 65267363978dbb298eb4ba9b628d028c969fa616.

Prompted by https://github.com/systemd/systemd/issues/19191#issuecomment-856312107.
2021-06-08 10:44:34 +02:00
alexlzhu
9f40351f77
man: update docs on systemd-system.conf logging (LogTime=) (#19846)
Updating documentation for systemd to reflect that logging is done in the console.
2021-06-08 15:54:07 +09:00
Yu Watanabe
50b9fa01ed
Merge pull request #19639 from yuwata/network-next
network: bunch of fixes and new features
2021-06-08 10:29:54 +09:00
Yu Watanabe
a7f07cbe34 network: wait for all set-link requests are processed 2021-06-08 06:39:48 +09:00
Yu Watanabe
29836c166d network: drop trivial aliases of link_set_state() 2021-06-08 06:39:48 +09:00
Yu Watanabe
1187fc3375 network: use link_request_to_set_master() or friends 2021-06-08 06:39:48 +09:00
Yu Watanabe
112a0972a2 network: introduce link_request_to_activate()
The request will be processed after all setlink requests are processed.
The function will be used in later commits.
2021-06-08 06:39:48 +09:00
Yu Watanabe
0e397560cc network: it is not necessary to call RTM_GETLINK when carrier is gained 2021-06-08 06:39:48 +09:00
Yu Watanabe
440d40dcc0 network: set bridge or bond properties after master ifindex is set 2021-06-08 06:39:48 +09:00
Yu Watanabe
1362bd6c64 network: sync link information after set-link request is processed
Some properties do not notify their changes. See do_setlink() in
net/core/rtnetlink.c of kernel.
2021-06-08 06:39:48 +09:00
Yu Watanabe
5a1860f761 network: use link_call_getlink() where applicable 2021-06-08 06:39:48 +09:00
Yu Watanabe
79c6e11456 network: introduce link_call_getlink() 2021-06-08 06:39:48 +09:00
Yu Watanabe
0d411b7f8f network: split link_update() into small pieces 2021-06-08 06:39:26 +09:00
Yu Watanabe
852a391605 network: shorten code a bit, and reduce indentation 2021-06-08 06:35:49 +09:00
Yu Watanabe
b156a95d4a network: update operational state or friends on reconfigure 2021-06-08 06:35:49 +09:00
Yu Watanabe
4b9a8c2b51 network: make link enter failed state when link_initialized() is failed 2021-06-08 06:35:49 +09:00
Yu Watanabe
0c9ee5d5e8 network: move functions
This changes no behavior. Preparation for later commits.
2021-06-08 06:35:49 +09:00
Yu Watanabe
813572853e network: introduce link_get_master() and use it where applicable 2021-06-08 06:35:49 +09:00
Yu Watanabe
8252fb4439 network: introduce link_request_to_set_bridge_vlan()
This will be used in later commits.
2021-06-08 06:35:45 +09:00
Yu Watanabe
bfd7fb09cf sd-netlink: add IFLA_BRIDGE_FLAGS and IFLA_BRIDGE_VLAN_INFO attributes 2021-06-08 06:34:41 +09:00
Yu Watanabe
5106ad00e6 network: expose bridge_vlan_append_info() 2021-06-08 06:34:38 +09:00
Yu Watanabe
5546870e7b network: introduce network_adjust_bridge_vlan() 2021-06-08 06:33:27 +09:00
Yu Watanabe
1a0e5ca2f3 network: rebreak arguments 2021-06-08 06:33:27 +09:00
Yu Watanabe
9670e45a6e network: rename networkd-brvlan.[ch] -> networkd-bridge-vlan.[ch] 2021-06-08 06:33:27 +09:00
Yu Watanabe
5062b8593a network: introduce link_request_to_set_bond()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe
7d5b232f40 network: introduce link_request_to_set_bridge()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe
71a754f70f network: introduce link_request_to_create_stacked_netdev()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe
d24bf1b514 network: introduce link_request_to_set_master()
The function will be used later.
2021-06-08 06:33:27 +09:00
Yu Watanabe
8e00e24cc9 network: use request queue to set IPv6LL address generation mode 2021-06-08 06:33:27 +09:00
Yu Watanabe
cc4c8fb136 network: use request queue to set interface group 2021-06-08 06:33:27 +09:00
Yu Watanabe
a8e5e27c9f network: use request queue to set MAC address 2021-06-08 06:33:27 +09:00
Yu Watanabe
93fabc10fa network: use request queue to set link flags 2021-06-08 06:33:27 +09:00
Yu Watanabe
0fa8ee6c77 network: use request queue to set MTU 2021-06-08 06:33:27 +09:00
Yu Watanabe
fa28381202 network: merge link_configure() and link_configure_continue() again
It is not necessary to stop whole configuration process until MTU and
IPv6LL address generation mode are set. But it is enough just setting
IPv6 MTU again after MTU is set, and dropping IPv6LL address after
setting the address generation mode.
2021-06-08 06:33:27 +09:00
Yu Watanabe
793117b3fd network: drop meaningless condition about setting MTU
The condition does not fix infinite loop of interface reset, as the
interface is reset after netlink reply is received, thus setting_mtu is
false.

See also #18738.
2021-06-08 06:33:27 +09:00
Yu Watanabe
b9bf3f22a8 network: introduces link_drop_ipv6ll_addresses()
It is not necessary to parse whole message and store the address in
Link::addresses_foreign, as the address will be removed soon later.
2021-06-08 06:33:27 +09:00
Yu Watanabe
f0269653e9 network: make link enter failed state on failure in link_update() and link_reset_carrier()
Previously, several failures in link_carrier_gained() make link enter
failed state, and other errors are ignored. Now, all failures in
link_carrier_gained(), moreover, link_update() are critical.
2021-06-08 06:33:27 +09:00
Yu Watanabe
8566df791e network: rename link_acquire_conf() -> link_acquire_dynamic_conf()
To clarify it starts dynamic configuration engines e.g. DHCP clients.
2021-06-08 06:33:27 +09:00
Yu Watanabe
9710895378 network: request to configure static settings earlier
Now, all static configs should be ordered after the link gains its carrier.
So, it is not necessary to wait for that before queuing requests.
2021-06-08 06:33:27 +09:00
Yu Watanabe
40b12fa20d network: introduce request_hash_ops to dedup requests
If KeepConfiguration= or ConfigureWithoutCarrier= is set, then the same
requests may be queued.
2021-06-08 06:33:27 +09:00
Yu Watanabe
5f33159190 network: expose hash and compare functions 2021-06-08 06:33:27 +09:00
Yu Watanabe
fdeba3f5cc network: use request queue to configure IPv6 proxy NDP addresses 2021-06-08 06:33:27 +09:00
Yu Watanabe
d8350b60e0 network: move logic for setting proxy_ndp sysctl to networkd-sysctl.c 2021-06-08 06:33:27 +09:00
Yu Watanabe
14d9ab9d32 network: introduce network_adjust_ipv6_proxy_ndp() 2021-06-08 06:33:27 +09:00
Yu Watanabe
354bc760cd network: address label: use request queue to configure address labels 2021-06-08 06:33:27 +09:00
Yu Watanabe
4c0c8d1e72 network: address label: use struct in6_addr instead
Address label is for IPv6.
2021-06-08 06:33:27 +09:00
Yu Watanabe
2551b422e1 network: address label: refuse IPv4 mapped address with large prefix length
See ip6addrlbl_alloc() in net/ipv6/addrlabel.c of kernel.
2021-06-08 06:33:27 +09:00
Yu Watanabe
c3e960883f in-addr-util: introduce in6_addr_is_ipv4_mapped_address() 2021-06-08 06:33:27 +09:00
Yu Watanabe
9a038aaced network: use request queue to configure bridge MDB 2021-06-08 06:33:27 +09:00
Yu Watanabe
ff9e07838d network: rename MdbEntry -> BridgeMDB 2021-06-08 06:33:27 +09:00
Yu Watanabe
9373f5a812 test-network: fix setting name
This fixes an issue introduced by 72ffb9133d686bef6d9d79e9d2899571651d5c1b.
2021-06-08 06:33:27 +09:00
Yu Watanabe
4e0006cc4b test-network: add a testcase for UplinkInterface= for DHCP server 2021-06-08 06:33:27 +09:00
Yu Watanabe
165d7c5c42 network: introduce UplinkInterface= setting for DHCP server 2021-06-08 06:33:27 +09:00
Yu Watanabe
fb3aec45a0 network: make manager_find_uplink() uses stored route information
networkd already has all information about routes. It is not necessary
to re-read them by using local_gateways().

This also makes manager_find_uplink() take family.
2021-06-08 06:33:27 +09:00
Yu Watanabe
ab486ef4eb network: restart DHCP server on carrier gain 2021-06-08 06:33:27 +09:00
Yu Watanabe
b27e5d53f3 sd-dhcp-server: make sd_dhcp_server_start() no-op if it is already running 2021-06-08 06:33:27 +09:00
Yu Watanabe
1d28a3cf6c network: use request queue to configure DHCP server 2021-06-08 06:33:27 +09:00
Ondrej Kozina
1319c7e044 cryptsetup-pkcs11: use erase_and_free for decrypted key cleanup.
It's hard to hit but it could leave decrypted key in memory on error
path.
2021-06-07 23:09:00 +02:00
Ondrej Kozina
26fbc5aa05 cryptsetup: Fix misplaced assert.
Seems the assert should be placed in-before decrypted_key
pointer is passed to libcryptsetup API.

Original placement would trigger abort in case tpm2
hw was not present in the system while required
to activate crypt devices.
2021-06-07 22:40:32 +02:00
Yu Watanabe
b6fce22a67
Merge pull request #19839 from yuwata/network-address-fix-flags-handling
network: fix address flag handling
2021-06-08 03:38:15 +09:00
Zbigniew Jędrzejewski-Szmek
b0ec372a96 install: allow adding plain templates to .wants/ or .requires/
Fixes #19437.

As reported in the bug:

> # drkonqi-coredump-processor@.service
>  ...
> [Install]
> WantedBy=systemd-coredump@.service
>
> The plan here is to have a systemd-coredump@ instance start the same %i for
> drkonqi-coredump-processor@. Works perfectly when creating the symlink manually
> ln -sv /usr/lib/systemd/system/drkonqi-coredump-processor@.service
> /etc/systemd/system/systemd-coredump@.service.wants/.

When DefaultInstance is set, we replace template references with
template@default-inst. But in this case we want to create a symlink for the
template name, so that systemd will fill in the instance from the
wanting/requiring unit. This is only possible for those units that actually
have an instance set, so we create the symlink only from .requires/ or .wants
of an instantiated unit (then this specific instance will be used), or a
template (than some instance will be inherited later).

Specifically:
...
[Install]
WantedBy=other@.service, fixed.service
DefaultInstance=inst

→ enable foo@.service creates other@.service.wants/foo@inst.service, and
other@a.service will want foo@inst.service, and other@b.service will want foo@inst.service,
and fixed.service will want foo@inst.service.

Without DefaultInstance,
→ enable foo@.service creates other@.service.wants/foo@.service, and
other@a.service would want foo@a.service, and other@b.service would want foo@b.service,
but enablement fails because no dependency can be created for fixed.service:

  Failed to enable unit, unit fixed.service is a non-template unit.
2021-06-08 01:58:27 +09:00
Yu Watanabe
6260e85fc8
Merge pull request #19835 from keszybz/user-manager-bpf-errors
Silence errors about BPF object permissions in user manager
2021-06-08 01:50:57 +09:00
Lennart Poettering
d27e6aee50 udevadm: fix --tag-match help + description 2021-06-08 01:47:01 +09:00
Yu Watanabe
0718266017
Merge pull request #19837 from keszybz/disable-more-units
Disable more units
2021-06-08 01:46:15 +09:00
Yu Watanabe
a066dc9c18
Merge pull request #19815 from yuwata/sd-device-clone
sd-device: make cloned sd_device object can read udev database without uevent file
2021-06-08 01:45:45 +09:00
Lennart Poettering
be45211388
Merge pull request #19820 from yuwata/udev-node-fix-hashed-path
udev: fix conflict of hashed string
2021-06-07 17:19:38 +02:00
Yu Watanabe
0828a38605 network: address: always read address flag from IFA_FLAGS attribute
Otherwise, update flag become incomplete and the IFA_F_MANAGETEMPADDR flag
will not be stored, thus no temporary addresses will be removed when
networkd requests to remove the main address.

Follow-up for a8481354f0cd2c0855472193d0f57c7a77674969.
Fixes #13218.
Fixes #19838.
2021-06-08 00:13:25 +09:00
Yu Watanabe
a23624846f network: show address flag in debugging logs 2021-06-07 23:02:56 +09:00
Franck Bui
b2c7d1bbc2 pid1: only add a Wants= type dependency on /tmp when PrivateTmp=yes
We support that tmp.mount being masked, and this should not be considered an
error.
2021-06-07 14:10:56 +02:00
Zbigniew Jędrzejewski-Szmek
294eace024 core: disable "update" units in the initramfs
Initially I wanted to add ConditionPathExists=!/etc/initrd-release in various
units (ldconfig.service, systemd-sysusers.service, systemd-hwdb-update.service,
systemd-journal-catalog-update, systemd-update-done.service), but I think it's
better to just disable the mechanism in the initrd altogether. Initrd images
are put together in a very particular way, and there is not need to do
post-update steps on them. If a unit from some other package winds up in the
initrd, we wouldn't want to invoke it either.

Also, any modifications are ephemeral, so any update would happen on every
use. And finally, initrd images are all about speed, and we shouldn't invoke
any unneeded services.
2021-06-07 13:40:08 +02:00
Zbigniew Jędrzejewski-Szmek
dc16846c26 units: stop automount unit when shutting down
This is currently our only .automount unit. We wouldn't want to trigger it
accidentally during shutdown, so let's stop it too.
2021-06-07 13:38:28 +02:00
Sebastian Blunt
2cbca51a71 Rename crypttab opt silent to password-echo
Use the option name 'password-echo' instead of the generic term
'silent'.

Make the option take an argument for better control over echoing
behavior.

Related discussion in https://github.com/systemd/systemd/pull/19619
2021-06-07 10:35:28 +02:00
Zbigniew Jędrzejewski-Szmek
1a9e33aee3 core: downgrade errors about BPF loading when called from socket_bind_supported()
prepare_socket_bind_bpf() is called from two sites: socket_bind_supported() and
socket_bind_install_impl(). For the latter, when errors occur we certainly want
to log, since they'll be fatal for the unit.  But for the former, we should be
quiet, at least on the "expected" errors like lack of permissions. I kept error
on map resizing and such, which should not fail, at log_warning(). They are not
fatal when called from socket_bind_suppported(), but still a sign that
something is off.

Currently BPF filters can only be used by privileged users. Thus each systemd
--user will fail in socket_bind_supported(). With the patch, we only log this
at debug level.

https://lwn.net/ml/bpf/cover.1620499942.git.yifeifz2@illinois.edu/ gives some
hope that unprivileged access will be possible, so let's keep the code trying.
We might get lucky and get support for filters in user mode without any changes
on our side.
2021-06-07 10:28:46 +02:00
Zbigniew Jędrzejewski-Szmek
5b35b56eae core/bpf: add forgotten %m 2021-06-07 10:28:46 +02:00
Luca Boccassi
3745355764
Merge pull request #19793 from keszybz/tmpfiles-autofs-and-globs
tmpfiles: better handling of autofs and globs
2021-06-07 09:14:27 +01:00
Yu Watanabe
381f6d4ba5 sd-device: make cloned sd_device object can read udev database without uevent file
Some devices sent CHANGE and REMOVE uevent simultaneously.
To support that such device read udev database, let's copy minimal set of
properties which requires to read the database.

Fixes #19788.
2021-06-05 18:05:26 +09:00
Yu Watanabe
c7d6ebb13e sd-device: do not try to read uevent file multiple times 2021-06-05 17:58:53 +09:00
Yu Watanabe
e5ca293fcd sd-device: set driver subsystem if the sd_device object is generated from nulstr
Otherwise, the sd_device object cannot read correct udev database file.
2021-06-05 17:58:53 +09:00
Yu Watanabe
33f2de7b64 conf-parser: make config_parse_tristate() accept an empty string
Fixes #19822.
2021-06-04 22:51:26 +02:00
Yu Watanabe
2bb0227165 udev: always use last 11 chars for hash string
This makes the last 11 chars are always preserved for hashed string.
So, it is hard to generate a path which conflicts to another path.

Fixes an issue demonstrated in the previous commit.
2021-06-04 22:31:24 +09:00
Yu Watanabe
0192864da7 test: add a testcase that demonstrates a conflict of hashed filename
The commit e64943363a8dd8bd320c2b633478be8befd1af5c introduces hashed
path at the end of the filename. But we can easily generate the path
which conflicts another path. The issue will be fixed in later commit.
2021-06-04 22:28:52 +09:00
Yu Watanabe
efe76b273a shell-completion: udevadm: support --uuid option
Follow-up for 730b9c1e1469dfd6d6850e9ea06da3cac469eba0.
2021-06-04 15:00:11 +02:00
Zbigniew Jędrzejewski-Szmek
cbd4a8df5f core: drop bitfields in VTable object
The usual: bitfields make sense as a memory-saving measure when we have many
objects of a given type. When the object appears at most in a few copies, the
overhead of additional code to access bitfields is more than the savings.
2021-06-04 14:54:19 +02:00
Yu Watanabe
16f9036471
Merge pull request #19796 from yuwata/udev-node-cleanups
udev: several cleanups about creating device symlink
2021-06-04 21:46:43 +09:00
Kai-Heng Feng
a7161e0288 hwdb: Add ProBook to use micmute hotkey
Like HP EliteBooks and ZBooks, all ProBooks use the same micmute
scancode.
2021-06-04 14:00:25 +02:00
Lennart Poettering
d414f41535 test: don't expect that clone() always makes it to the kernel
We might get EPERM on certain clone() flag combinations. Apparently in
Docker for example.

Prompted by: https://github.com/systemd/systemd/pull/19800#issuecomment-854196491
2021-06-04 13:38:00 +02:00
Zbigniew Jędrzejewski-Szmek
ba405b2200 TODO: coalesce entries for tmpfiles 2021-06-04 12:21:19 +02:00
Zbigniew Jędrzejewski-Szmek
bd6d28f21a tmpfiles: do not check if unresolved globs are autofs paths
With the previous commit, we would not complain about the not-found path, but
the check is still not useful. We use a libc function to resolve the glob, and
it has no notion of treating autofs specially. So we can't avoid touching
autofs when resolving globs. But usually the glob is found in the last
component of the path, so if we strip the glob part, we can still do a useful
check in many cases. (E.g. if /var/tmp is on autofs, something like
"/var/tmp/<glob>" is much more likely than "/var/<glob-that-matches-tmp>/<something>".)

With the system config in F34, we check the following prefixes:

/var/tmp/abrt/* → /var/tmp/abrt/
/run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/*.journal* → /run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/
/var/lib/systemd/coredump/.#core*.21e5c6c28c5747e6a4c7c28af9560a3d* → /var/lib/systemd/coredump/
/tmp/podman-run-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /tmp/
/tmp/containers-user-* → /tmp/
/var/tmp/beakerlib-* → /var/tmp/
/var/tmp/dnf*/locks/* → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /var/tmp/
/var/tmp/abrt/* → /var/tmp/abrt/
/var/tmp/beakerlib-* → /var/tmp/
/var/tmp/dnf*/locks/* → /var/tmp/
/tmp/podman-run-* → /tmp/
/tmp/containers-user-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /tmp/
/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-* → /var/tmp/
/var/tmp/systemd-private-21e5c6c28c5747e6a4c7c28af9560a3d-*/tmp → /var/tmp/
/var/lib/systemd/coredump/.#core*.21e5c6c28c5747e6a4c7c28af9560a3d* → /var/lib/systemd/coredump/
/run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/*.journal* → /run/log/journal/08a5690a2eed47cf92ac0a5d2e3cf6b0/
2021-06-04 12:21:19 +02:00
Zbigniew Jędrzejewski-Szmek
1e472a6ce4 basic/glob-util: add helper to strip the glob part from a glob 2021-06-04 12:21:19 +02:00
Zbigniew Jędrzejewski-Szmek
19c79550b4 tools/analyze-dump-sort: a helper to compare two 'systemd-analyze dump' outputs
Lines in the dumps are ordered by some pseudo-random hashmap entry order, which
makes it hard to diff two outputs. This sort the entries alphabetically, and
also sorts items within the entries, and supresses timestamps and other fields
which always vary.

We could sort the output inside of systemd itself, but it'd make things more
complex, and we probably don't need output to be sorted in most cases. It also
wouldn't be enough, because timestamps and such would still need to be ignored
to do a nice diff. So I think doing the sorting and suppression in a python
helper is a better approach.
2021-06-04 12:09:58 +02:00
Zbigniew Jędrzejewski-Szmek
1ece068e83 core: update comment
unit_serialize_item() was dropped in d68c645bd3323ae1f0dfcb8fd74ea6b19681db8a.
But "cannot be restored from other sources" is also not entirely true: for
example for mounts we may be able to figure out most state from /p/s/mountinfo.
So let's make the comment more oblique.
2021-06-04 10:51:19 +02:00
Zbigniew Jędrzejewski-Szmek
771bdb6aae docs/ARCHITECTURE: more markup and unicode 2021-06-04 10:51:19 +02:00
Zbigniew Jędrzejewski-Szmek
287079696c NEWS: adjust grammar and other small changes 2021-06-04 10:51:19 +02:00
Yu Watanabe
4076ad9daf fix typo 2021-06-04 10:37:40 +02:00
Lennart Poettering
00d06c996d docs: use uppercase letters in title
We usually do it that way, do so here, too.
2021-06-04 10:34:56 +02:00
Lennart Poettering
99c2a9552b more 249 NEWS work 2021-06-04 10:34:02 +02:00
Yu Watanabe
78d8eae9a5 util: drop DEV_NUM_PATH_MAX and xsprintf_dev_num_path() 2021-06-04 15:51:39 +09:00
Yu Watanabe
902b4c677e util: move device-node.[ch] to shared 2021-06-04 15:51:39 +09:00
Yu Watanabe
ebb0a0155d udev: warn and propagate error in creating device symlink
Also, this makes the file in /run/udev/links/ is kept on failure, as the
target of the symbolic link may be belonging to another device.
2021-06-04 15:51:39 +09:00
Yu Watanabe
c891389a16 udev: try to create device symlink directly only when the link does not exist yet 2021-06-04 15:51:39 +09:00
Yu Watanabe
5802d4ea03 udev: extract same logic of creating device symlink
This also limits the number of trial.
2021-06-04 15:51:39 +09:00
Yu Watanabe
1ddfb6cf29 udev: use path_extract_directory() and path_equal() 2021-06-04 15:51:39 +09:00
Yu Watanabe
f3b393e951 udev: refuse to create device symlink when a non-symlink file already exists 2021-06-04 15:51:39 +09:00
Yu Watanabe
d2b50631fb udev: make link_find_prioritized() return 0, 1, or negative errno 2021-06-04 15:51:39 +09:00
Yu Watanabe
e7f3b33e70 udev: slightly update log message and adjust log level 2021-06-04 15:51:39 +09:00
Yu Watanabe
a33dc87e42 udev: logs if failed to remove devlink 2021-06-04 15:51:39 +09:00
Yu Watanabe
e91454231b udev: do not try to remove /dev 2021-06-04 15:51:39 +09:00
Yu Watanabe
5733bd4862 udev: use touch_file() and limit the number of trial 2021-06-04 15:51:39 +09:00
Yu Watanabe
286bedd7a4 udev: logs when failed to remove saved info about devlink 2021-06-04 15:51:39 +09:00
Yu Watanabe
be322ecafb udev: refuse unsafe device symbolic link 2021-06-04 15:51:39 +09:00
Yu Watanabe
52fde28014 test: add tests for udev_node_escape_path() 2021-06-04 15:51:39 +09:00
Yu Watanabe
e64943363a udev: use hashed path as a filename to save devlink 2021-06-04 15:51:31 +09:00
Lennart Poettering
5f94ac5435 NEWS: more preparation for v249 2021-06-03 23:36:28 +02:00
Luca Boccassi
2ecce1f1a8 docs: add ARCHITECTURE.md with code map
Initial and coarse version of a code map, useful for people getting
started and looking at the repository for the first time.
2021-06-03 22:14:19 +02:00
adrian5
d0fd114929 man: fix typo 2021-06-03 22:10:36 +02:00
Yu Watanabe
130298ba10 util: expose urlsafe_base64char() 2021-06-04 01:48:50 +09:00
Lennart Poettering
92ca7e052d
Merge pull request #19801 from poettering/device-unit-name-length
pid1: reduce amount of warnings about sysfs device paths we cannot convert into device unit names
2021-06-03 18:08:07 +02:00
Lennart Poettering
f973aea740 NEWS: start putting together NEWS for v249 2021-06-03 17:57:27 +02:00
Lennart Poettering
51df483846
Merge pull request #19806 from poettering/ask-pw-asterisk
systemd-ask-password: make pw echo fully configurable
2021-06-03 16:09:43 +02:00
Lennart Poettering
e82c6e8b62 pid1: don't choke on overly long device paths
This mimics what we do for device units: if there's a device we cannot
synthesize a good swap unit name for, then proceed without failure.
2021-06-03 15:01:05 +02:00
Lennart Poettering
6aeb8c89ba pid1: make swap_process_new() void
This matches device_process_new(): this function should not fail, since
it just reacts to external events.
2021-06-03 15:01:05 +02:00
Lennart Poettering
4d94c74fae pid1: downgrade if we can't make sense of the old device on MOVE uevent
If the name of the old device didn#t work for us, we don't have to clean
anything up, since we know for sure that there won't be a device unit
for it. hence downgrade log message about it.
2021-06-03 15:01:05 +02:00
Lennart Poettering
68695ce4d6 pid1: eat up errors in device_update_found_by_name()
We eat up all errors in the caller already, and rightly so.
2021-06-03 15:01:05 +02:00
Lennart Poettering
9951c8df1e pid1: properly propagate errors from device_setup_unit()
We want to propagate errors here, since we want to make dependent on the
success of creating the main device unit the creation of the auxiliary
device units. Thus if we suppress errors here we might end up in exotic
corner cases in a situation were we create the auxiliary ("following")
device units without the primary one.
2021-06-03 15:01:05 +02:00
Lennart Poettering
ad172d19d5 pid1: reduce log noise generated by devices with overly long sysfs paths
This basically does what 2c905207db37c691d4abef868165ad5ea2dd0f4f did
for mount units

Fixes: #16161
2021-06-03 15:01:05 +02:00
Lennart Poettering
c8ad151a58 pid1: make return value of device_remove_old() void too 2021-06-03 15:01:05 +02:00
Lennart Poettering
e41db484c3 pid1: shorten code a bit 2021-06-03 15:01:05 +02:00
Lennart Poettering
75a50eb0dd pid1: make device_process_new() return void
We never use the return value, and we really shouldn't, hence let's drop
it.
2021-06-03 15:01:05 +02:00
Lennart Poettering
8d8053c2fe
Merge pull request #19800 from poettering/podman-test
make our testsuite pass in a podman container with default privs
2021-06-03 14:11:59 +02:00
Lennart Poettering
9b1c5610e0 test: add a 'static' on a global variable we don't actually export
All global but not exported variables should be "static" in our
codebase, add "static" to one more such variable hence.
2021-06-03 11:30:56 +02:00
Lennart Poettering
c75370cc18 test: tweak privilege tests for two more tests
These tests require properly privileged root users, hence skip things
when we don't have CAP_SYS_ADMIN.

Fixes: #19746
2021-06-03 11:30:56 +02:00
Lennart Poettering
6da5d7de78 test-seccomp: tighten privilege check before seccomp()
geteuid() without CAP_SYS_ADMIN is not enough to do unrestricted
seccomp(). Hence tighten the check.

See: #19746
2021-06-03 11:27:36 +02:00
Lennart Poettering
e80cb4cba4 test-capability: skip tests that need CAP_NET_RAW if cap is not passed
See: #19746
2021-06-03 11:27:36 +02:00
Lennart Poettering
4b1c842d95 ask-password: once we hit the message argument, don't process switches anymore
Let's not mangle the message part unnecessarily, that'd be confusing and
unexpected.
2021-06-03 11:16:48 +02:00
Lennart Poettering
a51168481f ask-password: default to a different prompt than "Password:" if the echo is on 2021-06-03 11:16:48 +02:00
Lennart Poettering
49365d1c6d ask-password: make password echo fully configurable
This adds --visible=yes|no|asterisk which allow controlling the echo of
the password prompt in detail. The existing --echo switch is then made
an alias for --visible=yes (and a shortcut -e added for it too).
2021-06-03 11:16:48 +02:00
Yu Watanabe
ffc36c276c efi: drop glibc header and use pre-defined macros
This reverts 72dc626b3d6905b105ae61ca2c60f51a6f74070e and replace glibc
specific macros with compiler's pre-defined macros.
2021-06-03 13:49:33 +09:00
Yu Watanabe
2255e8adee sd-device: do not use ::subsystem member directly
The value is set dynamically when sd_device_get_subsystem() is called
first time.

Fixes the following issue:
```
$ build/udevadm test /sys/class/block/dm-1
...
Assertion '_subsystem' failed at src/libsystemd/sd-device/sd-device.c:767, function device_set_subsystem(). Aborting.
Program received signal SIGABRT, Aborted.
```
2021-06-03 05:59:03 +09:00
Yu Watanabe
f0273cba25
Merge pull request #19798 from bluca/todo_landlock
Add new item to TODO list
2021-06-03 03:37:33 +09:00
Yu Watanabe
a884774635
Merge pull request #19792 from keszybz/more-logging-stuff
More logging tweaks
2021-06-03 03:36:28 +09:00
Luca Boccassi
88511a3712 TODO: mention the new Landlock LSM as a way to implement sandboxing for systemd --user 2021-06-02 19:13:28 +01:00
Luca Boccassi
e91035abf0 TODO: remove some features that have been implemented 2021-06-02 18:57:31 +01:00
Yu Watanabe
63b8a781b6
Merge pull request #19791 from yuwata/udev-node-logs
udev: update several log messages
2021-06-03 01:32:29 +09:00
scootergrisen
a22bcf503b po: Translated using Weblate (Danish)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: scootergrisen <scootergrisen@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/da/
Translation: systemd/main
2021-06-03 01:31:51 +09:00
Luca Boccassi
c17b4f4b0e
Merge pull request #19783 from yuwata/efi-build-options
efi: constify several functions and enable more warnings
2021-06-02 17:02:57 +01:00
Zbigniew Jędrzejewski-Szmek
16eff8271b tmpfiles: stop complaining about autofs on not-found paths
systemd-tmpfiles[328]: Failed to determine whether '/run/cryptsetup' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/etc/resolv.conf' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/lock/subsys' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/setrans' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/console' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/faillock' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/sepermit' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd.d' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd.d' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/motd' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/run/nologin' is below autofs, ignoring: No such file or directory
systemd-tmpfiles[328]: Failed to determine whether '/var/lib/systemd/pstore' is below autofs, ignoring: No such file or directory
... and so on and so on.
2021-06-02 16:26:52 +02:00
Zbigniew Jędrzejewski-Szmek
0d5a24beae various: don't say that the timestamp 'changed' on initial load
I always found this a bit annoying.
With the patch:

$ SYSTEMD_LOG_LEVEL=debug build/udevadm test /sys/class/block/dm-1
...
Loaded timestamp for '/etc/systemd/network'.
Loaded timestamp for '/usr/lib/systemd/network'.
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /etc/systemd/network/10-eth0.link
Created link configuration context.
Loaded timestamp for '/etc/udev/rules.d'.
Loaded timestamp for '/usr/lib/udev/rules.d'.
...
2021-06-02 16:23:54 +02:00
Yu Watanabe
7b80829575 udev: upgrade log level about failure in updating devlinks 2021-06-02 21:00:45 +09:00
Yu Watanabe
cd8bcff507 udev: check that passed symbolic link path starts with /dev 2021-06-02 21:00:22 +09:00
Luca Boccassi
357f5b07ae
Merge pull request #19779 from poettering/unit-name-length-tweak
improve logging when encountering mount points we cannot convert to unit names due to length
2021-06-02 11:32:52 +01:00
Yu Watanabe
d46969072a udev: explicitly mention that the error will be ignored
See #19788.
2021-06-02 19:15:02 +09:00
Yu Watanabe
6be1feb1d7 udev: ignore the case that the device is already removed
See #19788.
2021-06-02 19:10:52 +09:00
Yu Watanabe
7bbcaee307 cryptsetup: fix typo 2021-06-02 11:35:14 +02:00
Zbigniew Jędrzejewski-Szmek
0517ececff core: show manager version in dump
This makes it easier to not get lost which one is which when
comparing two dumps.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek
2a341bb9d2 core: split out core/manager-dump.[ch]
This is a fairly specialized topic, let's create a separate file for it.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek
5b326dee29 TODO: add entry about alias logging 2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek
953394e3bb varlink: remove duplicated "varlink:" prefix
We had:

systemd[1]: varlink-36: New incoming message: {"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"userName":"gdm","service":"io.systemd.DynamicUser"},"more":true}
systemd[1]: varlink-36: varlink: changing state idle-server → processing-method-more
systemd[1]: varlink-36: Sending message: {"error":"io.systemd.UserDatabase.NoRecordFound","parameters":{}}
systemd[1]: varlink-36: varlink: changing state processing-method-more → processed-method
systemd[1]: varlink-36: varlink: changing state processed-method → idle-server
systemd[1]: varlink-36: Got POLLHUP from socket.
systemd[1]: varlink-36: varlink: changing state idle-server → pending-disconnect
systemd[1]: varlink-36: varlink: changing state pending-disconnect → processing-disconnect
systemd[1]: varlink-36: varlink: changing state processing-disconnect → disconnected

So let's drop the "varlink:" prefix and use capitalized sentences like in other messages.
2021-06-02 09:22:08 +02:00
Zbigniew Jędrzejewski-Szmek
f35e9b101d varlink: say "varlink:" instead of "n/a:" when no description is available
For new connections, we log something like this:

systemd[1]: n/a: New incoming connection.
systemd[1]: n/a: Connections of user 997: 0 (of 1024 max)
systemd[1]: varlink-22: varlink: setting state idle-server
systemd[1]: varlink-22: New incoming message: ...

This "n/a" is not very pretty, and without context it would be hard to even
figure out this is a varlink connection.
2021-06-02 09:22:08 +02:00
Yu Watanabe
505ab9dda2 meson: sort compiler flags 2021-06-02 15:53:29 +09:00
Yu Watanabe
6526736397 meson: enable more warnings when building efi binary 2021-06-02 15:49:44 +09:00
Yu Watanabe
ca474d5114 efi: constify several arguments of functions which handle loader entries 2021-06-02 15:45:47 +09:00
Yu Watanabe
cfb7fa289d efi: drop const qualifiers from arguments in uefi_call_wrapper() 2021-06-02 15:43:21 +09:00
Yu Watanabe
edad24c61e efi: add const qualifier to EFI variable handling functions 2021-06-02 15:41:39 +09:00
Yu Watanabe
ef53d52b01 efi: add const qualifier to string utils 2021-06-02 15:40:56 +09:00
Yu Watanabe
72dc626b3d efi: include endian.h to handle endian correctly
The macro __BYTE_ORDER__ is defined in endian.h.
2021-06-02 15:38:32 +09:00
Yu Watanabe
959ab90bbc efi: do not use _STRING_ARCH_unaligned macro
It is already removed from glibc. See,
https://sourceware.org/git/?p=glibc.git;a=commit;h=16396c41deab45f715ffd813280d9d685b3b281e
https://sourceware.org/git/?p=glibc.git;a=commit;h=09a596cc2cf4e0f9f8e9f3bba4b1a97efcb13bcb
2021-06-02 15:36:29 +09:00
Yu Watanabe
122dbd92c9 string-util: trivial optimizations for strverscmp_improved() 2021-06-02 14:20:25 +09:00
Lennart Poettering
3ebc9b9b30 mount: be more descriptive when logging about overly long mount point paths
This is prompted by #17684: let's very explicitly say that the name is
too long for us, and that we'll ignore it.
2021-06-01 23:08:21 +02:00
Lennart Poettering
598a6a8491 core: when looping over mount/swap names, continue if we find one which doesn't translate to a valid unit name 2021-06-01 23:08:21 +02:00
Lennart Poettering
9d5acfab20 unit-name: generate a clear error code when converting an overly long fs path to a unit name 2021-06-01 23:08:13 +02:00
Lennart Poettering
3fe398cec0 dissect: if dissecting without udev, don't look for usec timestamp on db record
There will likely be none, hence don't bother.

This fixes an issue in systemd-gpt-auto-generator where we'll try to
wait for the udev db for the partitions even though though udev might
simplynot be around and via the DISSECT_IMAGE_NO_UDEV flag were
explicitly told not to bother.

Fixes: #19377
2021-06-01 22:52:16 +02:00
Zbigniew Jędrzejewski-Szmek
71889176e4 pam: do not require a non-expired password for user@.service
Without this parameter, we would allow user@ to start if the user
has no password (i.e. the password is "locked"). But when the user does have a password,
and it is marked as expired, we would refuse to start the service.
There are other authentication mechanisms and we should not tie this service to
the password state.

The documented way to disable an *account* is to call 'chage -E0'. With a disabled
account, user@.service will still refuse to start:

systemd[16598]: PAM failed: User account has expired
systemd[16598]: PAM failed: User account has expired
systemd[16598]: user@1005.service: Failed to set up PAM session: Operation not permitted
systemd[16598]: user@1005.service: Failed at step PAM spawning /usr/lib/systemd/systemd: Operation not permitted
systemd[1]: user@1005.service: Main process exited, code=exited, status=224/PAM
systemd[1]: user@1005.service: Failed with result 'exit-code'.
systemd[1]: Failed to start user@1005.service.
systemd[1]: Stopping user-runtime-dir@1005.service...

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1961746.
2021-06-01 19:27:25 +02:00
Lennart Poettering
fedfd21a1f
Merge pull request #19774 from poettering/tpm2-tweaks
cryptsetup: two minor tpm2 tweaks
2021-06-01 19:27:06 +02:00
Lennart Poettering
cbb6c000c7 logind-dbus: correctly calculate when to create /etc/nologin file in all cases
Fixes: #19258
2021-06-01 19:26:47 +02:00
Lennart Poettering
abc50cf6c8 cryptsetup: add missing error branch
Found in the process of trying to figure out #19193, but I doubt it's
going to fix that.
2021-06-01 18:04:06 +02:00
Lennart Poettering
71b25deae3 cryptsetup: don't bother waiting for TPM2 devices if we are on EFI and EFI says there is no TPM2 device
Note that this means EFI-systems with a manually added TPM device won't
be supported automatically, but given that the TPM2 trust model kinda
requires firmware support I doubt it matters supporting this. And in all
other cases it speeds things up a bit.
2021-06-01 16:36:18 +02:00
Lennart Poettering
cad105442d cryptsetup: if TPM2 support is not compiled in, fallback to non-TPM2 mode gracefully
Fixes: #19177
2021-06-01 16:34:34 +02:00
Lennart Poettering
8e1422036a
Merge pull request #19768 from poettering/homectl-fido2-lock-with
homed: catch up with FIDO2 features in cryptsetup + other fixes
2021-06-01 15:53:36 +02:00
Ondrej Kozina
358b1f68b0 cryptsetup-util: disable pbkdf benchmark in cryptsetup_set_minimal_pbkdf.
No need to benchmark pbkdf when asking for minimal values
anyway.

1000 iterations count is minimum for both LUKS1 and LUKS2
pbkdf2 keyslot parameters according to NIST SP 800-132, ch. 5.2.

Iterations count can not be lower than recommended minimum
when benchmark is disabled. The time_ms member is ignored with
benchmark disabled.
2021-06-01 15:53:14 +02:00
Lennart Poettering
c719805ecb dissect: the libcryptsetup code for Verity crypt_device objects too
Across the codebase we are pretty good at setting the per-crypt_device
log functions once we allocated the object. But we forgot one case. Fix
that.
2021-06-01 13:33:13 +02:00
Lennart Poettering
2f67864064 cryptsetup: explicitl set default log functions wherever needed
Code using libcryptsetup already sets the global log function if it uses
dlopen_cryptsetup(). Make sure we do the same for the three programs
that explicitly link against libcryptsetup and hence to not use
dlopen_cryptsetup().
2021-06-01 13:33:09 +02:00
Lennart Poettering
e9252faee9 cryptsetup: implicitly set global log functions when loading libcryptsetup dynamically
So far we only set the per-crypt_device log functions, but some
libcryptsetup calls we invoke without a crypt_device objects, and we
want those to redirect to our infra too.
2021-06-01 13:33:05 +02:00
Lennart Poettering
0608e2d3a5 homework: only default to LUKS storage if libcryptsetup is installed 2021-06-01 13:33:01 +02:00
Lennart Poettering
71eceff645 homework: make libcryptsetup dep runtime optional 2021-06-01 13:32:40 +02:00
Lennart Poettering
e49614278d homework: fix return codes when using fido2/pkcs11 cached passwords
Otherwise we'll accidently report a record we can safely decrypt as not
decrypted.
2021-06-01 13:32:36 +02:00
Lennart Poettering
bfc0cc1a25 userdb: make most loading of JSON user record data "permissive"
We want user records to be extensible, hence we shouldn't complain about
fields we can't parse. In particular we want them to be extensible for
our own future extensions.

Some code already turned the permissive flag when parsing the JSON data,
but most did not. Fix that. A few select cases remain where the bit is
not set: where we just gnerated the JSON data ourselves, and thus can be
reasonably sure that if we can't parse it it's our immediate programming
error and not just us processing a user record from some other tool or a
newer version of ourselves.
2021-06-01 13:32:31 +02:00
Lennart Poettering
17e7561a97 homectl: store FIDO2 up/uv/clientPin fields in user records too
This catches up homed's FIDO2 support with cryptsetup's: we'll now store
the uv/up/clientPin configuration at enrollment in the user record JSON
data, and use it when authenticating with it.

This also adds explicit "uv" support: we'll only allow it to happen when
the client explicity said it's OK. This is then used by clients to print
a nice message suggesting "uv" has to take place before retrying
allowing it this time. This is modelled after the existing handling for
"up".
2021-06-01 13:31:53 +02:00
Lennart Poettering
7dba77a67e
Merge pull request #17096 from eworm-de/ask-password
ask-password: allow to control emoji
2021-06-01 11:44:00 +02:00
Yu Watanabe
a8f76a8db7
Merge pull request #19766 from keszybz/fuzz-fixes
Fuzz fixes
2021-06-01 11:14:45 +09:00
Lennart Poettering
6f2ef23a4e udevadm: output trigger UUID in UUID format, instead of ID128
The SYNTH_UUID property also shows it in UUID format, and so does the
kernel and its docs otherwise, hence accept our fate and also output it
in UUID.
2021-06-01 11:14:03 +09:00
Luca Boccassi
6c498f6d89
Merge pull request #19765 from keszybz/early-boot-logging-improvements
Early boot logging improvements
2021-05-31 22:59:51 +01:00
Christian Hesse
9cb5bf913d ask-password: use FLAGS_SET()
Check for flags with FLAGS_SET() where possible.
2021-05-31 21:13:31 +02:00
Christian Hesse
e390c34d00 ask-password: allow to control lock and key emoji
Giving --echo to systemd-ask-password allows to echo the user input.
There's nothing secret, so do not show a lock and key emoji by default.

The behavior can be controlled with --emoji=yes|no|auto. The default is
auto, which defaults to yes, unless --echo is given.
2021-05-31 21:13:31 +02:00
Zbigniew Jędrzejewski-Szmek
2dd7a72d5a fuzz-journal-remote: print some kinds of errors
In https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34803, we fail with:

  Assertion 'IN_SET(r, -ENOMEM, -EMFILE, -ENFILE)' failed at src/journal-remote/fuzz-journal-remote.c:69,
    function int LLVMFuzzerTestOneInput(const uint8_t *, size_t)(). Aborting.
  AddressSanitizer:DEADLYSIGNAL

Let's try to print the error, so maybe we can see what is going on.
With the previous commit we shouldn't print out anything.
2021-05-31 19:29:07 +02:00
Zbigniew Jędrzejewski-Szmek
23b8aa648d journal-remote: downgrade messages about input data to warnings
Those are unexpected, so a user-visible message seems appropriate.
But they are not our errors, and to some extent we can recover from
them, so "warning" seems more appropriate than "error".
2021-05-31 19:29:07 +02:00
Zbigniew Jędrzejewski-Szmek
a88f9dbae2 systemctl: unset const char* arguments in static destructors
When fuzzing, the following happens:
- we parse 'data' and produce an argv array,
- one of the items in argv is assigned to arg_host,
- the argv array is subsequently freed by strv_freep(), and arg_host has a dangling symlink.

In normal use, argv is static, so arg_host can never become a dangling pointer.
In fuzz-systemctl-parse-argv, if we repeatedly parse the same array, we
have some dangling pointers while we're in the middle of parsing. If we parse
the same array a second time, at the end all the dangling pointers will have been
replaced again. But for a short time, if parsing one of the arguments uses another
argument, we would use a dangling pointer.

Such a case occurs when we have --host=… --boot-loader-entry=help. The latter calls
acquire_bus() which uses arg_host.

I'm not particularly happy with making the code more complicated just for
fuzzing, but I think it's better to resolve this, even if the issue cannot
occur in normal invocations, than to deal with fuzzer reports.

Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31714.
2021-05-31 19:29:07 +02:00
Zbigniew Jędrzejewski-Szmek
e7b18106f8 pid1: remove dot from initial announcement
This line is so long, that the end is usually not visible on
the terminal. The dot looks out of place, and dropping it saves one
column for more interesting content.
2021-05-31 19:22:51 +02:00
Zbigniew Jędrzejewski-Szmek
44a989e039 tty-ask-password-agent: log when starting a query on the console
When looking at logs from a boot with an encrypted device, I see
(with unrelevant messages snipped):
[    2.751692] systemd[1]: Started Dispatch Password Requests to Console.
[    7.929199] systemd-cryptsetup[258]: Set cipher aes, mode xts-plain64, key size 512 bits for device /dev/disk/by-uuid/2d9b648a-15b1-4204-988b-ec085089f8ce.
[    9.499483] systemd[1]: Finished Cryptography Setup for luks-2d9b648a-15b1-4204-988b-ec085089f8ce.

There is a hug gap in timing without any explanatory message. If I didn't type
in the password, there would be no way to figure out why things blocked from
this log, so let's log something to the log too.
2021-05-31 19:22:51 +02:00
Zbigniew Jędrzejewski-Szmek
0727077b53 tty-ask-password-agent: highlight summary in help 2021-05-31 19:22:51 +02:00
Zbigniew Jędrzejewski-Szmek
af88c399c0 tty-ask-password-agent: mention optional argument in help
0cf84693877f060254f04cf38120f52c2aa3059c added --console.
6af621248f2255f9ce50b0bafdde475305dc4e57 added an optional argument, but didn't
update the help texts.

Note that there is no ambiguity with the optional argument because no positional
arguments are allowed.
2021-05-31 19:22:51 +02:00
Sebastian Blunt
4858bc0d84 Respect option 'silent' on cryptsetup FIDO2 pin entry
Makes the silent flags behavior consistent between regular password
entry and FIDO2 pin entry.
2021-05-31 17:57:44 +02:00
Zbigniew Jędrzejewski-Szmek
6b42227edb systemctl: put static destructor in the order of variables 2021-05-31 12:17:19 +02:00
Yu Watanabe
d65c5d04f9
Merge pull request #19759 from poettering/emoji-token-text
fido2: add emoji to log message whenever "up" or "uv" is requested
2021-05-29 13:42:48 +09:00
Lennart Poettering
d2b278811f cryptenroll: remove a tiny bit of whitespace 2021-05-28 22:47:50 +02:00
Lennart Poettering
87b31c37ec fido2: add emoji to log message whenever "up" or "uv" is requested
Let's show the touch emoji whenever the user is likely going to have to
interact with the security token. We had this at many but not all such
messages. Let's add it everywhere.

Also, upgrade all messages where the user is supposed to do something to
LOG_NOTICE. Previously some where at LOG_NOTICE and others at LOG_INFO.
These messages are more than informational after all, they require user
action, hence deserve the higher prio, in particular as that formats
them bold with our usual log coloring.

Always use the word "test" in log messages, instead of "check".

Finally, always use the same wording: "confirm presence on security
token" for "up" and "verify user on security token" for "uv"
2021-05-28 22:47:44 +02:00
Lennart Poettering
f7e31e9dfd
Merge pull request #19756 from poettering/fido2-enroll-tweaks
further tweaks to fido2 code
2021-05-28 18:20:15 +02:00
Lennart Poettering
72c1542267 man: document that FIDO2 uv/up/clientPin feature support is now handled gracefully 2021-05-28 16:45:12 +02:00
Lennart Poettering
3cc00ba605 cryptsetup: revert to systemd 248 up/pin/uv FIDO2 settings when we don't have LUKS2 JSON data telling us the precise configuration
Let's improve compatibility with systemd 248 enrollments of FIDO2 keys:
if we have no information about the up/uv/pin settings, let's try to
determine them automatically, i.e. use up and pin if needed.

This only has an effect on LUKS2 volumes where a FIDO2 key was enrolled
with systemd 248 and thus the JSON data lacks the up/uv/pin fields. It
also matters if the user configured FIDO2 parameters explicitly via
crypttab options, so that the JSON data is not used.

For newer enrollments we'll stick to the explicit settings, as that's
generally much safer and robust.
2021-05-28 16:36:52 +02:00
Lennart Poettering
1ce8f69dbd fido2: properly handle case when no PINs are specified during auth
Also, drop redundant check for has_client_pin, which can never happen,
since we already filtered this case a bit further up.
2021-05-28 16:36:52 +02:00
Lennart Poettering
ec543d18d4 fido2: make misadvertised clientPin feature fatal
We need really need to trust the feature set, since we are about to set
it in stone storing the result in JSON, hence react a bit more allergic
about token that misadvertise the feature.

Note that I added this to be defensive, I am not aware any token that
actually misadvertises this. hence it should be safe to make this fatal,
and should this not work we can always revisit things.
2021-05-28 16:36:51 +02:00
Lennart Poettering
0735ed950a cryptenroll: handle FIDO2 tokens gracefully that lack requested features
Let's try to handle keys gracefully that do not implement all features
we ask for: simply turn the feature off, and continue.

This is in particular relevant since we enroll with PIN and UP by
default, and on devices that don't support that we should just work.

Replaces: #18509
2021-05-28 16:36:25 +02:00
Yu Watanabe
304e637c88
Merge pull request #19754 from yuwata/fix-coverity-issues-and-typo
Fix coverity issues and typo
2021-05-28 23:03:01 +09:00
Yu Watanabe
48008c1cbf tree-wide: fix typo 2021-05-28 19:52:12 +09:00
Yu Watanabe
7f1238bd04 basic/unit-file: fix use-after-free
This fixes a bug introduced by e8630e695232bdfcd16b55f3faafb4329c961104.

Fixes CID#1453292.
2021-05-28 19:48:38 +09:00
Yu Watanabe
a04842dfb2 network,sd-hwdb: voidify fchmod()
Fixes CID#1453294.
2021-05-28 19:41:07 +09:00
Yu Watanabe
50fd596efc path-util: add missing varargs cleanup
Fixes CID#1453293.
2021-05-28 19:38:37 +09:00
Lennart Poettering
18503cac41
Merge pull request #19485 from yuwata/path-util
path-util: introduce several path utilities and handle "." more gracefully
2021-05-28 09:31:06 +02:00
Yu Watanabe
cb71ed91f7 path-util: make path_simplify() use path_find_first_component() 2021-05-28 13:44:38 +09:00
Yu Watanabe
4ff361cc86 tree-wide: always drop unnecessary dot in path 2021-05-28 13:44:38 +09:00
Yu Watanabe
0195046449 path-util: make path_extract_filename/directory() handle "." gracefully
This makes the functions handle "xx/" and "xx/." as equivalent.
Moreover, now path_extract_directory() returns normalized path, that is
no redundant "/" or "/./" are contained.
2021-05-28 13:44:38 +09:00
Yu Watanabe
484cd43cae path-util: introduce path_find_last_component() 2021-05-28 13:44:38 +09:00
Yu Watanabe
15bac3e8fd path-util: use path_equal() in empty_or_root() 2021-05-28 13:44:38 +09:00
Yu Watanabe
39d7af99c2 fs-util: make chase_symlinks() use path_find_first_component()
The previous commit about path_compare() breaks chase_symlinks().
This commit fixes it.
2021-05-28 13:44:19 +09:00
Yu Watanabe
353df4438e path-util: make path_compare() and path_hash_func() ignore "."
This also makes path_compare() may return arbitrary integer as it now
simply pass the result of strcmp() or memcmp().

This changes the behavior of path_extract_filename/directory() when
e.g. "/." or "/./" are input. But the change should be desired.
2021-05-28 13:41:23 +09:00
Yu Watanabe
fe69c41ee8 path-util: use path_find_first_component() in path_make_relative()
This also makes the function checks the result is a valid path or not.
2021-05-28 13:41:23 +09:00
Yu Watanabe
63f11e354a path-util: use path_find_first_component() in path_startswith()
This makes path_startswith() stricter. If one of the path component in
arguments is longer than NAME_MAX, it returns NULL.
2021-05-28 13:41:23 +09:00
Yu Watanabe
0b8696256b path-util: use path_is_safe() in path_is_normalized() 2021-05-28 13:41:23 +09:00
Yu Watanabe
32df2e1447 path-util: introduce path_is_safe()
The function is similar to path_is_valid(), but it refuses paths which
contain ".." component.
2021-05-28 13:41:23 +09:00
Yu Watanabe
6636883564 path-util: use path_find_first_component() in path_is_valid() 2021-05-28 13:41:23 +09:00
Yu Watanabe
0ee54dd4e2 path-util: introduce path_find_first_component()
The function may be useful to iterate on each path component.
2021-05-28 13:41:23 +09:00
Yu Watanabe
340cd6b6f9 path-util: fix off by one issue to detect slash at the end in path_extend() 2021-05-28 13:41:23 +09:00
Dan Streetman
05575a104b test/networkd-test: in bridge test, wait for online after restart systemd-networkd
without waiting for online, there is a race condition between systemd-networkd
actually setting the new values and the test checking those values

This also sets the link down before restarting systemd-networkd, to avoid
the wait for online being a no-op
2021-05-28 12:26:33 +09:00
Peter Kjellerstedt
b2d7487071 meson: Correctly validate that prefix is a child of rootprefix
In commit d895e10a a test was introduced to validate that prefix is a
child of rootprefix. However, it only works when rootprefix is "/".
Since the test is ignored when rootprefix is equal to prefix, this is
only noticed if specifying both -Drootprefix= and -Dprefix=, e.g.:

  $ meson foo -Drootprefix=/foo -Dprefix=/foo/bar
  meson.build:111:8: ERROR: Problem encountered: Prefix is not below
  root prefix (now rootprefix=/foo prefix=/foo/bar)
2021-05-28 06:29:45 +09:00
Yu Watanabe
4e95bc56df
Merge pull request #19749 from poettering/path-extend
add path_extend() helper which is a like if path_join() and strextend() had a baby
2021-05-28 05:53:57 +09:00
Lennart Poettering
4ede980249 tree-wide: make use of path_extend() at many places
This is not a comprehensive port, but mostly some low-hanging fruit.
2021-05-27 17:05:38 +02:00
Lennart Poettering
7ae2768028 path-util: add path_extend(), inspired by strextend(), but using path_join() 2021-05-27 16:02:18 +02:00
Yu Watanabe
38dd7673b3
Merge pull request #19703 from yuwata/network-ndisc-valid-time
network: ndisc: always honor valid time
2021-05-27 18:42:31 +09:00
Yu Watanabe
facaf083f0
Merge pull request #19743 from yuwata/dhcpv4-static-leases
network: dhcp-server:  support static lease
2021-05-27 18:41:22 +09:00
Yu Watanabe
a19b1ac7c8 network: ndisc: update log message 2021-05-27 16:33:36 +09:00
Yu Watanabe
25db3aeaf3 network: ndisc: always honor valid time
See draft-ietf-6man-slaac-renum-02, section 4.2.
https://datatracker.ietf.org/doc/html/draft-ietf-6man-slaac-renum#section-4.2

Replaces #15260.
2021-05-27 16:33:33 +09:00
borna-blazevic
ffaece68bc test-network: add a testcase for DHCP static lease 2021-05-27 15:57:33 +09:00
borna-blazevic
c517a49bf7 network: dhcp-server: introduce [DHCPServerStaticLease] section 2021-05-27 15:51:26 +09:00
borna-blazevic
65a0ef2341 sd-dhcp-server: support static address to DHCPv4 offer 2021-05-27 15:15:27 +09:00
Yu Watanabe
e954939b9e
Merge pull request #19736 from poettering/udev-trigger-uuid
sd-device: add support for triggering devices with UUID support
2021-05-27 13:05:00 +09:00
Christian Hesse
9fff026d60 man: fix tag type
This is an option, not a command.
2021-05-27 12:50:57 +09:00
Lennart Poettering
74bbc85ca6 hash-func: change value type of string_hash_ops_free_free to void*
The generic string_hash_ops_free_free hash operations vtable currently
assumes the data pointer is of type char*. There's really no reason to
assume that though, we regularly store non-string data as value in a
hashmap. Hence, to accomodate for that, use void* as pointer for the
value (and keep char* for the key, as that's what
string_hash_ops_free_free is for, after all).
2021-05-26 21:44:36 +02:00
Lennart Poettering
730b9c1e14 udevadm: make use of the new uuid-enabled triggering for "udevadm trigger"
This adds two things:

- A new switch --uuid is added to "udevadm trigger". If specified a
  random UUID is associated with the synthettic uevent and it is printed
  to stdout. It may then be used manually to match up uevents as they
  propagate through the system.

- The UUID logic is now implicitly enabled if "udevadm trigger --settle"
  is used, in order to wait for precisely the uevents we actually
  trigger. Fallback support is kept for pre-4.13 kernels (where the
  requests for trigger uevents with uuids results in EINVAL).
2021-05-26 21:44:36 +02:00
Lennart Poettering
b485fd932a sd-device: add API for triggering synthetic uevents with UUID
Since kernel 4.13 the kerne allows passing a UUID to generated uevents.
Optionally do so via a new sd_device_trigger_with_uuid() call, and add
sd_device_get_trigger_uuid() as helper to retrieve the UUID from a
uevent we receive.

This is useful for tracking uevents through the udev system, and waiting
for specific triggers.

(Note that the 4.13 patch allows passing arbitrary meta-info into the
uevent as well. This does not add an API for that, because I am not
convinced it makes sense — as it conflicts with our general rule that
events are "stateless" if you so will — and it complicates the interface
quite a bit).

This replaces #13881 in a way, which added a similar infra, but which
stalled, and whose synchronous settling APIs are somewhat problematic
and probably not material to merge.
2021-05-26 21:44:36 +02:00
Lennart Poettering
6f75309295 man: document that it is guaranteed that generated ID128 are never all-zero or all-one
This is the case because the ID128 we generate are all marked as v4 UUID
which requires that some bits are zero and others are one. Let's
document this so that people can rely on SD_ID128_NULL being a special
value for "uninitialized" that is always distinguishable from generated
UUIDs.
2021-05-26 21:44:15 +02:00
Lennart Poettering
997c2d5625 update TODO 2021-05-26 21:42:44 +02:00
Lennart Poettering
83aab043d3
Merge pull request #19737 from poettering/default-specifiers-env
pid1: add specifier expansion for DefaultEnvironment=
2021-05-26 21:38:38 +02:00
Topi Miettinen
d8e3c31bd8 Mount all fs nosuid when NoNewPrivileges=yes
When `NoNewPrivileges=yes`, the service shouldn't have a need for any
setuid/setgid programs, so in case there will be a new mount namespace anyway,
mount the file systems with MS_NOSUID.
2021-05-26 17:42:39 +02:00
Lennart Poettering
aa6dc3ec33 man: fix list of escaped characters in unit names
The code works differently than the docs, and the code is right here.
Fix the doc hence.

See VALID_CHARS in unit-name.c for details about allowed chars in unit
names, but keep in mind that "-" and "\" are special, since generated by
the escaping logic: they are OK to show up in unit names, but need to be
escaped when converting foreign strings to unit names to make sure
things remain reversible.

Fixes: #19623
2021-05-26 17:27:24 +02:00
Lennart Poettering
36c357b486
Merge pull request #19729 from poettering/networkctl-netns-check
networkctl: check that client netns matches networkd netns
2021-05-26 17:26:34 +02:00
Lennart Poettering
46a9ee5d9b core: support specifier expansion in DefaultEnvironment= and ManagerEnvironment=
Strictly speaking adding this is a compatibility break, given that
previously % weren't special. But I'd argue that was simply a bug, as
for the much more prominent Environment= service setting we always
resolved specifiers, and DEfaultEnvironment= is explicitly listed as
being the default for that. Hence, let's fix that.

Replaces: #16787
2021-05-26 17:20:36 +02:00
Lennart Poettering
b3e22322b6 repart: resolve $TMP specifiers too
This might be useful for CopyFiles=, to reference some subdir of $TMP in
a generic way. This allows us to use the new common
system_and_tmp_specifier_table[].
2021-05-26 17:20:36 +02:00
Lennart Poettering
2caed041c0 sysusers: add a generic specifier table for common cases
This moves the definition of the specifier table consisting only of
system and /tmp specifiers into generic code so that we can share it.
This patch only adds one user of it for now. Follow-up patches will add
more.
2021-05-26 17:20:36 +02:00
Lennart Poettering
3dfeb04491 hexdecoct: make return parameters of unbase64mem() and unhexmem() optional
Inspired by: #19059
2021-05-26 16:17:33 +02:00
Yu Watanabe
06043c7821 test-network: refuse RA if not necessary 2021-05-26 21:22:13 +09:00
Yu Watanabe
618da3e7d5 test-network: wait for that the link is in configuring state at the beginning 2021-05-26 21:13:56 +09:00
Lennart Poettering
205013c800 man: document udevadm info output prefixes
Fixes: #19663
2021-05-26 12:46:51 +01:00
Lennart Poettering
74c88a2520 man: try to clarify that nss-mymachines does not provide name resolution outside its own scope
Fixes: #18229
2021-05-26 12:45:20 +01:00
Lennart Poettering
7dbc38db50 man: explicit say for priority/weight values whether more is more or less
Fixes: #17523
2021-05-26 12:42:13 +01:00
Lennart Poettering
3b085db3b6 networkctl: politely refuse being called from a different netns than the networkd instance we talk to
Otherwise things get very confusing since we mix up netens data from our
client side and from the data we retrieve from networkd.

In the long run we should teach networkctl some switch to operate safely
on other netns, and in that case also determine the right networkd
instance for that namespace.

Fixes: #19236
2021-05-26 10:40:57 +02:00
Lennart Poettering
f2ef8b28a5 networkd: add bus property exposing network namepace ID we run in
This is useful for clients to determine whether they are running in the
same network namespace as networkd.

Note that access to /proc/$PID/ns/ is restricted and only permitted to
equally privileged programs. This new bus property is primarily a way to
work around this, so that unprivileged clients can determine the
networkd netns, too.
2021-05-26 10:37:18 +02:00
Lennart Poettering
bb635f3706 README: drop reference to Kinvolk
Kinvolk got bought by Microsoft recently, I doubt they'd even be open
for engineering services like this, hence let's drop the free
advertisement.
2021-05-26 09:34:14 +02:00
Yu Watanabe
89c629fc4b
Merge pull request #19726 from poettering/path-event-symlink
teach .path units to notice events on paths with components that are symlinks
2021-05-26 10:51:00 +09:00
Yu Watanabe
b69855e645
Merge pull request #19727 from poettering/pcr-comma
Allow PCRs to be separated by "+" instead of ","
2021-05-26 10:37:24 +09:00
Yu Watanabe
95599cacd3 core/service: do not set zero error to log_unit_debug_errno()
Fixes #19725.
2021-05-26 10:23:36 +09:00
Yu Watanabe
764dca0edc dns-domain: fix build failure with libidn
Follow-up for 319a4f4bc46b230fc660321e99aaac1bc449deea.

Fixes #19723.
2021-05-26 10:23:36 +09:00
Luca Boccassi
93f235e8d8
Merge pull request #19722 from poettering/empty-string-loginctl-man
document that "loginctl kill-session" takes an empty string + add the same for per-user stuff
2021-05-25 23:23:42 +01:00
Lennart Poettering
108144adea load-fragment: validate paths properly
The comment suggests we validate paths here, but we actually didn't, we
only validated filenames. Let' fix that.

(Note this still lets any kind of paths through, including those with
".." and stuff, this is not a normalization check after all)
2021-05-25 23:19:50 +01:00
Lennart Poettering
a3f9cd27cd test: add simple test for PCR list parsing 2021-05-25 23:40:10 +02:00
Lennart Poettering
d57f6340b6 tpm2-util: accept empty string for empty PCR list 2021-05-25 23:40:01 +02:00
Lennart Poettering
a1788a69b2 tpm2: support "+" as separator for TPM PCR lists
Previously, we supported only "," as separator. This adds support for
"+" and makes it the documented choice.

This is to make specifying PCRs in crypttab easier, since commas are
already used there for separating volume options, and needless escaping
sucks.

"," continues to be supported, but in order to keep things minimal not
documented.

Fixe: #19205
2021-05-25 23:28:54 +02:00
Lennart Poettering
41cdcb5498 core: watch paths with symlinks in .path units
When watching paths that contain symlinks in some element we so far
always only watched the inode they are pointing to, not the symlink
inode itself. Let's fix that and always watch both. We do this by simply
installing the inotify watch once with and once without IN_DONT_FOLLOW.
For non-symlink inodes this just overrides the same watch twice (where
the second one replaces the first), which is has no effect effectively.
For symlinks it means we'll watch both source and destination.

Fixes: #17727
2021-05-25 23:14:38 +02:00
Lennart Poettering
d6d00b650f core: optimize loop in path_spec_fd_event()
Let's avoid the whole loop if it can never match
2021-05-25 23:14:34 +02:00
Lennart Poettering
795125cd11 core: log about all errors in path_spec_watch()
So far we logged about most, but not all errors. Adding log to all
errors.
2021-05-25 23:14:30 +02:00
Lennart Poettering
44ff2a5e9c core: align path inotify mask table a bit 2021-05-25 23:13:52 +02:00
Lennart Poettering
c473437862
Merge pull request #19322 from poettering/dep-split
core: rework dependency system to be based on atoms + add three new dep types
2021-05-25 22:07:11 +02:00
Lennart Poettering
9f48b4e40e man: documet that loginctl {terminate|kill}-{session|user} take the empty string, optionally
Fixes: #19711
2021-05-25 17:42:34 +02:00
Lennart Poettering
68892f94ae loginctl: kill calling user when invoked with empty string
A suggested by: #19711
2021-05-25 17:40:54 +02:00
Lennart Poettering
9caf9859b4
Merge pull request #19705 from bluca/bpf_dlopen
core: make libbpf a dlopen() dependency
2021-05-25 16:51:16 +02:00
Lennart Poettering
0760363274 test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
Lennart Poettering
3ba471facb test-engine: ensure atom bits are properly packed
Let's make sure all atoms are actually used, and no holes are left.
2021-05-25 16:06:27 +02:00
Lennart Poettering
99e9af257a core: reorder where we add units to queues in unit_notify()
This moves all calls that shall do deferred work on detecting whether to
start/stop the unit or dependent units after a unit state change to the
end of the function, to make things easier to read.

So far, these calls were spread all over the function, and
conditionalized needlessly on MANAGER_RELOADING(). This is unnecessary,
since the queues are not dispatched while reloading anyway, and
immediately before acting on a queued unit we'll check if the suggested
operation really makes sense.

The only conditionalizaiton we leave in is on checking the new unit
state itself, since we have that in a local variable anyway.
2021-05-25 16:03:03 +02:00
Lennart Poettering
56c5959202 core: change BoundBy= dependency handling to be processed by a deferred work queue
So far StopWhenUnneeded= handling and UpheldBy= handling was already
processed by a queue that is dispatched in a deferred mode of operation
instead of instantly. This changes BoundBy= handling to be processed the
same way.

This should ensure that all *event*-to-job propagation is done directly
from unit_notify(), while all *state*-to-job propagation is done from a
deferred work queue, quite systematically. The work queue is submitted
to by unit_notify() too.

Key really is the difference between event and state: some jobs shall be
queued one-time on events (think: OnFailure= + OnSuccess= and similar),
others shall be queued continuously when a specific state is in effect
(think: UpheldBy=).  The latter cases are usually effect of the
combination of states of a few units (e.g. StopWhenUnneeded= checks
wether any of the Wants=/Requires=/… deps are still up before acting),
and hence it makes sense to trigger them to be run after an individual
unit's state changed, but process them on a queue that runs whenever
there's nothing else to do that ensures the decision on them is only
taken after all jobs/queued IO events are dispatched, and things
settled, so that it makes sense to come to a combined conclusion. If
we'd dispatch this work immediately inside of unit_notify() we'd always
act instantly, even though another event from another unit that is
already queued might make the work unnecessary or invalid.

This is mostly a commit to make things philosophically clean. It does
not add features, but it should make corner cases more robust.
2021-05-25 16:03:03 +02:00
Lennart Poettering
116654d2cf core: make unneeded check a bit tighter
Let's not consider a unit unneeded while it is reloading.

Uneeded should be a pretty weak concept: if there's any doubt that
something bit be needed, then assume it is.
2021-05-25 16:03:03 +02:00
Lennart Poettering
7e9212bf1a core: order reverse dep table in same way as enum 2021-05-25 16:03:03 +02:00
Lennart Poettering
0bc488c99a core: implement Uphold= dependency type
This is like a really strong version of Wants=, that keeps starting the
specified unit if it is ever found inactive.

This is an alternative to Restart= inside a unit, acknowledging the fact
that whether to keep restarting the unit is sometimes not a property of
the unit itself but the state of the system.

This implements a part of what #4263 requests. i.e. there's no
distinction between "always" and "opportunistic". We just dumbly
implement "always" and become active whenever we see no job queued for
an inactive unit that is supposed to be upheld.
2021-05-25 16:03:03 +02:00
Lennart Poettering
294446dcb9 core: add new OnSuccess= dependency type
This is similar to OnFailure= but is activated whenever a unit returns
into inactive state successfully.

I was always afraid of adding this, since it effectively allows building
loops and makes our engine Turing complete, but it pretty much already
was it was just hidden.

Given that we have per-unit ratelimits as well as an event loop global
ratelimit I feel safe to add this finally, given it actually is useful.

Fixes: #13386
2021-05-25 16:03:03 +02:00
Lennart Poettering
47cd17ead4 core: use StopPropagatedFrom= as default for .mount → .device unit dependencies
Let's make use of the new dependency type for .mount/.device units,
after all we added it for this purpose.

Fixes: #9869
2021-05-25 16:03:03 +02:00
Lennart Poettering
ffec78c05b core: add new PropagateStopTo= dependency (and inverse)
This takes inspiration from PropagatesReloadTo=, but propagates
stop jobs instead of restart jobs.

This is defined based on exactly two atoms: UNIT_ATOM_PROPAGATE_STOP +
UNIT_ATOM_RETROACTIVE_STOP_ON_STOP. The former ensures that when the
unit the dependency is originating from is stopped based on user
request, we'll propagate the stop job to the target unit, too. In
addition, when the originating unit suddenly stops from external causes
the stopping is propagated too. Note that this does *not* include the
UNIT_ATOM_CANNOT_BE_ACTIVE_WITHOUT atom (which is used by BoundBy=),
i.e. this dependency is purely about propagating "edges" and not
"levels", i.e. it's about propagating specific events, instead of
continious states.

This is supposed to be useful for dependencies between .mount units and
their backing .device units. So far we either placed a BindsTo= or
Requires= dependency between them. The former gave a very clear binding
of the to units together, however was problematic if users establish
mounnts manually with different block device sources than our
configuration defines, as we there might come to the conclusion that the
backing device was absent and thus we need to umount again what the user
mounted. By combining Requires= with the new StopPropagatedFrom= (i.e.
the inverse PropagateStopTo=) we can get behaviour that matches BindsTo=
in every single atom but one: UNIT_ATOM_CANNOT_BE_ACTIVE_WITHOUT is
absent, and hence the level-triggered logic doesn't apply.

Replaces: #11340
2021-05-25 16:03:03 +02:00
Lennart Poettering
629b2a6f7b core: add a reverse dep for OnFailure=
Let's add an implicit reverse dep OnFailureOf=. This is exposed via the
bus to make things more debuggable: you can now ask systemd for which
units a specific unit is the failure handler.

OnFailure= was the only dependency type that had no inverse, this fixes
that.

Now that deps are a bit cheaper, it should be OK to add deps that only
serve debug purposes.
2021-05-25 16:03:03 +02:00
Lennart Poettering
39628fedac core: hide cgroup fields in unit_dump() for non-cgroup unit types
A bunch of properties in the main Unit strcture only make sense for
cgroup units. Let's hide them from unit types that have no relation to
cgroups.
2021-05-25 16:03:03 +02:00
Lennart Poettering
d219a2b07c core: convert Slice= into a proper dependency (and add a back dependency)
The slice a unit is assigned to is currently a UnitRef reference. Let's
turn it into a proper dependency, to simplify and clean up code a bit.
Now that new dep types are cheaper, deps should generally be preferable
over everything else, if the concept applies.

This brings one major benefit: we often have to iterate through all unit
a slice contains. So far we iterated through all Before= dependencies of
the slice unit to achieve that, filtering out unrelated units, and
taking benefit of the fact that slice units are implicitly ordered
Before= the units they contain. By making Slice= a proper dependency,
and having an accompanying SliceOf= dependency type, this is much
simpler and nicer as we can directly enumerate the units a slice
contains.

The forward dependency is actually called InSlice internally, since we
already used the UNIT_SLICE name as UnitType field. However, since we
don't intend to expose the dependency to users as dep anyway (we already
have the regular Slice D-Bus property for this) this shouldn't matter.
The SliceOf= implicit dependency type (the erverse of Slice=/InSlice=)
is exported over the bus, to make things a bit nicer to debug and
discoverable.
2021-05-25 16:03:01 +02:00
Lennart Poettering
12f64221b0 core: add UNIT_GET_SLICE() helper
In a later commit we intend to move the slice logic to use proper
dependencies instead of a "UnitRef" object. This preparatory commit
drops direct use of the slice UnitRef object for a static inline
function UNIT_GET_SLICE() that is both easier to grok, and allows us to
easily replace its internal implementation later on.
2021-05-25 16:02:00 +02:00
Lennart Poettering
8ddba3f266 test-engine: extend engine test
Let's verify that the dependency type to atom mapping is consistent.

Let's also verify that dependency merging works correctly.
2021-05-25 15:54:19 +02:00
Lennart Poettering
defe63b0f3 core: rebreak a few comments 2021-05-25 15:54:19 +02:00
Lennart Poettering
15ed3c3a18 core: split dependency types into atoms 2021-05-25 15:54:19 +02:00
Lennart Poettering
641d3761d4 hashmap: add helper to test if iterator is still at beginning 2021-05-25 15:47:09 +02:00
Yu Watanabe
13eeefe1a8
Merge pull request #19716 from yuwata/sd-netlink-NETLINK_GET_STRICT_CHK
sd-netlink: enable NETLINK_GET_STRICT_CHK socket option to filter out message on kernel
2021-05-25 22:38:59 +09:00
Luca Boccassi
c5fd89adcd core: make libbpf a dlopen() dependency 2021-05-25 12:59:26 +01:00
Luca Boccassi
936cfad7e5 meson: look for bpftool in /usr/sbin too
On Debian, bpftool is installed in /usr/sbin, which is not in $PATH for
non-root users by default, so finding it fails.
Add a secondary, hard-coded '/usr/sbin/bpftool' after 'bpftool' so that
meson can find it.

https://packages.debian.org/sid/amd64/bpftool/filelist
2021-05-25 12:59:26 +01:00
Khem Raj
850f0008bf test-parse-argument: Include signal.h
Fixes
src/test/test-parse-argument.c:49:29: error: use of undeclared identifier 'SIGABRT'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-05-25 13:53:51 +02:00
Mantas Mikulėnas
fb906b00c6 README: point at IRC channel on the new network 2021-05-25 12:27:22 +02:00
Zbigniew Jędrzejewski-Szmek
dd30da133a
Merge pull request #19709 from keszybz/sysusers-no-proc
Add more logs and make sysusers works in dnf --installroot
2021-05-25 08:20:56 +02:00
Yu Watanabe
5de0d10bee
Merge pull request #19715 from yuwata/network-link-group
network: allow to set Group=0 in [Link] section
2021-05-25 13:29:50 +09:00
Zbigniew Jędrzejewski-Szmek
ffcd683852 systemctl: avoid crash when pattern expands to empty unit list
Fixes #19652.
2021-05-25 13:29:29 +09:00
Yu Watanabe
5709c7fe4e
Merge pull request #19713 from nabijaczleweli/bootctlpsko-liter
The "obviously good stuff" from #19006 again
2021-05-25 08:31:38 +09:00
Yu Watanabe
922a653090 test: add testcases of filtering on dumping addresses 2021-05-25 08:26:00 +09:00
Yu Watanabe
6a28b78f2e local-addresses: set ifindex when dump addresses on an interface 2021-05-25 08:26:00 +09:00
Yu Watanabe
c31298be7a network: set ifindex when dump addresses on an interface 2021-05-25 08:26:00 +09:00
Yu Watanabe
d7418b3bb2 sd-netlink: set NETLINK_GET_STRICT_CHK socket option
Then kernel filters out unnecessary info on dumping, e.g. RTM_GETADDR.
2021-05-25 08:26:00 +09:00
Yu Watanabe
3e0eeb8e33 sd-netlink: do not set route type and table by default for RTM_GETROUTE or friends 2021-05-25 08:26:00 +09:00
Yu Watanabe
3ca619061d sd-netlink: do not set action for RTM_GETRULE message
Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no rule
will be dumped.
2021-05-25 08:26:00 +09:00
Yu Watanabe
f318f64388 sd-netlink: do not enable dump flag by default for RTM_GETADDR message 2021-05-25 08:26:00 +09:00
Yu Watanabe
97bb863c25 sd-netlink: do not append prefixlen by default
Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no
address will be dumped.
2021-05-25 08:26:00 +09:00
Yu Watanabe
5aafd5b190 network: add several assertions in conf parsers 2021-05-25 07:12:05 +09:00
Yu Watanabe
f0c09831bd network: allow to set Group=0 in [Link] section
Previously, when a link has already in a numbered group, we cannot
remove the link from the group.

This also fixes the range mentioned in the man page.
2021-05-25 07:12:05 +09:00
наб
44230fa2b0
kernel-install: don't erase previous errors if a hook returns 77
The manpage says that exiting 77 is the same as exiting 0,
then skipping all other hooks, but the behaviour heretofor
was to exit 0, skip all, and behave as if all hooks exited 0
2021-05-24 21:56:35 +02:00
Zbigniew Jędrzejewski-Szmek
82855aa610 sysusers: make sysusers work with dnf --installroot
This is not very pretty, but the code in fs-util.c already provisions for
missing /proc. We ourselves are careful to set up /proc, but not everybody
is and it is important for sysusers to also work where shadow-utils would:
I would like to replace calls to useradd and groupadd in Fedora systemd rpm
scriptlets with a call to sysusers. It has a number of advantages:
- dogfooding
- we don't need to manually duplicate the information from our sysusers
  files to scriptlets
- a dependency on shadow-utils is dropped, which transitively drops dependencies
  on setup and fedora-repos and bunch of other stuff.

We could try to get 'dnf' and 'rpm --root' and such to be reworked,
but not in any reasonable timeframe. And even if this was done, we'd still
want to support older rpm/dnf versions.
2021-05-24 21:41:24 +02:00
Zbigniew Jędrzejewski-Szmek
0520564dcf basic: allow copy_rights() to work without mounted /proc
This will be used in sysusers later on.
2021-05-24 21:41:22 +02:00
Zbigniew Jędrzejewski-Szmek
335f6ab4f1 sysusers: add debug lines to failing getent/putent operations
I'm trying to use systemd-sysusers for systemd.rpm itself, and the invocation
in dnf chroot is failing like this:
...
Creating group input with gid 999.
Creating group kvm with gid 36.
Creating group render with gid 998.
Creating group sgx with gid 997.
Creating group systemd-journal with gid 190.
Creating group systemd-network with gid 192.
Creating user systemd-network (systemd Network Management) with uid 192 and gid 192.
Creating group systemd-oom with gid 996.
Creating user systemd-oom (systemd Userspace OOM Killer) with uid 996 and gid 996.
Creating group systemd-resolve with gid 193.
Creating user systemd-resolve (systemd Resolver) with uid 193 and gid 193.
Creating group systemd-timesync with gid 995.
Creating user systemd-timesync (systemd Time Synchronization) with uid 995 and gid 995.
Creating group systemd-coredump with gid 994.
Creating user systemd-coredump (systemd Core Dumper) with uid 994 and gid 994.
Failed to write files: Function not implemented

Let's add more info to make such failures easier to debug.
2021-05-24 21:41:10 +02:00
Zbigniew Jędrzejewski-Szmek
62d1c93a02 sysusers: reduce scope of variables and drop unnecessary initializations 2021-05-24 21:39:04 +02:00
наб
0ad401dc5d
kernel-install/90-loaderentry: use install(1) instead of cp/chown/chmod chains
Also fix typo in error message
2021-05-24 21:35:12 +02:00
Roshan Shariff
07c0e5eeaf rules.d: Properly quote $env{MODALIAS}
Add quotes around use of $env{MODALIAS} in rules.d/80-drivers.rules. The
 modalias can contain whitespace, for example when it is dynamically generated
 using device or vendor IDs.
2021-05-24 18:40:01 +01:00
Vincent Dechenaux
f0c7e594ed Typo in service.c
use => user
2021-05-24 14:47:29 +02:00
наб
8a2f7b7c9b
man: we is OK too -> which is OK too (#19708) 2021-05-24 18:39:38 +09:00
Zbigniew Jędrzejewski-Szmek
341d883ad6
Merge pull request #19701 from yuwata/network-udev-do-not-manage-loopback-interfaces
udev: do not manage loopback interfaces
2021-05-24 07:26:18 +02:00
Yu Watanabe
113d94c393
Merge pull request #19704 from yuwata/network-small-fixes
network: several tiny cleanups
2021-05-23 23:02:07 +09:00
Yu Watanabe
70f32a260b udev/net: do not manage loopback interfaces
There are nothing we can configure in udevd for loopback interfaces;
no ethertool configs can be applied, MAC address, interface name should
not be touched.
2021-05-23 22:58:47 +09:00
Yu Watanabe
f25e642bca sd-netlink: rename rtnl_get_link_iftype() -> rtnl_get_link_info() and make it optionally return link flags 2021-05-23 22:58:03 +09:00
Yu Watanabe
ce01c07f1c udev/net: rename link_config -> LinkConfig 2021-05-23 22:58:03 +09:00
Yu Watanabe
afca7ac13d udev/net: rename link_config_ctx -> LinkConfigContext 2021-05-23 22:58:03 +09:00
Yu Watanabe
75d5abd298 network: IPv6LinkLocalAddressGenerationMode=none disables IPv6LL addressing 2021-05-23 17:13:06 +09:00
Yu Watanabe
c3b9425130 network: make link_configure() static 2021-05-23 17:12:48 +09:00
Yu Watanabe
fbb1a39866 ordered-set: introduce ordered_set_get() 2021-05-23 17:12:40 +09:00
Yu Watanabe
2a5a844259
Merge pull request #19681 from yuwata/ethtool-util-log
ethtool-util: several cleanups
2021-05-23 15:24:46 +09:00
Yu Watanabe
3ee316bd7b ethtool-util: drop unused function 2021-05-23 11:40:15 +09:00
Yu Watanabe
80662eecbf udev/net: drop unnecessary conditions 2021-05-23 11:40:15 +09:00
Yu Watanabe
a7994dd3ab udev/net: drop fallback logic to set speed
ethtool_set_glinksettings() already fallback to use ETHTOOL_GSET/ETHTOOL_SSET
commands when ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS are not
supported.
2021-05-23 11:40:15 +09:00
Yu Watanabe
ba1030594e ethtool-util: do not touch anything if nothing is requested
And update settings only when it is necessary.
2021-05-23 11:40:15 +09:00
Yu Watanabe
c8e644b116 ethtool-util: disable autonegotiation when speed, duplex, or port is specified
And if autonegotiation is enabled, speed, duplex, and port are ignored.

Fixes #19625.
2021-05-23 11:40:15 +09:00
Yu Watanabe
4323046c5f ethtool-util: move and rebreak comments 2021-05-23 11:40:15 +09:00
Yu Watanabe
4f5040313d ethtool-util: make ethtool_connect() open fd only when it is not opened 2021-05-23 11:39:56 +09:00
Luca Boccassi
986cdba9f8
Merge pull request #19697 from jwrdegoede/hwdb-more-accel-quirks
Hwdb more accel quirks
2021-05-22 23:57:18 +01:00
Luca Boccassi
d1cb55e6e4
Merge pull request #19700 from keszybz/check-os-release-fixups
Fixups for man/check-os-release.*
2021-05-22 23:56:59 +01:00
Hans de Goede
82de3fc6a4 hwdb: keyboard: Ignore duplicate atkbd keypresses on touchpad on/off toggle
The atkbd device on the Lenovo Yoga 300-11IBR 2-in-1 sends unknown
keycodes when the touchpad is toggled on/off:

[ 1918.995562] atkbd serio0: Unknown key pressed (translated set 2, code 0x63 on isa0060/serio0).
[ 1918.995610] atkbd serio0: Use 'setkeycodes 63 <keycode>' to make it known.
[ 1919.032121] atkbd serio0: Unknown key released (translated set 2, code 0x63 on isa0060/serio0).
[ 1919.032135] atkbd serio0: Use 'setkeycodes 63 <keycode>' to make it known.
[ 1926.098414] atkbd serio0: Unknown key pressed (translated set 2, code 0x62 on isa0060/serio0).
[ 1926.098461] atkbd serio0: Use 'setkeycodes 62 <keycode>' to make it known.
[ 1926.146537] atkbd serio0: Unknown key released (translated set 2, code 0x62 on isa0060/serio0).
[ 1926.146583] atkbd serio0: Use 'setkeycodes 62 <keycode>' to make it known.

The "Ideapad extra buttons" driver alreadys sends f22 / f23 key-events
when the touchpad is toggles off, so map the keycodes for the duplicate
atkbd events to unknown to silence these kernel warnings.
2021-05-22 20:50:36 +02:00
Zbigniew Jędrzejewski-Szmek
91da09bd1a man/check-os-release.*: allow ID_LIKE to have multiple values
I missed the fact that it is documented to be a space-separated list.
2021-05-22 20:44:04 +02:00
Zbigniew Jędrzejewski-Szmek
82ca34e6e6 man/check-os-release.py: ignore comment and empty lines
Plus fix off-by-one in error printing.
2021-05-22 20:44:04 +02:00
Hans de Goede
f769f9d095 hwdb: Add accel orientation quirk for the Lenovo Yoga 300-11IBR 2-in-1
Add a quirk for the accelerometer orientation and location for the
2 accelerometers inside the Lenovo Yoga 300-11IBR 2-in-1.
2021-05-22 16:22:36 +02:00
Lennart Poettering
83a04afc06
Merge pull request #19686 from keszybz/os-release-modernization-and-examples
os-release modernization and examples
2021-05-22 14:44:50 +02:00
Lennart Poettering
4c483e2647
Merge pull request #19693 from poettering/sleep-tweaks
sleep code refactoring + automatic fallback from hybrid sleep to suspend
2021-05-22 14:35:26 +02:00
Zbigniew Jędrzejewski-Szmek
412339835e man/check-os-release.py: strip trailing whitespace
The shell parser would do that, so so should we.
2021-05-22 12:20:51 +02:00
Zbigniew Jędrzejewski-Szmek
c0527e1f95 man: say that initrd-release is like os-release 2021-05-22 12:20:51 +02:00
Hans de Goede
eb281f3eff hwdb: Add accel orientation quirk for the KD Kurio Smart C15200 tablet
Add a quirk to fix the accelerometer orientation on the
KD Kurio Smart C15200 tablet.
2021-05-22 12:13:42 +02:00
Lennart Poettering
c3565fe81f sleep: clarify that failure setting env var is not fatal 2021-05-22 11:00:04 +02:00
Lennart Poettering
3d1321117e sleep: if hybrid sleep fails, do regular suspend
Fixes #19550
2021-05-22 11:00:04 +02:00
Lennart Poettering
b0c035e3c8 sleep: remove duplicate logging
execute() logs about all errors, hence only log about what's new, i.e.
what we'll do as consequence, and don't mention the error cause again.
2021-05-22 11:00:04 +02:00
Lennart Poettering
887b2019b6 sleep: don't check for EADV
EADV is not generated anymore since
6d176522f5480ea9e9a83de5ef5ea5e0d95b79cb, let's hence not check for it
anymore.
2021-05-22 11:00:00 +02:00
Lennart Poettering
61dc84817e sleep: can_sleep_state() + can_sleep_disk() don#t return plain booleans 2021-05-22 11:00:00 +02:00
Lennart Poettering
c8cd8ca398 sleep: use SleepOperation enum everywhere and drop sleep_settings()
Instead of comparing strings everywhere, let's use the new enum. This
allows us to drop sleep_settings(), since the operation enum can be
directly used as index into the config settings.

Some minor other refactoring is done, but mostly just shifting thing
around a bit, no actual change in behaviour.
2021-05-22 11:00:00 +02:00
Lennart Poettering
be2a4b0d7e sleep: introduce high-level SleepOperation enum 2021-05-22 10:58:22 +02:00
Lennart Poettering
86204ae145 units: make sure importd has CAP_LINUX_IMMUTABLE flag
Since d8f9686c0f1f276c0a687d9bd69f3adf33f15a95 we use the chattr +i flag
for marking containers in directories as reead-only. But to do so we
need the cap for it, hence grant it.

Fixes: #19115
2021-05-22 16:02:02 +09:00
Yu Watanabe
af92e46527
Merge pull request #19594 from yuwata/network-nexthop-group
network: nexthop: add Group= setting to configure multipath route with group nexthop
2021-05-22 16:01:13 +09:00
Yu Watanabe
a6c747a63f
Merge pull request #19691 from poettering/read-virtual-file-tweaks
tweaks to read_virtual_file()
2021-05-22 15:59:17 +09:00
Zbigniew Jędrzejewski-Szmek
fe7f113c13 units: skip some units in the initrd
I'm working on building initramfs images directly from normal packages, and it
doesn't make sense for those units to be started. Pristine system rpms need to
behave correctly as much as possible also in the initrd, and those units are
enabled by the rpms. There usually isn't enough time for the timer to actually
fire, but starting it gives a line on the console and generally looks confusing
and sloppy. Flushing the journal means that its actually lost, since the real
/var is not available yet.

Another approach would be not enable those units, but right now they are
statically enabled, and changing that would be more work, and doesn't really
seem necessary, since the condition checks are very quick.

Checking for /etc/initrd-release is the standard condition that the initrd
units use, so let's do the same here.
2021-05-22 15:58:40 +09:00
Yu Watanabe
9c8f90d0f9 test-network: add a test case for nexthop Group= setting 2021-05-22 04:59:45 +09:00
Yu Watanabe
228c3e21e9 network: nexthop: add Group= setting to configure multipath route with group nexthop 2021-05-22 04:59:40 +09:00
Yu Watanabe
8031e5ca8d network: nexthop: IFF_UP flag is required for nexthops which attached to a link 2021-05-22 04:56:46 +09:00
Yu Watanabe
7b3a7581e3 network: make nexthop_add(), nexthop_configure() and friends return 0 on success
After request queue is introduced, the return value on success is unused.
2021-05-22 04:56:46 +09:00
Lennart Poettering
b2d0b90f54 fileio: read_virtual_file(): on last attempt ignore file size
Apparently the reported file size was misleading on this file, hence
ignore it on our last loop attempt and just pretend it wasn't reported
at all.
2021-05-21 21:54:44 +02:00
Lennart Poettering
eff722c693 test-fileio: run read_virtual_file() for a couple of more interesting sizes 2021-05-21 21:54:44 +02:00
Lennart Poettering
8461d6da35 test-fileio: fix confusing log output
Previously we'd pass all return values of read_virtual_file() to
log_info_errno() as error, but that makes no sense, given that we
sometimes return positive one with means "not truncated" but we'd show
as "Permission denied. Let's fix this, and log differently for sucess
and error.
2021-05-21 21:54:43 +02:00
Lennart Poettering
fd3c6992d9 fileio: read_virtual_file() don't tweak buffer for returning it when we aren't returning it
Let's avoid some redundant work.

Moreover, let' not check for NUL bytes in the buffer if we don't return
the buffer.
2021-05-21 21:54:43 +02:00
Lennart Poettering
259f6de486 fileio: fix typo in comment 2021-05-21 21:54:43 +02:00
Lennart Poettering
136f12a26a fileio: read_virtual_file(): exit once the max_size limit is reached
Alternative to: #19682
2021-05-21 21:54:19 +02:00
Lennart Poettering
1b5e91a8d2 fileio: if we try to read a file larger than SIZE_MAX this is not a problem if a max_size is specified
i.e. 32bit userspace reading /proc/kcore on a 64bit kernel with max_size
should not needlessly fail.
2021-05-21 21:54:19 +02:00
Yu Watanabe
234106dbf9 network: route: make stored multipath route weight equivalent to hop of nexthop 2021-05-22 04:54:09 +09:00
Yu Watanabe
11a288e846 ethtool-util: downgrade log level
This just hides issue #19625. It will be fixed in later commits.
2021-05-22 04:40:54 +09:00
Luca Boccassi
0557680919 test-env-util: use streq_ptr when comparing directly the result of getenv
It might return NULL.

Fixes CID #1453247
2021-05-22 03:05:53 +09:00
Lennart Poettering
f5e775973a sd-device: use strjoina() more again in sd_device_new_from_subsystem_sysname()
This reverts a major part of: e17c95af8e450caacde692875b30675cea75211f

Using format strings for concatenating strings is pretty unefficient,
and using PATH_MAX buffers unpretty as well. Let's revert to using
strjoina() as before.

However, to fix the fuzz issue at hand, let's explicitly verify the two
input strings ensuring they are valid path names. This includes a length
check (to 2K each), thus making things prettier, faster and using less
memory again.
2021-05-21 17:52:57 +02:00
Lennart Poettering
a6383f1e93
Merge pull request #19676 from bluca/coverity
Fix two new coverity issues
2021-05-21 17:52:36 +02:00
Lennart Poettering
2c80660557
Merge pull request #19672 from yuwata/strextend
tree-wide: introduce strextendf_with_separator() and use strextend() or freinds
2021-05-21 17:52:14 +02:00
Zbigniew Jędrzejewski-Szmek
8fd67ab5a3 man: reword description of BUILD_ID in os-release
Our description was pretty hard to parse. Let's replace it with a description
loosely based on a fairly clear description written by a distro that actually
uses BUILD_ID:
https://developer.rigado.com/docsets/Working-with-the-Rigado-Vesta-Gateway/latest/production/versioning-images.html#the-rigos-scheme.
2021-05-21 17:06:28 +02:00
Lennart Poettering
674d8dcc47
Merge pull request #19647 from ddstreet/test-oomd-failure
handle lack of kernel support for some cgroup files
2021-05-21 16:35:16 +02:00
Zbigniew Jędrzejewski-Szmek
3ca606d103 man: add example os-release mangling in python
This is also not entirely obvious. I think the code I came
up with is pretty elegant ;] The final part of of the code that makes
use of the parsed data is kept very similar to the shell code on purpose,
even though it could be written a bit more idiomatically.
2021-05-21 16:33:04 +02:00
Zbigniew Jędrzejewski-Szmek
e839ebe551 man: add an example how to correctly read os-release in shell
This is not entirely obvious.

The logic of how to interpret the fields applies in any language, so drop the
pointless mention of C or shell.
2021-05-21 16:32:54 +02:00
Zbigniew Jędrzejewski-Szmek
00e3abe024 man: reorder fields in os-release
Let's order the fields from the most general to least: os name, os variant, os
version, machine-parseable version details, metadata, special settings. I added
section headers to roughly group the settings. The division is not strict,
because for example CPE_NAME also includes the version, and PRETTY_NAME may
too, but it still makes it easier to find the right name.

Also split out Examples to separate paragraphs:
almost all descriptions had "Example:" at the end, where multiple
examples were listed. Splitting this out to separate paragraphs
makes the whole thing much easier to read.

Add missing markup and punctuation while at it.

About
- If not set, defaults to <literal>NAME=Linux</literal>.
+ If not set, a default of <literal>NAME=Linux</literal> may be used.
and similar changes: in many circumstances, if this is not set, no value should
be used. The fallback mostly make sense when we need to present something to the
user. So let's reword this to not imply that the default is necessary.
2021-05-21 12:24:14 +02:00
Yu Watanabe
e8f99f4e24 network: fix an infinite loop
Fixes #19467.
2021-05-21 12:03:01 +09:00
asavah
670427a4d4 man: prevent race condition when generating systemd.directives.xml 2021-05-20 20:49:50 +01:00
Dan Streetman
135400276c oom: log one-time warning if kernel doesn't provide memory.swap.current
The kernel can be compiled without support for any memory.swap.* files, or
it can be disabled at boot time with the 'swapaccount=0' boot parameter,
so if the file doesn't exist log warning indicating the kernel doesn't
support the file and the user may need to try using the 'swapaccount=1'
boot param.

Note that the actual error from the call to fopen() is ENOENT, but
that is translated into ENODATA in cg_get_attribute_as_uint64()
2021-05-20 15:40:29 -04:00
Dan Streetman
0de2fd1870 psi: update is_pressure_supported to read file
The kernel still provides the /proc and cgroup pressure files even
if its psi support is disabled, so we need to actually read the files
to verify they don't return -EOPNOTSUPP
2021-05-20 15:40:21 -04:00
Dan Streetman
264f0afe0d log: add log_once() and log_once_errno() macros
These macros will log a message at the specified level only the first time
they are called. On all later calls, if the specified level is debug, the
logs will be suppressed; otherwise the message will be logged at debug.
2021-05-20 15:39:15 -04:00
Dan Streetman
ea42da3825 macro: add ONCE macro that evaluates to 1 one time
Every location that this macro is used, it will be true the first
time it's checked, then false each time after that.

This can be useful for things such as one-time logging.
2021-05-20 15:39:15 -04:00
Lennart Poettering
f267c3142a fileio: make return parameters of read_virtual_file() optional
Prompted by: #19647
2021-05-20 15:39:03 -04:00
Lennart Poettering
9d54c9a3d9
Merge pull request #19551 from cgzones/fix_reload
selinux: reload label db on policy load with libselinux 3.2
2021-05-20 21:37:59 +02:00
Lennart Poettering
f9e60ff9ad
Merge pull request #19605 from yuwata/network-fdb-outgoing-interface
network: bridge-fdb: add support to specify outgoing interface
2021-05-20 21:33:14 +02:00
Yu Watanabe
e6655fbe40 man: mention that drop-in files are merged in alphanumeric order
This addresses the request in https://github.com/systemd/systemd/issues/19467#issuecomment-829332877.
2021-05-20 21:20:51 +02:00
Yu Watanabe
580bf61304 sysv-generator: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe
742a011a3a systemctl: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe
eda397c966 run: use strextend_with_separator() 2021-05-20 21:57:09 +09:00
Yu Watanabe
cfea7618f2 nspawn: use strextendf_with_separator() 2021-05-20 21:57:04 +09:00
Luca Boccassi
f09e336b3a resolved: check return value of gcrypt APIs
Coverity complains about missing error check.

CID #1453234
2021-05-20 10:47:41 +01:00
Luca Boccassi
06a368e819 journal: fix uninitialized variable use
If the journal file being processed is archivied, seqnum_id will not be
initialized before being passed on, and coverity complains.
Initialize it to zero.

CID #1453235
2021-05-20 10:47:41 +01:00
Yu Watanabe
db5486b450 test-network: add a testcase for OutgoingInterface= in [BridgeFDB] 2021-05-20 18:23:15 +09:00
Susant Sahani
af99cdf4d4 network: bridge-fdb: add support to specify outgoing interface 2021-05-20 18:23:15 +09:00
Yu Watanabe
e5b35bf6c2 network: use queue to configure bridge FDB 2021-05-20 18:23:15 +09:00
Yu Watanabe
9671ae9d51 network: bridgeFDB: rename FdbEntry -> BridgeFDB 2021-05-20 18:23:15 +09:00
Yu Watanabe
4ff6ff9a91 networkctl: use strextend() 2021-05-20 18:18:56 +09:00
Yu Watanabe
03c324c578 sd-bus: use strextend() 2021-05-20 18:18:56 +09:00
Yu Watanabe
f8abe13f32 escape: use strextend() 2021-05-20 18:18:56 +09:00
Yu Watanabe
a2a7b77260 pid1: use strextend_with_separator() 2021-05-20 18:18:56 +09:00
Yu Watanabe
2b070200f1 env-util: use strextend() 2021-05-20 18:18:56 +09:00
Yu Watanabe
4304f68d15 network: route: make log_route_debug() show weight for multipath route 2021-05-20 18:18:52 +09:00
Yu Watanabe
6b13ca8ada string-util: introduce strextendf_with_separator() 2021-05-20 18:16:51 +09:00
Luca Boccassi
f144f6faa9
Merge pull request #19669 from mrc0mmand/ci-mkosi-arch
ci: work around #19442 to make CI happy again
2021-05-20 10:14:30 +01:00
Yu Watanabe
354dadb30f nspawn: fix build failure
This fixes a conflict between #19555 and #19653.
2021-05-20 10:04:14 +02:00
Anita Zhang
1539124b39 man: document default rlimits
Fixes #19645
2021-05-20 09:58:48 +02:00
Zbigniew Jędrzejewski-Szmek
f78ad5f046 test: enable fuzz regression tests by default
This ensures that the fuzz test code is also built by default.
It also increases the test coverage a bit. Compiling the tests
*with* sanitizers is painfully slow, so this is not enabled. But
just compiling them sauté is hardly noticable. Running the tests
increases the test count and runtime:
  622 tests, 26 s
to
  922 tests, 35 s
I think this is acceptable.
2021-05-20 09:30:43 +02:00
Lennart Poettering
d99c2df2df
Merge pull request #19555 from poettering/nspawn-bind-user
nspawn: add --bind-user= feature for binding  host user+homedir into a container
2021-05-20 07:33:51 +02:00
Lennart Poettering
48b4a760c9
Merge pull request #19591 from poettering/terminal-fixes
five terminal handling fixes
2021-05-20 07:33:21 +02:00
Luca Boccassi
2d4efd1dba build tests: check that Github pages can be built successfully 2021-05-19 23:25:34 +02:00
Lennart Poettering
2adcf6f4f7
Merge pull request #19662 from yuwata/memdup
util: make memdup() or friends safer
2021-05-19 23:24:55 +02:00
Lennart Poettering
ed056c560b
Merge pull request #19653 from poettering/greedy-realloc-more
malloc_usable_size() tweaks
2021-05-19 23:22:44 +02:00
Frantisek Sumsal
27b4d60678 ci: skip root tty login
We use the `autologin` mkosi option (see
mkosi.default.d/10-systemd.conf), so the pexpect root login throws
a (harmless) error:

```
Arch Linux (built from systemd tree)
Kernel 5.4.0-1047-azure on an x86_64 (console)

image login: root (automatic login)

root
root
[root@image ~]# systemctl poweroff
root
-bash: root: command not found
[root@image ~]# systemctl poweroff
```
2021-05-19 23:07:25 +02:00
Frantisek Sumsal
715a273b10 ci: show image summary 2021-05-19 23:07:25 +02:00
Frantisek Sumsal
48a3cf58d5 ci: work around #19442 to make CI happy again
Let's introduce a somewhat ugly workaround for #19442 and retry
the systemd-nspawn image boot test up to three times in case it dies
with the dissect timeout. Since this issue occurs only in the Arch job,
limit the workaround to this job only.
2021-05-19 23:07:19 +02:00
Lennart Poettering
374c80df67
Merge pull request #19603 from yuwata/network-link-get-by-name
network: introduce link_get_by_name() and use it in resolving interface name specifier in MultiPathRoute=
2021-05-19 21:35:48 +02:00
Lennart Poettering
aa4d11a4eb
Merge pull request #19656 from yuwata/network-trivial-cleanups
network: several trivial cleanups
2021-05-19 21:34:59 +02:00
Franck Bui
0495728429 kbd-model-map: add mapping 'es-dvorak'
And update test-keymap-util accordingly.

While at it, make sure to use tabs everywhere.
2021-05-19 21:34:40 +02:00
Yu Watanabe
834f3ba1a0 test: reduce debugging logs in test-event
The logs mostly give no information, but fill CI results.
2021-05-19 21:34:17 +02:00
Lennart Poettering
1d406dceb7 systemctl: re-align colon in status output 2021-05-19 21:33:59 +02:00
Lennart Poettering
11f3c130aa terminal: don't hardcode major number of PTYs
Hardcoding major numbers sucks. And we generally don't do it, except
when determining whether something is a PTY. Thing though is that we
don't actually need to do that here either, hence don#t.
2021-05-19 17:58:01 +02:00
Lennart Poettering
a06c9ac277 man: document new nspawn --bind-user= feature 2021-05-19 17:46:59 +02:00
Lennart Poettering
2f89304490 nspawn: add new --bind-user= option for binding a host user into the container
This new option does three things for a host user specified via
--bind-user=:

1. Bind mount the home directory from the host directory into
   /run/host/home/<username>

2. Install an additional user namepace UID/GID mapping mapping the host
   UID/GID of the host user to an unused one from the container in the range
   60514…60577.

3. Synthesize a user/group record for the user/group under the same name
   as on the host, with minimized information, and the UID/GID set to
   the mapped UID/GID. This data is written to /run/host/userdb/ where
   nss-system will pick it up.

This should make sharing users and home directories from host into the
container pretty seamless, under some conditions:

1. User namespacing must be used.

2. The host UID/GID of the user/group cannot be in the range assigned to
   the container (kernel already refuses this, as this would mean two
   host UIDs/GIDs might end up being mapped to the same continer
   UID/GID.

3. There's a free UID/GID in the aforementioned range in the container,
   and the name of the user/group is not used in the container.

4. Container payload is new enough to include an nss-systemd version
   that picks up records from /run/host/userdb/
2021-05-19 17:46:59 +02:00
Lennart Poettering
91181e075b nspawn: export userns_mkdir() + userns_lchown() so that it can be used elsewhere in nspawn 2021-05-19 17:33:25 +02:00
Lennart Poettering
1a298a206c user-record: optionally, allow parsing empty user record JSON objects 2021-05-19 17:33:25 +02:00
Lennart Poettering
0ba976e8da execute: don't chown/chmod non-TTY inodes thinking they were TTYs
Fixes: #19213

This is a safety net for invalid configurations, see the original bug
report.
2021-05-19 17:12:01 +02:00
Lennart Poettering
f2df231fed core: use GID_INVALID instead of -1 where appropriate 2021-05-19 17:12:01 +02:00
Lennart Poettering
4768529ff1 terminal-util: use _cleanup_close_ where appropriate 2021-05-19 17:12:01 +02:00
Lennart Poettering
e60a4a3c46 terminal-util: add extra validity checks that we operate on a TTY before doing so
Prompted by #19213, but not fixing it.

This is mostly paranoia that we don't do stuff on inodes that aren't
actually ttys.
2021-05-19 16:53:50 +02:00
Lennart Poettering
7eaee90286 terminal-util: add debug logging for when TTY ioctls fail 2021-05-19 16:53:50 +02:00
Lennart Poettering
319a4f4bc4 alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()
We recently started making more use of malloc_usable_size() and rely on
it (see the string_erase() story). Given that we don't really support
sytems where malloc_usable_size() cannot be trusted beyond statistics
anyway, let's go fully in and rework GREEDY_REALLOC() on top of it:
instead of passing around and maintaining the currenly allocated size
everywhere, let's just derive it automatically from
malloc_usable_size().

I am mostly after this for the simplicity this brings. It also brings
minor efficiency improvements I guess, but things become so much nicer
to look at if we can avoid these allocation size variables everywhere.

Note that the malloc_usable_size() man page says relying on it wasn't
"good programming practice", but I think it does this for reasons that
don't apply here: the greedy realloc logic specifically doesn't rely on
the returned extra size, beyond the fact that it is equal or larger than
what was requested.

(This commit was supposed to be a quick patch btw, but apparently we use
the greedy realloc stuff quite a bit across the codebase, so this ends
up touching *a*lot* of code.)
2021-05-19 16:42:37 +02:00
Lennart Poettering
99480504d4 alloc-util: add MALLOC_ELEMENTSOF() helper
This is a wrapper around malloc_usable_size() but is typesafe, and
divides by the element size.

A test it is also added ensuring what it does it does correcly.
2021-05-19 16:42:19 +02:00
Lennart Poettering
6df28e1f84 alloc-util: introduce MALLOC_SIZEOF_SAFE() helper
It's a wrapper around malloc_usable_size() that is supposed to be
compatible with _FORTIFY_SOURCES=1, by taking the
__builtin_object_size() data into account, the same way as the
_FORTIFY_SOURCES=1 logic does.

Fixes: #19203
2021-05-19 16:42:00 +02:00
Lennart Poettering
871a3a33bb
Merge pull request #19608 from keszybz/resolved-pahole
Pahole optimization for resolved's DnsQuery
2021-05-19 16:35:16 +02:00
Yu Watanabe
6db7b533c6
Merge pull request #19163 from sipraga/online-if-required
network: introduce an online state that respects RequiredForOnline=
2021-05-19 23:08:18 +09:00
Luca Boccassi
a9833ed01d
Merge pull request #19659 from keszybz/mkosi-naming-adjustment
Mkosi dependency naming adjustment
2021-05-19 14:33:56 +01:00
Yu Watanabe
550721c2e3 alloc-util: use memcpy_safe() in memdup() or friends 2021-05-19 21:22:23 +09:00
Yu Watanabe
d1f3b08098 memory-util: make memcpy_safe() return pointer to destination 2021-05-19 21:20:49 +09:00
Frantisek Sumsal
943edd04b5
Merge pull request #19661 from keszybz/restore-liquid-compatibility
Restore liquid compatibility
2021-05-19 13:58:35 +02:00
Zbigniew Jędrzejewski-Szmek
ba777d019f docs: prettify two external links 2021-05-19 13:53:51 +02:00
Zbigniew Jędrzejewski-Szmek
c9d311c787 docs: use {% raw %} to wrap jinja2 tags in documentation
As reported by @mrc0mmand:
> Since 89f52a780e (diff-b842e6ab4a95a695d9449d106f091e6a134d9eac8d2aee1cd8b169fcb6b3a98bR109)
> the GH pages fail to build, since they use the Liquid templating language,
> which coincidentally uses a very similar tags as jinja:
> https://shopify.github.io/liquid/tags/control-flow/
>
>> The tag elif on line 112 in HACKING.md is not a recognized Liquid tag.
2021-05-19 13:53:51 +02:00
Frantisek Sumsal
31db4c20ea test: reintroduce m4 dependency for TEST-06-SELINUX
m4 is required to build the test SELinux module:

```
[   31.321789] sh[483]: /bin/sh: line 1: m4: command not found
[   31.882668] sh[488]: Compiling targeted systemd_test module
[   32.120862] sh[492]: /bin/sh: line 1: m4: command not found
[   32.159897] sh[458]: make: *** [/usr/share/selinux/devel/include/Makefile:156: tmp/systemd_test.mod] Error 127
```
2021-05-19 13:01:07 +02:00
Zbigniew Jędrzejewski-Szmek
c648c176bc mkosi: stop pulling in vi
We have 'nano' everywhere, and it's enough for a casual edit.
2021-05-19 10:55:03 +02:00
Zbigniew Jędrzejewski-Szmek
6c72b0b737 mkosi/fedora: use pkgconfig virtual provides to refer to packages
... and /usr/bin/ path for a library package which provides an executable we
care about (libxslt).

This way the mkosi dependency list corresponds directly to the names which are
used in the dependency() and find_program() lines in meson.build. It also makes
the thing more resilient to package splits and renames.
2021-05-19 10:54:08 +02:00
Zbigniew Jędrzejewski-Szmek
ded2e247e2 mkosi/fedora: drop python3-devel req
I think it was only used for building the python wrappers.

C.f. ec9ca01d16.
2021-05-19 10:54:04 +02:00
Yu Watanabe
70a2d9dd31 network: route: check validity of interface name in MultiPathRoute= 2021-05-19 16:28:53 +09:00
Yu Watanabe
8ed87c4983 network: route: parse earlier if device specifier in MultiPathRoute= is ifindex 2021-05-19 16:28:53 +09:00
Yu Watanabe
0b54c87081 network: introduce link_get_by_name() 2021-05-19 16:28:53 +09:00
Yu Watanabe
8e4b1b35bc network: drop redundant condition
When Network::unmanaged is set, then the Network object is not assigned
to any Link object. Hence, the condition is always false.
2021-05-19 16:25:02 +09:00
Yu Watanabe
3a1dfdb43f network: drop unnecessary call of manager_rtnl_process_address()
The reply should be NLMSG_DONE or NLMSG_ERROR.
Moreover, calling the function for reply of address label configuration
is completely wrong.
2021-05-19 16:17:23 +09:00
Yu Watanabe
f4cc13646f network: drop unused "callback" arguments in route_remove() and address_remove() 2021-05-19 10:38:57 +09:00
Yu Watanabe
50b7477064 network: dhcp4: re-request DHCP4 address and routes immediately
It is not necessary to wait for removal is finished, as network queue
already do the same thing.
2021-05-19 10:38:57 +09:00
Alvin Šipraga
7e59cfe951 man: describe overall online status in networkctl(1) 2021-05-19 10:34:06 +09:00
Alvin Šipraga
1940b3a7cd networkd-test: support online state in networkctl status output
networkctl status now outputs an online state. Fix up the tests to
account for this.
2021-05-19 10:34:06 +09:00
Alvin Šipraga
4a481ec4ae network: show online state in networkctl status output
In case the link online state is invalid, networkctl will print
"unknown", which is sufficiently neutral. The same goes for the overall
manager online state if there are no managed links, or if
RequiredForOnline=no for all managed links.

Example output:

  $ networkctl status
  ●        State: routable
    Online state: partial
         Address: 172.22.0.130 on wlan0
  ...

  $ networkctl status wlan0
  ● 3: wlan0
               Link File: /lib/systemd/network/99-default.link
            Network File: /etc/systemd/network/50-wlan0.network
                    Type: wlan
                   State: routable (configured)
            Online state: online
  ...
2021-05-19 10:34:06 +09:00
Alvin Šipraga
553022c4af man: clarify RequiredFamilyForOnline= behaviour for online state
With new "online state" semantics in networkd, make the description of
RequiredFamilyForOnline= a little more broad. Some rewording has been
done to make the passage easier to understand.
2021-05-19 10:34:06 +09:00
Alvin Šipraga
6c95e09388 man: clarify RequiredForOnline= behaviour for online state
With new "online state" semantics in networkd, make the description of
RequiredForOnline= a little more broad.
2021-05-19 10:34:06 +09:00
Alvin Šipraga
84a257ab65 network: use the overall online state in network_is_online()
Since networkd advertises a reliable online state, use it in
network_is_online(). If for some reason networkd does not know the
online state (e.g. it does not manage any of the network interfaces),
fall back to the original best-guess logic.
2021-05-19 10:34:06 +09:00
Alvin Šipraga
bcdcc59648 network: add an online state for links and manager
Add a new state of type LinkOnlineState which indicates whether a link
is online or not. The state is also used by networkd's manager to expose
the overall online state of the system.

The possible states are:

  offline  the link (or system) is offline
  partial  at least one required link is online (see below)
  online   all required links are online

For links, a link is defined to be "online" if:
  - it is managed; and
  - its operational state is within the range defined by
    RequiredForOnline=; and
  - it has an IPv4 address if RequiredFamilyForOnline=ipv4 or =both; and
  - it has an IPv6 address if RequiredFamilyForOnline=ipv6 or =both.

A link is defined to be "offline" if:
  - it is managed; and
  - it is not online, i.e. its operational state is not within the range
    defined by RequiredForOnline=, and/or it is missing an IP address in
    a required address family.

Otherwise, the link online state is undefined (represented internally as
_LINK_ONLINE_STATUS_INVALID or -EINVAL). Put another way, networkd will
only offer a meaningful online state for managed links where
RequiredForOnline=yes.

For the manager, the online state is a function of the online state of
all links which are requried for online, i.e. RequiredForOnline=yes. If
all required links are online, then the manager online state is defined
to be "online". If at least one of the required links is online, then
the manager online state is defined to be "partial". If none of
the required links are online, then the manager online state is defined
to be "offline". If there are no managed links, or RequiredForOnline=no
for all managed links, then the manager online state is undefined as
above.

The purpose of the "partial" state is analogous to the --any switch in
systemd-networkd-wait-online.service(8). For example, a required link
which lacks a carrier on boot will not force the overall (manager)
online state to "offline" if there is an alternative link available.
2021-05-19 10:33:55 +09:00
Yu Watanabe
e7901aba14
Merge pull request #19611 from yuwata/network-dhcp-server-introduce-server-address
network: dhcp-server: introduce ServerAddress= setting
2021-05-19 10:29:43 +09:00
Yu Watanabe
734b3115d6
Merge pull request #19631 from yuwata/network-fix-reference-counting-issues
network: fix reference counting issues
2021-05-19 10:29:16 +09:00
Yu Watanabe
6b87254ad1
Merge pull request #19630 from keszybz/jinja2
Use jinja2 for templating
2021-05-19 10:27:21 +09:00
Zbigniew Jędrzejewski-Szmek
89f52a780e docs/HACKING: add note about template engines 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
17a2017f69 meson: add workaround for old meson
Recent meson versions include the directory name in the target name,
so there is no conflict for files with the same name in different
directories. But at least with meson-0.49.2 in buster we have conflict
with sysusers.d/systemd.conf.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
392ed18542 ci: drop py2 lxml, pull in jinja2 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
71ae5ce544 units: generate ReadWritePaths= in the template 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
491bf10c80 meson: sort conf paths alphabetically
The order was a complete mess. Let's make it a bit more tidy.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
23b8071d47 man: use readable names for entities
Let's use the same names as in the jinja2 substitutions.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
fd3a3e31b3 meson: drop "_YES_NO" variables
We can generate the right string in the template directly.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
46c4f8dc8a meson: use jinja2 also for custom-entities.ent
This doesn't matter too much, but makes things a bit more consistent.
A minor advantage is that the file is not a configuration file for meson
anymore, so:
 a) It is not built unless pulled in by another target. Since
    we don't usually build man pages by default, this saves a tiny
    amount of work.
 b) When the .in file is updated, meson does not reconfigure everything,
    but just rebuilds the dependent targets.

Now that the conversion is finished, time for benchmarking:
a full build with default settings (and -Dstandalonebinaries=true), yields

before this pull request: 1687 targets, 148.13s user 35.17s system 317% cpu 57.697 total
with the full pull request: 1714 targets, 143.07s user 27.87s system 314% cpu 54.369 total

The difference doesn't seem significant. Partial rebuilds might be faster as
mentioned before.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
b1ac8498ac meson: drop "substs"
We had two big 'configuration_data' objects in meson config. (There are in fact
more. On is added in this series, and there's one for efi… But those others
have a handful variables only for specific purposes and don't matter). The two
sets are 'conf' and 'substs', and were inherited from the original autotools
system. In the past there was even a third set ('m4_defines'), but @yuwata
removed it in 348b44372f36010d48d9a7dda14ef67155753a71. And those two/three
systems had very similar data, but with different variable names, because of
historical reasons. They also used subtly different quoting (.set()
vs. .set10() vs. .set_quoted()), which was required because the templating
engines were not flexible enough. This meants we had more work when changing
things, and we needed to search for different variable names, etc.

With a more flexible templating engine we can do with just one
configuration_data object.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
5908656c57 meson: use jinja2 in shell-completion/ 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
8f127e161e efi: use meson object directly instead of going through 'substs' 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
8e6c71bc19 meson: use jinja2 in src/journal-remote
One stanza had "if install_sysconfdir_samples", while the other
"if install_sysconfdir", which looks like a mistake.
install_sysconfdir_samples is now used for both.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
d34593570a meson: use jinja2 in src/libsystemd/ 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
e11a25cadb meson: use jinja2 for various files in src/core/ 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
ba29ee4cc0 meson: use jinja2 for src/libudev/ 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
411d1f4c3a meson: use jinja2 for src/resolve/ 2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
835cf75aef meson: use jinja2 for rpm templates
The naming of variables is very inconsistent. I tried to use more
modern style naming (UNDERSCORED_TITLE_CASE), but I didn't change existing
names too much. Only SYSTEM_DATA_UNIT_PATH is renamed to SYSTEM_DATA_UNIT_DIR
to match SYSTEM_CONFIG_UNIT_DIR.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
d0f8006993 rpm: use %_bindir not @bindir@
We were using both in various places. To keep things simple, let
rpm do the substitution.
2021-05-19 10:25:26 +09:00
Zbigniew Jędrzejewski-Szmek
54e6c7624f meson: use jinja2 in src/timesync/ 2021-05-19 10:25:12 +09:00
Zbigniew Jędrzejewski-Szmek
94e41ec098 meson: use jinja2 in src/udev 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
1d587e04b9 meson: use jinja2 in src/vconsole 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
2ad498fec0 meson: use jinja2 in sysctl.d/ 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
097c072d83 meson: use conf configuration_data object to generate test-sysusers.sh
I wanted to use jinja2 templating here too, but it's hard to get right:
custom_target() strips the executable bit by default (unlike configure_file
apparently). custom_target() has install_mode setting, but it was only added
in meson-0.47, so it can't be used while we support 0.46. And without the
executable bit the test is not invoked properly. For example, "root-unittests"
in the debian package calls test-* after installation, so the executable bit
there is necessary. It would be possible to adjust the file mode after the
fact, but it would make things more complicated.

So let's use the native meson substitutions here. We don't need anything more
fancy.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
8feaea5e3d meson: use jinja2 for rules.d templates 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
195a8a9327 meson: use custom configuration_data() object for man/man and man/html helpers
I want to stop using 'substs'. But in this case, configure_file() is nicer
than custom_target(), because it causes meson to immediately generate the
helpers after configuration, so it's possible to do
'meson build && build/man/man ...', without building anything first.

We only substitute one variable here, so let's use a custom configuration_data()
object.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
44ff8df777 Drop dependency on m4
m4 was hugely popular in the past, because autotools, automake, flex, bison and
many other things used it. But nowadays it much less popular, and might not even
be installed in the buildroot. (m4 is small, so it doesn't make a big difference.)

(FWIW, Fedora dropped make from the buildroot now,
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot. I think it's
reasonable to assume that m4 will be dropped at some point too.)

The main reason to drop m4 is that the syntax is not very nice, and we should
minimize the number of different syntaxes that we use. We still have two
(configure_file() with @FOO@ and jinja2 templates with {{foo}} and the
pythonesque conditional expressions), but at least we don't need m4 (with
m4_dnl and `quotes').
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
02fa218b24 meson: use jinja2 for README 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
997f52a5d1 meson: use jinja2 for the gperf template
Jinja2 inserts an empty line after the first macro body, which I don't know how
to get rid of. Only the first macro causes problems: the other ones don't have
conditional statements at the end and the issue does not occur. As a work-around
I moved ProtectHostname to the end of the first macro.

Output is identical, except for horizontal whitespace and change in position of
ProtectHostname.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
c900d89faa meson: use jinja2 for src/login
{% raw %} is needed to avoid trouble with {%k, which jinja thinks
is trying to access variable 'k'.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
d924a938fe meson: use jinja2 for tmpfiles.d templates
HAVE_SMACK_RUN_LABEL was dropped back in 348b44372f36010d48d9a7dda14ef67155753a71,
so one line in etc.conf was not rendered as expected ;(
Checking if names are defined is paying for itself!
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
645b2b190c meson: drop unnecessary listification 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
fa10451686 units: strip out the developer comment in .service unit again
The comment talks about upstream development steps and doesn't make
sense for users. We used special '## ' syntax to strip it out during
build, but it got inadvertently reformatted as a normal comment
in 3982becc92197b920d86f03c3c52ae085e26ca60.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
059cc610b7 meson: use jinja2 for unit templates
We don't need two (and half) templating systems anymore, yay!

I'm keeping the changes minimal, to make the diff manageable. Some enhancements
due to a better templating system might be possible in the future.

For handling of '## ' — see the next commit.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
6b1aac3ccf meson: replace some m4 templates with jinja2
m4 was nice in '85, but the syntax feels a bit dated. Since we use python for
meson, let's use a popular python templating engine to replace some m4 usage.

A little nicety is that typos are caught:

FAILED: sysusers.d/systemd-remote.conf
/usr/bin/meson --internal exe --capture sysusers.d/systemd-remote.conf -- /home/zbyszek/src/systemd/tools/meson-render-jinja2.py config.h ../sysusers.d/systemd-remote.conf.j2
Traceback (most recent call last):
  File "/home/zbyszek/src/systemd/tools/meson-render-jinja2.py", line 28, in <module>
    print(render(sys.argv[2], defines))
  File "/home/zbyszek/src/systemd/tools/meson-render-jinja2.py", line 24, in render
    return template.render(defines)
  File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 8, in top-level template code
jinja2.exceptions.UndefinedError: 'HAVE_MICROHTTP' is undefined

This checking mirrors what 349cc4a507c4d84fcadf61f42159ea6412717896 did for C defines.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
e0698c66f4 meson, mkosi: pull in jinja2 as required
In preparation for subsequent changes.
2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
be21b60b89 modules-load: inline interator variable 2021-05-19 10:24:43 +09:00
Zbigniew Jędrzejewski-Szmek
6b908313ef test/run-unit-tests: make script compatible with python3.6
dataclasses were added in python3.7, but bionic has python3.6.
Yes, the new code is a travesty, but it does the job.

Fixes #19640.
2021-05-18 23:59:05 +02:00
Yu Watanabe
cc2d7efc5c network: fix Link reference counter issue
Previously, when link_new() fails, `link_unref()` was called, so,
`Manager::links` may become dirty.
This introduces `link_drop_or_unref()` and it will be called on
failure.
2021-05-18 20:40:56 +09:00
Yu Watanabe
56001f0233 network: also drop requests when link enters linger state
Otherwise, if link is removed, several references to the link in remain
exist in requests.
2021-05-18 20:40:56 +09:00
Yu Watanabe
63130eb36d network: merge link_drop() and link_detach_from_manager()
link_detach_from_manager() is only called by link_drop(). It is not
necessary to split such tiny function.
2021-05-18 20:40:56 +09:00
Yu Watanabe
ce9388d72a network: fix possible message counter double decrement
When after_configure() for a request fails, then the request is not
removed from the queue at that time, and the link enters to failed
state. After that, if the link is reconfigured or its carrier is lost,
then the request is dropped from the queue, and the message_counter is
decreased. However, the counter is already or will be also decreased
when the corresponding netlink reply is received.
So, the counter is decreased twice.
2021-05-18 20:40:50 +09:00
Yu Watanabe
72ffb9133d test-network: add testcases for ServerAddress= 2021-05-18 20:20:24 +09:00
Yu Watanabe
0017ba3165 network: dhcp-server: introduce ServerAddress= setting
This may be useful when the link which DHCP server running on has
multiple static addresses.
2021-05-18 20:20:24 +09:00
Yu Watanabe
998545a7d9 network: address: introduce link_get_ipv4/ipv6_address() 2021-05-18 20:20:24 +09:00
Yu Watanabe
99b5f4f7b8 network: use UINT32_C() macro 2021-05-18 20:20:24 +09:00
Yu Watanabe
473680be32 network: introduce address_set_broadcast() 2021-05-18 20:20:20 +09:00
Yu Watanabe
c9f2db2c40 network: use config_parse_in_addr_non_null() 2021-05-18 20:19:37 +09:00
Yu Watanabe
cf0747725d conf-parser: introduce config_parse_in_addr_non_null() 2021-05-18 20:19:37 +09:00
Anita Zhang
c54cfef396 man: only the system manager does not pass vars in ManagerEnvironment=
User managers always pass their environment on to their children.
Make that clear in the description of ManagerEnvironment= which
states that none of those args will get passed to child processes of
service managers.
2021-05-18 12:59:10 +02:00
Jörg Thalheim
f96bc66901 fix bash shebangs 2021-05-17 22:27:41 +01:00
Olle Lundberg
c920b86364 nspawn: bring back the word may in error text
In the change set 6c045a999800c62368470938307951bb669f5afc the error
text for the old flag `--private-users-chown` was repurposed for the
new flag `--private-users-ownership=own` and while doing so the word
`may` was dropped leading to a grammatically incorrect error text.
2021-05-17 22:21:00 +01:00
Balint Reczey
39f1bdecc2 test: Allow running only a subset of integration tests by setting SELECTED_TESTS 2021-05-17 14:16:09 +01:00
Zbigniew Jędrzejewski-Szmek
9578b472f4 mkosi: stop pulling in workaround packages
libfido2 was pulled in recently [1], and the dependency on libzstd has been
present for a long time.

nano is now the default editor in Fedora [2], but we still want to pull it in
to have an editor in minimal images.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1949505
[2] https://fedoraproject.org/wiki/Changes/UseNanoByDefault
2021-05-17 11:14:03 +01:00
Frantisek Sumsal
35a48d4b9a ci: build with gcc-11 as well
Focal builds for gcc-11 are finally available, so let's put them into
some use.
2021-05-16 21:28:04 +01:00
ei-ke
410477a78f Fixed a typo 2021-05-16 18:28:58 +02:00
Milan
21dfadbde0 docs: Update link to journal file format codebase 2021-05-16 16:51:18 +01:00
Milan
882da5cca7 docs: Update link to journal-def.h 2021-05-16 16:51:18 +01:00
tramsay
7b5018ca9e network:dhcp4_server_configure returns if not able to get timezone
When /etc/localtime is a symbolic link pointing to another symbolic
link, get_timezone will return -EINVAL instead of the timezone.
This issue can cause systemd-networkd DHCPServer to fail.

Instead of returning failure, log a warning indicating that that
the timezone will not be sent.

	modified:   networkd-dhcp-server.c
2021-05-15 18:14:49 +02:00
Sebastian Blunt
1fa94a3124 Add crypttab option silent
Adds a crypttab option 'silent' that enables the AskPasswordFlag
ASK_PASSWORD_SILENT. This allows usage of systemd-cryptsetup to default
to silent mode, rather than requiring the user to press tab every time.
2021-05-15 16:23:56 +02:00
Dan Streetman
d57e871c60 test: combine stdout/stderr from failed test
Printing stdout and stderr from a failed test makes it harder to
interpret what the specific problem was; instead let's print out
the lines in order as we got them when the test was run

Also save failed test output to file if ARTIFACT_DIRECTORY is defined
2021-05-15 11:49:24 +01:00
Zbigniew Jędrzejewski-Szmek
f1e696221f
Merge pull request #19612 from keszybz/meson-0.58-quieting
Make meson output quiet again
2021-05-15 10:49:10 +02:00
Zbigniew Jędrzejewski-Szmek
c856ef0457 resolved: fix braino with reference counting and linked lists
In 0e0fd08fc832b8f42e567d722d388eba086da5ff I added reference counts to keep
track of the DnsQueryCandidate objects. Unfortunately, dns_query_unref_candidates()
was written as

     while (q->candidates)
           dns_query_candidate_unref(q->candidates);

i.e. it would keep dropping the reference count as many times as needed for it
to hit 0, making the patch less than fully effective.

dns_query_unref_candidates() is renamed to dns_query_detach_candidates() and
changed to drop exactly one reference from each of the linked candidates.

Example failure:
==463== Invalid read of size 8
==463==    at 0x419C93: dns_query_candidate_go (resolved-dns-query.c:159)
==463==    by 0x41A143: dns_query_candidate_notify (resolved-dns-query.c:304)
==463==    by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463==    by 0x436A0F: dns_transaction_process_dnssec (resolved-dns-transaction.c:976)
==463==    by 0x4378C1: dns_transaction_process_reply (resolved-dns-transaction.c:1387)
==463==    by 0x437CE9: on_dns_packet (resolved-dns-transaction.c:1444)
==463==    by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463==    by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463==    by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463==    by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463==    by 0x464A24: run (resolved.c:92)
==463==    by 0x464B3C: main (resolved.c:99)
==463==  Address 0x5f409d0 is 32 bytes inside a block of size 72 free'd
==463==    at 0x48410E4: free (vg_replace_malloc.c:755)
==463==    by 0x418EDF: mfree (alloc-util.h:48)
==463==    by 0x4197E8: dns_query_candidate_free (resolved-dns-query.c:67)
==463==    by 0x4198B7: dns_query_candidate_unref (resolved-dns-query.c:70)
==463==    by 0x41A2E3: dns_query_unref_candidates (resolved-dns-query.c:337)
==463==    by 0x41C5FE: dns_query_cname_redirect (resolved-dns-query.c:1028)
==463==    by 0x41CA04: dns_query_process_cname_one (resolved-dns-query.c:1128)
==463==    by 0x41CA80: dns_query_process_cname_many (resolved-dns-query.c:1157)
==463==    by 0x40C0BD: bus_method_resolve_hostname_complete (resolved-bus.c:198)
==463==    by 0x41B312: dns_query_complete (resolved-dns-query.c:562)
==463==    by 0x41C1AC: dns_query_accept (resolved-dns-query.c:922)
==463==    by 0x41C2C4: dns_query_ready (resolved-dns-query.c:955)
==463==    by 0x41A162: dns_query_candidate_notify (resolved-dns-query.c:314)
==463==    by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463==    by 0x438995: dns_transaction_prepare (resolved-dns-transaction.c:1728)
==463==    by 0x43921D: dns_transaction_go (resolved-dns-transaction.c:1928)
==463==    by 0x419C7C: dns_query_candidate_go (resolved-dns-query.c:163)
==463==    by 0x41A143: dns_query_candidate_notify (resolved-dns-query.c:304)
==463==    by 0x434BD6: dns_transaction_complete (resolved-dns-transaction.c:437)
==463==    by 0x436A0F: dns_transaction_process_dnssec (resolved-dns-transaction.c:976)
==463==    by 0x4378C1: dns_transaction_process_reply (resolved-dns-transaction.c:1387)
==463==    by 0x437CE9: on_dns_packet (resolved-dns-transaction.c:1444)
==463==    by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463==    by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463==    by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463==    by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463==    by 0x464A24: run (resolved.c:92)
==463==    by 0x464B3C: main (resolved.c:99)
==463==  Block was alloc'd at
==463==    at 0x483E86F: malloc (vg_replace_malloc.c:380)
==463==    by 0x418F81: malloc_multiply (alloc-util.h:96)
==463==    by 0x419378: dns_query_candidate_new (resolved-dns-query.c:23)
==463==    by 0x41B42C: dns_query_add_candidate (resolved-dns-query.c:582)
==463==    by 0x41BB7A: dns_query_go (resolved-dns-query.c:762)
==463==    by 0x40CE3A: bus_method_resolve_hostname (resolved-bus.c:464)
==463==    by 0x4A84B86: method_callbacks_run (bus-objects.c:414)
==463==    by 0x4A87961: object_find_and_run (bus-objects.c:1323)
==463==    by 0x4A87FEE: bus_process_object (bus-objects.c:1443)
==463==    by 0x4AA3434: process_message (sd-bus.c:2964)
==463==    by 0x4AA3623: process_running (sd-bus.c:3006)
==463==    by 0x4AA4110: bus_process_internal (sd-bus.c:3226)
==463==    by 0x4AA41EF: sd_bus_process (sd-bus.c:3253)
==463==    by 0x4AA5343: io_callback (sd-bus.c:3604)
==463==    by 0x4B2DC9B: source_dispatch (sd-event.c:3512)
==463==    by 0x4B2FB1F: sd_event_dispatch (sd-event.c:4077)
==463==    by 0x4B2FFFA: sd_event_run (sd-event.c:4138)
==463==    by 0x4B301D6: sd_event_loop (sd-event.c:4159)
==463==    by 0x464A24: run (resolved.c:92)
==463==    by 0x464B3C: main (resolved.c:99)

Fixes #19376.
2021-05-14 23:18:10 +01:00
Zbigniew Jędrzejewski-Szmek
b8f1045fe7 Revert "tools/make-directive-index: parallelize"
This reverts commit a2031de849da52aa85b7e4326c0112ed7e5b5672.

The patch itself seems OK, but it exposes a bug in lxml or libxml2-2.9.12 which
was just released. This is being resolved in
https://gitlab.gnome.org/GNOME/libxml2/-/issues/255, but it might be while. So
let's revert this for now to unbreak our CI.

Fixes #19601.
2021-05-14 23:16:24 +01:00
Zbigniew Jędrzejewski-Szmek
7c22f07cbd meson: revert the change to unquote commands in add_install_script
Old meson fails with:
Element not a string: [<Holder: <ExternalProgram 'sh' -> ['/bin/sh']>>, '-c', 'test -n "$DESTDIR" || /bin/journalctl --update-catalog']

I'm doing it as a revert so that it's easy to undo the revert when we require
newer meson. The effect is not so bad, maybe a dozen or so lines about finding
'sh'.
2021-05-14 19:52:25 +02:00
Yu Watanabe
4301cb32f2 fix typo 2021-05-14 19:51:37 +02:00
Zbigniew Jędrzejewski-Szmek
6f1d18ae93 resolved: inline iterator variable declarations 2021-05-14 17:34:38 +02:00
Zbigniew Jędrzejewski-Szmek
ebfdf45a20 resolved: drop pointless bitfield on a lone bool 2021-05-14 17:34:38 +02:00
Zbigniew Jędrzejewski-Szmek
421b1f0a41 resolved: optimize layout of DnsPacket
We obviously have lots of those, so even small savings add up.

Bitfields are dropped because they don't give any memory savings due to
alignment requirements (but would still require more complex to access).

/* size: 184, cachelines: 3, members: 28 */
/* sum members: 172, holes: 1, sum holes: 4 */
/* sum bitfield members: 4 bits (0 bytes) */
/* padding: 7 */
/* bit_padding: 4 bits */
    ↓
/* size: 176, cachelines: 3, members: 28 */
2021-05-14 17:34:38 +02:00
Zbigniew Jędrzejewski-Szmek
9aeb1a541b resolved: optimize layout of DnsTransaction
/* size: 296, cachelines: 5, members: 46 */
/* sum members: 278, holes: 5, sum holes: 17 */
/* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
    ↓
/* size: 280, cachelines: 5, members: 46 */
/* sum members: 278, holes: 1, sum holes: 1 */
/* sum bitfield members: 4 bits, bit holes: 1, sum bit holes: 4 bits */
2021-05-14 17:28:48 +02:00
Zbigniew Jędrzejewski-Szmek
a6e890d493 resolved: rearrange DnsResourceRecord for better layout
The structure is rearranged to have less holes. Also fields in the union
are rearranged not to have holes (though most variants of the union still
have some padding at the end).

The full size does not decrease a lot, but the compiler should be able to
copy less bytes when it knows the specific type of the union.

Bitfields are dropped because they don't give any memory savings due to
alignment requirements (but would still require more complex to access).

The change from the this and previous commit:
/* size: 128, cachelines: 2, members: 13 */
/* sum members: 112, holes: 3, sum holes: 15 */
/* sum bitfield members: 2 bits, bit holes: 1, sum bit holes: 6 bits */
     ↓
/* size: 112, cachelines: 2, members: 13 */
/* sum members: 108, holes: 1, sum holes: 4 */
2021-05-14 17:15:53 +02:00
Zbigniew Jędrzejewski-Szmek
98e80bf9d2 resolved: use narrower types for label counts in rr
Order will be adjusted later to remove holes.
2021-05-14 17:03:30 +02:00
Christian Göttsche
57e70396df selinux: invoke selinux_set_callback(3) more type-safe 2021-05-14 16:53:04 +02:00
Zbigniew Jędrzejewski-Szmek
35aa30697a resolved: shorten dns_name_count_labels() 2021-05-14 16:48:13 +02:00
Zbigniew Jędrzejewski-Szmek
9079bd32ce resolved: pahole optimization for DnsQuery
Change from the last three commits:

/* size: 312, cachelines: 5, members: 46 */
/* sum members: 296, holes: 5, sum holes: 16 */
   ↓
/* size: 288, cachelines: 5, members: 46 */
/* sum members: 286, holes: 1, sum holes: 1 */

It's not a big difference, but we might have quite a few queries in flight,
so let' make this a bit more efficient.
2021-05-14 16:31:16 +02:00
Zbigniew Jędrzejewski-Szmek
b4d1227858 resolved: make counter for redirects smaller
It can never go above 16, so let's use a narrower type.

Order will be adjusted later to remove holes.
2021-05-14 16:26:52 +02:00
Zbigniew Jędrzejewski-Szmek
e1004d0aba resolved: make counter for n_auxiliary_queries smaller
It can never go above 64, so let's use a narrower type.

Order will be adjusted later to remove holes.
2021-05-14 16:26:26 +02:00
Lennart Poettering
d47f96b4ef
Merge pull request #19609 from keszybz/networkd-dhcp-man
Tweak man page ordering for DHCPv[46] options
2021-05-14 16:26:18 +02:00
Zbigniew Jędrzejewski-Szmek
e3e64a1abd resolved: indent tables for readability
Some of the tables in resolved were already doing using this convention. This
makes the rest of them do so too.
2021-05-14 16:25:54 +02:00
Zbigniew Jędrzejewski-Szmek
f86887af6e meson: print autodetected sbat fields
...
Message: sbat-distro (from ID): fedora
Message: sbat-distro-summary (from NAME): Fedora
Message: sbat-distro-url (from BUG_REPORT_URL): https://bugzilla.redhat.com/
...
2021-05-14 14:37:14 +02:00
Zbigniew Jędrzejewski-Szmek
0f4c4f3824 meson: call find_program() once and reuse the variable everywhere
Meson 0.58 has gotten quite bad with emitting a message every time
a quoted command is used:
Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program sh found: YES (/usr/bin/sh)
Program xsltproc found: YES (/usr/bin/xsltproc)
Configuring custom-entities.ent using configuration
Message: Skipping bootctl.1 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false
Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Message: Skipping loader.conf.5 because ENABLE_EFI is false
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
Program ln found: YES (/usr/bin/ln)
...

Let's suffer one message only for each command. Hopefully we can silence
even this when https://github.com/mesonbuild/meson/issues/8642 is
resolved.
2021-05-14 14:21:27 +02:00
Christian Göttsche
c46c768811 selinux: reload label db on policy load with libselinux 3.2
Currently the label database is not reloaded with libselinux 3.2 on a
policy reload.

Since libselinux 3.2 avc_open(3) uses the SELinux status page instead of
a netlink socket to check for policy reloads.
The status page is also queried in mac_selinux_maybe_reload().
Thus calls to selinux_check_access(3) might consume an update, queried
by selinux_status_updated(3), leaving mac_selinux_maybe_reload() unable
to detect a policy reload.

Do not use selinux_status_updated(3), use selinux_status_policyload(3)
unconditionally.

Relevant libselinux commit: 05bdc03130

Debian Bullseye is going to ship libselinux 3.1, so stay compatible for
backports.
2021-05-14 14:12:39 +02:00
Zbigniew Jędrzejewski-Szmek
6c55cefe2f man: reword descriptions of two DHCPv4 options 2021-05-14 11:48:33 +02:00
Zbigniew Jędrzejewski-Szmek
c3696a9111 man: reorder items in [DHCPv4] and [DHCPv6] sections
The settings were listen in a completely random order, also different
between the v4 and v6 sections. Order by "options sent", "options received",
"communication settings" in both sections.

Also minor formatting changes are done, e.g. "=" is added in various places.
2021-05-14 11:48:33 +02:00
Yu Watanabe
893e3ffe7d network: shorten code a bit and update log message 2021-05-14 09:38:41 +02:00
Zbigniew Jędrzejewski-Szmek
db0a915a2b
Merge pull request #19592 from yuwata/network-introduce-describe-bus-method
network: introduce Describe() bus method and use it in networkctl
2021-05-14 09:34:06 +02:00
Yu Watanabe
f8cd3f610f shell-completion: support --json option for hostnamectl 2021-05-14 09:18:29 +09:00
Yu Watanabe
bfc2b05e59 networkctl: introduce --json option for "status" and "list" commands
When `--json` option is specified, "status" and "list" commands gives
the same information, as originally "list" just gives partial
information of "status" in different format.
2021-05-14 09:18:29 +09:00
Yu Watanabe
fec7a9e0ac json: make JSON_VARIANT_ARRAY/OBJECT_FOREACH() nestable 2021-05-14 09:18:29 +09:00
Yu Watanabe
484f22dd66 networkctl: use table_set_empty_string() 2021-05-14 09:18:29 +09:00
Yu Watanabe
54a16efe18 network: introduce Describe() method for manager and links 2021-05-14 09:18:29 +09:00
Yu Watanabe
1a3caa49d7 udev,network: make link_get_type_string() return negative errno on failure
And make net_match_config() propagate the error.
2021-05-14 09:18:29 +09:00
Yu Watanabe
170e88c8e3 network: move and rename network_get() -> link_get_network()
This also drops test_network_get(). But it tests almost nothing. So, it
should be ok to not re-implement something like test_link_get_network().
2021-05-14 09:18:29 +09:00
Anita Zhang
cbdc294920 run: update checks to allow running with a user's bus
systemd-run is documented to as being able to connect and run on a
specific user bus with "--user --machine=lennart@.host" arguments.
This PR updates some logic that prevented this from working.
2021-05-13 16:49:06 +01:00
Zbigniew Jędrzejewski-Szmek
a2031de849 tools/make-directive-index: parallelize
I occasionally do 'build/man/man systemd.directives' when working on man pages,
and it's annoying slow. By paralellizing the parsing of xml, we can make it a
bit faster.

This is still rather innefficient. Only the parsing part is serialized, xml is
still produced serially at the end, which is hard to avoid.

$ ninja -C build man/systemd.directives.xml
before:
8.20s user 0.21s system 99% cpu 8.460 total
8.33s user 0.18s system 98% cpu 8.619 total
8.72s user 0.19s system 98% cpu 9.019 total

after:
13.99s user 0.73s system 345% cpu 4.262 total
14.15s user 0.35s system 348% cpu 4.161 total
14.33s user 0.35s system 339% cpu 4.321 total

I.e. it uses almost twice as much cpu, but cuts the wallclock time down (on a
2-core/4-thread cpu) to about half too, which is an overall win if you're just
trying to render the man page.

The change from list and .append() to set and .add() is something that could
have been done before too, but it's noticable now. It cuts down on the
serialization/deserialization time (about .2s).
2021-05-13 11:53:01 +02:00
Simon Watts
31b5be17e0 Add Microsoft Pro Intellimouse MOUSE_DPI to hwdb
- Internet specifications give 1600 DPI @ 1000Hz for this sensor
- Confirmed experimentally via `mouse-dpi-tool`
- vid, pid, and name match string from `mouse-dpi-tool`
2021-05-13 11:21:27 +02:00
Seong-ho Cho
6c041ce387
Update Korean translation (#19083)
Co-authored-by: Seong-ho Cho <shcho@gnome.org>
2021-05-13 10:19:48 +02:00
Yu Watanabe
7df7ba457c
Merge pull request #19590 from keszybz/comments-and-service-modernization
Comments and service modernization
2021-05-13 12:17:19 +09:00
Zbigniew Jędrzejewski-Szmek
c799d93cfa
Merge pull request #19567 from poettering/ipv4-ipv6-lowercase
various follow-ups to socket-bind logic
2021-05-12 12:21:58 +02:00
Michael Catanzaro
aa2b370ddd resolved.conf.in: add missing Quad9 servers
The example configuration is missing half of Quad9's addresses.
2021-05-12 12:17:39 +02:00
Lennart Poettering
5a0d0b8f9c resolved: be more careful with weird links with low MTUs
Apparently CAN links will show up in rtnetlink with very low MTUs. We
shouldn't consider them relevant if no IP is spoken over them, since
these MTUs are irrelevant for us then.

Hence, let's check if there's an address assigned to the link before
considering its MTU.

As additional safety net filter out MTUs smaller than the minimum DNS
packet size, too.

Finally, in case we don't find any suitable interface MTU, let's default
to 1500 as the generic Ethernet MTU.

Fixes: #19396
2021-05-12 12:15:56 +02:00
Lennart Poettering
971c07fc68 pam: fix typo try_authtok → use_authtok
This was a copy/paste mistae apparently, there's not "try_authtok" and
this was supposed to copy what Fedora uses, which uses "use_authtok"
correctly. Hence adjust this.

Fixes: #19369
2021-05-12 12:14:17 +02:00
Zbigniew Jędrzejewski-Szmek
7a7e58ce44
Merge pull request #19533 from yuwata/network-queue
network: introduce queue to configure address, route, etc
2021-05-12 12:12:22 +02:00
Zbigniew Jędrzejewski-Szmek
e78695d44b core/service: modernization 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek
6f350e05c1 test-bpf-foreign-programs: fix message 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek
75e0990874 docs/HACKING: wrap long lines 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek
de02634c73 sd-event: tweak comments 2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek
8f0ea0efd9 timedated: make ntp_synced() static
No need to have this in basic.
2021-05-12 12:05:21 +02:00
Zbigniew Jędrzejewski-Szmek
8f7123731d
Merge pull request #18986 from poettering/oomd-varlink-fix
varlink ref fix
2021-05-12 11:36:32 +02:00
Zbigniew Jędrzejewski-Szmek
01d0123f04
Merge pull request #19506 from xnox/ship-stub-elf
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
2021-05-12 09:45:36 +02:00
Lennart Poettering
dc90ad6825
Merge pull request #19581 from yuwata/specifier-refuse-too-long-results
specifier: refuse too long results
2021-05-12 09:42:08 +02:00
Lennart Poettering
041ea9f9bb netlink,network: drop "const" from opaque object parameters in supposed-to-be-public APIs
This drops the "const" specifier from the opaque object parameters to
various functions in our API.

This effectively reverts #19292 and more.

Why drop this? Our public APIs should not leak too much information
about how stuff is implemented internally. In our public APIs we
shouldn't give too many guarantees we don#t want to necessarily keep.
Specifically: in many cases it makes sense that getters actually
generate/parse/allocate data on the fly, storing/caching the result
internally, to speed things up, do things lazily or to track memory
allocations so that they can be freed later. Doing this means we need to
change the objects, even though the getters are semantically a read
operation.

We want to retain the freedom that we can change things around
internally. By exposing the objects as "const" we remove a good chunk of
that, for little gain.

See sd_bus_creds_get_description() for a real example of a getter that
implicitly caches and thus modifies the relevant object.

This removes the "const" decorators from sd-dhcp and sd-netlink, two
APIs that we intend to make public eventually even though they still are
not, leaving us the chance to still fix this before it becomes set in
stone.
2021-05-12 16:19:58 +09:00
Yu Watanabe
932e157b5e test-network: wait for the interfaces are configured after reloading .network files 2021-05-12 11:26:06 +09:00
Yu Watanabe
1ef2eedce7 test-network: wait for the intreface is configured if it is expected 2021-05-12 11:26:06 +09:00
Yu Watanabe
5cb76467af network: make route_configure() return all created routes 2021-05-12 11:26:06 +09:00
Yu Watanabe
b19afdfef8 network: make log_route_debug() show multipath routes and Gateway=_dhcp4 or _ipv6ra 2021-05-12 11:26:06 +09:00
Yu Watanabe
76c5a0f27b network: use request queue to configure addresses, routes, and nexthops
Why is this necessary? Several examples below.

- When a route sets prefsrc, then the address must be already assigned
  (see issue #19285), and also it must be ready if IPv6.
- When a route or nexthop sets gateway, then the address must be reachable.
- When a route sets nexthop ID, then the corresponding nexthop must be
  assigned.
- When a route sets multipath routes on another interface, then the
  interface must exist and be ready to configure.
- When configuring address, the same address must not be under removing
  (see issue #18108).
Etc,. etc,...

So, this makes all requests about addresses, routes, and nethops are once
stored in the queue, and will be processed when they are ready to configure.

Fixes #18108 and #19285.
2021-05-12 11:26:06 +09:00
Yu Watanabe
40ca350ea1 network: use request queue to configure neighbors 2021-05-12 11:26:06 +09:00
Yu Watanabe
0e5ef6beb6 network: use request queue to configure routing policy rules 2021-05-12 11:26:06 +09:00
Yu Watanabe
7191a57a0e network: introduce link_is_ready_to_configure() helper function
This will be used in later commits.
2021-05-12 11:26:06 +09:00
Yu Watanabe
19d9a5adf0 network: add skeleton of request queue
This will be used in later commits.
2021-05-12 11:26:06 +09:00
Yu Watanabe
17060f02cc network: nexthop: add NextHop object before sending netlink request
Otherwise, if nexthop_add() fails, then assertion about nexthop_messages in
static_nexthop_handler() will be triggered.
2021-05-12 11:26:06 +09:00
Yu Watanabe
5a07fa9dd1 network: split out common part of route or address handlers 2021-05-12 11:26:06 +09:00
Yu Watanabe
e36d601c5e network: change order of dropping network configs
As routes may requires nexthops and addresses, nexthops may requires
addresses.
2021-05-12 11:26:06 +09:00
Yu Watanabe
e80509a904 network: simplify and rename routing_policy_rule_copy() 2021-05-12 11:25:55 +09:00
Yu Watanabe
c0bd9eb1ed network: introduce route_dup()
The function will be used in later commits.
2021-05-12 11:22:24 +09:00
Yu Watanabe
4867b9d711 sd-netlink: introduce multipath_route_dup()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe
d94e8ba021 network: introduce manager_address_is_reachable()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe
884a63d76e network: introduce link_has_route()
The function will be used in later commits.
2021-05-12 10:39:12 +09:00
Yu Watanabe
e8f52f3c19 network: delay resolving interface specifier in MultiPathRoute=
The interface may not exist when .network files are loaded.
2021-05-12 10:37:17 +09:00
Yu Watanabe
591bd5f35d network: introduce manager_has_address()
The function will be used in later commits.
2021-05-12 10:30:45 +09:00
Yu Watanabe
d38a6476aa ordered-set: introduce ordered_set_clear/free_with_destructor() 2021-05-12 10:30:45 +09:00
Yu Watanabe
38c116df7f hashmap,set: make hashmap_clear_with_destructor() or friends safer 2021-05-12 10:30:45 +09:00
Yu Watanabe
b8ce3b4490 network: use IPV4_ADDRESS_FMT_STR/VAL macros and in6_addr_to_string() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe
280323984b in-addr-util: move IPV4_ADDRESS_FMT_STR/VAL macros from networkd-address.h 2021-05-12 10:30:45 +09:00
Yu Watanabe
ae7b68db97 in-addr-util: introduce in6_addr_to_string() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe
5c97932f09 network: use in6_addr_is_link_local() or friends 2021-05-12 10:30:45 +09:00
Yu Watanabe
7ad3e90932 network: rename routing_policy_rule_configure_internal() and make it take callback 2021-05-12 10:30:45 +09:00
Yu Watanabe
3eacccf493 network: make nexthop_configure() take callback 2021-05-12 10:30:45 +09:00
Yu Watanabe
7575e1f42d network: make neighbor_configure() take callback 2021-05-12 10:30:45 +09:00
Yu Watanabe
0653649202 tree-wide: refuse too long strings earlier in specifier_printf()
We usually call specifier_printf() and then check the validity of
the result. In many cases, validity checkers, e.g. path_is_valid(),
refuse too long strings. This makes specifier_printf() refuse such
long results earlier.

Moreover, unit_full_string() and description field in sysuser now
refuse results longer than LONG_LINE_MAX. config_parse() already
refuses the line longer than LONG_LINE_MAX. Hence, it should be ok
to set the same value as the maximum length of the resolved string.
2021-05-12 10:26:07 +09:00
Yu Watanabe
678d6b4f92 dns-domain: use DNS_LABEL_MAX at one more place 2021-05-12 10:21:22 +09:00
Yu Watanabe
3d862ff066 creds-util: introduce CREDENTIAL_NAME_MAX 2021-05-12 10:20:47 +09:00
Yu Watanabe
ae3f4bae68 fd-util: introduce FDNAME_MAX 2021-05-12 10:19:19 +09:00
Yu Watanabe
6001df6594 gpt: introduce GPT_LAVEL_MAX 2021-05-12 10:16:36 +09:00
Yu Watanabe
f4767dc081 test: move test_specifier_printf() to test-specifier.c 2021-05-12 10:09:11 +09:00
Yu Watanabe
695c5fee6d specifier: rename variable 2021-05-12 10:09:11 +09:00
Yu Watanabe
567097848c specifier: use SD_ID128_STRING_MAX 2021-05-12 10:09:11 +09:00
Lennart Poettering
d65e974e67 core: don't accidentally unref a varlink connection twice
Let's make sure that our close handler unrefs a connection again that we
are already unreffing a few stack frames up by invalidating the pointer
first, and dropping the ref counter only after that.

Replaces: 39ad3f1c092b5dffcbb4b1d12eb9ca407f010a3c

Fixes: #18025
2021-05-11 21:45:32 +02:00
Lennart Poettering
cc6b0a18ff Revert "varlink: avoid using dangling ref in varlink_close_unref()"
This reverts commit 39ad3f1c092b5dffcbb4b1d12eb9ca407f010a3c.
2021-05-11 21:45:32 +02:00
Lennart Poettering
11ab01e439 cgroup: drop explicit NULL comparisons 2021-05-11 15:42:47 +02:00
Lennart Poettering
a67abc490b tree-wide: move variables to innermost scope 2021-05-11 15:42:46 +02:00
Lennart Poettering
a481753648 tree-wide: use af_to_ipv4_ipv6() + af_from_ipv4_ipv6() helpers at various places 2021-05-11 15:42:11 +02:00
Lennart Poettering
23118193d2 af-list: add helpers mapping AF_INET/AF_INET6 to "ipv4"/"ipv6" 2021-05-11 15:37:31 +02:00
Lennart Poettering
f80a206aa4 socket-bind: use lowercase "ipv4"/"ipv6" spelling
In most of our codebase when we referenced "ipv4" and "ipv6" on the
right-hand-side of an assignment, we lowercases it (on the
left-hand-side we used CamelCase, and thus "IPv4" and "IPv6"). In
particular all across the networkd codebase the various "per-protocol
booleans" use the lower-case spelling. Hence, let's use lower-case for
SocketBindAllow=/SocketBindDeny= too, just make sure things feel like
they belong together better.

(This work is not included in any released version, hence let's fix this
now, before any fixes in this area would be API breakage)

Follow-up for #17655
2021-05-11 15:37:31 +02:00
zsien
5c2e595767 bootctl: same entry path check case-insensitive
Some motherboards convert the path to uppercase under certain circumstances
(e.g. after booting into the Boot Menu in the ASUS ROG STRIX B350-F GAMING).
2021-05-11 14:27:44 +02:00
howl
fd37987da5 hwdb: keyboard: D330 Touchpad toggle keymap
I have also seen that VIOS LTH17 has the exact same correction and it's also a SIPODEV composite hid device also through usb. In the D330 is a detachable keyboard. It's possible that a very generic way to apply this to at least affected sipodev keyboard could be found using the device ids, but needs info to do that and ensure all sipodev keyboard with the pertinent ids need it.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
2021-05-11 08:54:04 +02:00
howl
44cf2e6022 hwdb: sensor: D330-IGM use pvr instead cvr
We use pvr match for efifb pitch and drm orientation quirk and in touchpad toggle keymap. Also seems most consistent with the devices here.

While at it, correct a typo, 81H3 and 81MD are product names not numbers, my bad.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
2021-05-11 08:53:21 +02:00
Yu Watanabe
690ceca8dc
Merge pull request #19562 from keszybz/flag-manips
Fix flag manipulations in cryptsetup
2021-05-11 14:34:07 +09:00
Lennart Poettering
c37f7963b1 unit-def: ensure UnitType enum fits any errno value
This is a follow-up for #19514 which changed unit_name_to_instance() to
return ENOMEM as a UnitType enum, even though the enum didn't
necessarily have range for that.

Let's extend the range explicitly, so that we can cover the full errno
range in it.
2021-05-11 14:33:11 +09:00
Lennart Poettering
7eea910d24 bootctl: extend --make-machine-id-directory= documentation a bit
The directory might not be created in the ESP but in the extended boot
loader partition, hence don#t claim otherwise.

Also, give a brief reason why the concept exists at all.

Link up machine-id man page.

Follow-up for: 6a3fff75baad94d9ebff1a6c7d1fb35448c44a81
2021-05-11 14:32:42 +09:00
Lennart Poettering
51b274d881 test-user-util: fix line break confusion
This fixes some line-break confusion introduced by #11199
(c6cecb744b53561efd329309af7d02a3f9979ed1). It also restores a test with
GID_INVALID that was dropped, presumably by accident.
2021-05-11 14:32:24 +09:00
Yu Watanabe
b35028ebaa
Merge pull request #19575 from poettering/hwdb-whitespace-fix-again
hwdb: remove trailing whitespace
2021-05-11 14:31:35 +09:00
Lennart Poettering
9854ac4af4 man: remove some trailing whitespace 2021-05-10 23:10:44 +02:00
Lennart Poettering
23a2badf74 hwdb: remove trailing whitespace 2021-05-10 23:03:52 +02:00
gitm0
cbec0bfa5d
hwdb: add accel matrix for One-netbook OneMix 3s (#19549) 2021-05-10 22:20:58 +02:00
Lennart Poettering
aa67e45b4b
Merge pull request #19570 from poettering/userdb-followup-fixlets
two minor userdb fixes
2021-05-10 22:06:32 +02:00
Lennart Poettering
708274eef3
Merge pull request #19568 from poettering/userdbctl-dropin
userdbctl: add new --with-varlink= and --with-drop-in= flags
2021-05-10 22:06:07 +02:00
Zbigniew Jędrzejewski-Szmek
031e7e3241 test-efi-create-disk: support /boot/efi
Most of our tools allow EFI mount to be on /boot/efi. Do the same here.
2021-05-10 20:35:31 +02:00
Zbigniew Jędrzejewski-Szmek
bdf5d8d4c0 test-efi-create-disk: shellcheckify 2021-05-10 20:34:08 +02:00
Zbigniew Jędrzejewski-Szmek
4f3dca78bb meson: rework test-efi-disk.img creation to not require variables
The primary goal is to make the name of the custom_target() rule match
the output file again. Having them different is confusing.
2021-05-10 20:28:24 +02:00
Zbigniew Jędrzejewski-Szmek
9d59f5b2f9 cryptsetup: fix flags check
FLAGS_SET() checks if *all* the bits are set. In this case we want to check
if *any* are. FLAGS_SET() was added in cde2f8605e0c3842f9a87785dd758f955f2d04ba,
but not a bug then yet, because with just one bit, both options are equivalent.
But when more bits were added later, this stopped being correct.
2021-05-10 19:53:52 +02:00
Zbigniew Jędrzejewski-Szmek
8205c151b3 cryptsetup: initialize variable
Fixup for cde2f8605e0c3842f9a87785dd758f955f2d04ba. Use PIN+PV because the
status quo ante was that we turned off "uv" and left "up" and "clientPin" in
its default values, which with yubikeys (i.e. the most popular hardware) meant
both "up" and "clientPin" were enabled by default.

Coverity CID#1453085.
2021-05-10 19:52:06 +02:00
Lennart Poettering
40fb3503f4 userdb: initialize .synthesize_root/.synthesize_nobody in generic code
Let's initialize this at the same place for any iterator allocated. (Yes
not all types of iterator objects need this, but it's still nice to
share this trivial code at one place).
2021-05-10 18:11:06 +02:00
Lennart Poettering
58dbf4c925 userdb: return ESRCH if we didn't find a single varlink service
Clearly communicate to callers that we didn't find a single varlink
service, when a lookup is attempted. Note that the fallback's to NSS,
drop-ins and synthesis might eat up this error again, but we should
really make this case reasonably recognizable, in particular as our
various tools already handle this condition correctly and print a nice
message then.
2021-05-10 18:08:38 +02:00
Lennart Poettering
c96a301213 man: document new userdbctl features 2021-05-10 18:02:50 +02:00
Lennart Poettering
59092877b3 userdbctl: add two new switches --with-dropin=/--with-varlink=
These directly correspond to the underlying flags. They are useful for
testing.
2021-05-10 18:02:50 +02:00
Lennart Poettering
a346a34f7f
Merge pull request #19548 from poettering/userdb-dropin
userdb: add support for loading user/group records from JSON drop-ins
2021-05-10 17:53:45 +02:00
Lennart Poettering
f2147ed5ea docs: link info about static user/group drop-in files from the relevant specs 2021-05-10 14:59:26 +02:00
Lennart Poettering
62a90b48d0 man: document new userdbd features 2021-05-10 14:59:05 +02:00
Lennart Poettering
71b5738030 man: update nss-systemd documentation with new features 2021-05-10 14:58:44 +02:00
Lennart Poettering
8fbb1941f1 userdbd: also listen on a varlink socket io.systemd.DropIn
Let's explicitly support looking things up via dropin as a varlink
service.
2021-05-10 14:58:39 +02:00
Lennart Poettering
85f088abe8 userdb: optionally read user/group/membership "dropins", too 2021-05-10 14:58:07 +02:00
Zbigniew Jędrzejewski-Szmek
2d0b71b6f6
Merge pull request #19542 from yuwata/unit-after-socket
network, timesync, resolve: check bus is ready before emitting property change or signal
2021-05-10 14:44:15 +02:00
Zbigniew Jędrzejewski-Szmek
8808d3289e
Merge pull request #19556 from lucasrangit/network-wifi-interface-type-typos
network: update documentation and examples to use correct interface type and lookup command
2021-05-10 13:55:07 +02:00
Lucas Magasweran
2480ca95ba man: network: use networkctl list instead of status to list network interface type
To determine the network interface type for use in the `Type=` directive, it is more concise to use the `list` command. Whereas, the `status` command requires an interface parameter.

For example, on a RaspberryPi 4 the following shows that the `wlan0` interface type `wlan` is more coveniently listed by the `list` command.

```
root@raspberrypi4-64:~# networkctl list
IDX LINK  TYPE     OPERATIONAL SETUP
  1 lo    loopback carrier     unmanaged
  2 eth0  ether    routable    configured
  3 wlan0 wlan     off         unmanaged

3 links listed.
```

Whereas the `networkctl status` command doesn't include this information.

```
root@raspberrypi4-64:~# networkctl status
●   State: routable
  Address: 192.168.1.141 on eth0
           fd8b:8779:b7a4::f43 on eth0
           fd8b:8779:b7a4:0:dea6:32ff:febe:d1ce on eth0
           fe80::dea6:32ff:febe:d1ce on eth0
  Gateway: 192.168.1.1 (CZ.NIC, z.s.p.o.) on eth0
      DNS: 192.168.1.1

May 07 14:17:18 raspberrypi4-64 systemd-networkd[212]: eth0: Gained carrier
May 07 14:17:19 raspberrypi4-64 systemd-networkd[212]: eth0: Gained IPv6LL
May 07 14:17:19 raspberrypi4-64 systemd-networkd[212]: eth0: DHCPv6 address fd8b:8779:b7a4::f43/128 timeout preferred -1 valid -1
May 07 14:17:21 raspberrypi4-64 systemd-networkd[212]: eth0: DHCPv4 address 192.168.1.141/24 via 192.168.1.1
```

To get the interface type using the `status` command you need to specify an additional argument.

```
root@raspberrypi4-64:~# networkctl status wlan0
● 3: wlan0
                     Link File: /lib/systemd/network/99-default.link
                  Network File: n/a
                          Type: wlan
                         State: off (unmanaged)
                          Path: platform-fe300000.mmcnr
                        Driver: brcmfmac
                    HW Address: dc:a6:32:be:d1:cf (Raspberry Pi Trading Ltd)
                           MTU: 1500 (min: 68, max: 1500)
                         QDisc: noop
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
```
2021-05-10 13:40:33 +02:00
Roman Beranek
ee3713b71d resolve: remove RRs from zones before an update
During an update of RRs, the records of each DNS-SD service are
replaced with new ones. However the old RRs can only be removed from
the mDNS scopes as long as they remain accessible from the DnssdService
structures, otherwise they remain stuck there.

Therefore the removal must take place before the update.
2021-05-10 12:29:48 +02:00
Samuel BF
c362a432af Wider range of options for selecting entries for systemd-journal-gatewayd
Introducing --user, --system, --merge and --file flags, like for journalctl
and systemd-journal-upload.
2021-05-10 12:20:27 +02:00
Lucas Magasweran
b419e8776b network: examples: use wlan for Type instead of wifi 2021-05-10 11:28:52 +02:00
Harsh Barsaiyan
2c324dd161 hwdb: Add Asus TP550LA 2021-05-10 11:25:15 +02:00
Dimitri John Ledkov
36c5f589fb
boot/efi: add --build-id=sha1 to ELF efi objects
As it is not nice to ship ELF binary without a note.gnu.build-id set.
2021-05-10 09:36:04 +01:00
Dimitri John Ledkov
7840d7af22
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
Binutils for non-x86 architectures currently does not support PE binaries. Thus
linux.efi.stub is useless on those, as one cannot use any tooling to add
linux/cmdline/splash sections to it. In addition to PE linux.efi.stub also
install ELF linux.elf.stub, such that one can use objcopy ELF target to copy in
linux/cmdline/splash sections and then convert the result to a PE binary.
2021-05-10 09:35:59 +01:00
Dimitri John Ledkov
67f7244928
Merge pull request #19436 from xnox/sbat
boot: add optional EFI SBAT support
2021-05-10 09:30:16 +01:00
Lennart Poettering
2baec39665
Merge pull request #19545 from poettering/nss-systemd-shadow
nss-systemd: also expose shadow/gshadow entries from userdb records
2021-05-10 09:46:49 +02:00
Luca Boccassi
63225fe159
Merge pull request #19298 from bluca/cryptsetup_nopass
cryptsetup: add 'headless' parameter to skip password/pin query, allow pin-less enroll on FIDO2, support user presence/verification flags
2021-05-09 13:49:55 +01:00
Luca Boccassi
84b5f40821
Merge pull request #19552 from yuwata/fix-typo-and-coverty-issues
Fix typo and coverity issues
2021-05-09 13:36:17 +01:00
Yu Watanabe
19cc6d5e54 tree-wide: fix typo 2021-05-09 14:36:19 +09:00
Yu Watanabe
6ac6549251 userdb: shorten code a bit
Hopefully fixes CID#1452937.
2021-05-09 14:34:23 +09:00
Yu Watanabe
fedd793cea test: add one more assertion to make Coverty happy
Fixes CID#1452934.
2021-05-09 14:33:59 +09:00
Jörg Deckert
dd568427fb
networkd: correct batman-adv setting name (GatewayBandwidth) (#19539)
Co-authored-by: Jörg Deckert <jdeckert@unitas-network.de>
2021-05-08 14:39:32 +02:00
Lennart Poettering
f43a19ecd6 nss-systemd: synthesize NSS shadow/gshadow records from userdb, as well
This ensures we not only synthesize regular paswd/group records of
userdb records, but shadow records as well. This should make sure that
userdb can be used as comprehensive superset of the classic
passwd/group/shadow/gshadow functionality.
2021-05-08 14:35:28 +02:00
Lennart Poettering
09001dbdc8 nss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user records
Setting the flags means we won#t try to read the data from /etc/shadow
when reading a user record, thus slightly making conversion quicker and
reducing the chance of generating MAC faults, because we needlessly
access a privileged resource. Previously, passing the flag didn't
matter, when converting our JSON records to NSS since the flag only had
an effect on whether to use NSS getspnam() and related calls or not. But
given that we turn off NSS anyway as backend for this conversion (since
we want to avoid NSS loops, where we turn NSS data to our JSON user
records, and then to NSS forever and ever) it was unnecessary to pass
it.

This changed in one of the previous commits however, where we added
support for reading user definitions from drop-in files, with separate
drop-in files for the shadow data.
2021-05-08 14:25:24 +02:00
Yu Watanabe
3d56acef7f string-util: explicitly cast character to unsigned
This also adds comment why we cast to unsigned.

Follow-up for 7971f9030ae4bebe0d4a6845ed31584f8ab18103.

Addresses the comment https://github.com/systemd/systemd/pull/19544#discussion_r628472794.
2021-05-08 14:24:51 +02:00
Yegor Alexeyev
11c38d3e51 rfc3046 implementation 2021-05-08 15:59:29 +09:00
Yu Watanabe
b8d6689a7f resolve: check that bus is ready before emitting signal or property change 2021-05-08 15:12:31 +09:00
Yu Watanabe
933e95d716 timesync: check that bus is ready before emitting property change 2021-05-08 15:12:31 +09:00
Yu Watanabe
706875f165 network: check that bus is ready at one more place 2021-05-08 15:12:31 +09:00
Yu Watanabe
098d42b67e local-addresses: wrap long comment
Follow-up for 54e6f97bc9931679aa9b895546621b15e0f464a4.
2021-05-08 15:12:19 +09:00
Lennart Poettering
ebf940e1e9
Merge pull request #19438 from poettering/nspawn-uidmap
nspawn: add support for kernel 5.12 ID mapping mounts
2021-05-08 00:12:20 +02:00
Lennart Poettering
d799bd47d8
Merge pull request #19538 from poettering/userdbd-simplify-nss-listing
userdbd: refactoring to simplify NSS user listing
2021-05-08 00:12:01 +02:00
Lennart Poettering
31892e8d40 update TODO 2021-05-07 22:44:39 +02:00
Lennart Poettering
ac31f59680 bash: update shell completion for new nspawn option 2021-05-07 22:44:35 +02:00
Lennart Poettering
22326f15a6 man: document new nspawn ID mapping mounts features 2021-05-07 22:44:17 +02:00
Lennart Poettering
f61c7f88d0 nspawn: introduce --private-users-ownership=map|auto
This adds a two new values to --private-users-ownership=: "map" and
"auto".

"map" exposes the kernel 5.12 idmap feature pretty much 1:1. It fails if
the kernel or used file system doesn't support ID mapping.

"auto" is a bit smarter: if we can make ID mapping work, we'll use it,
otherwise revert back to classic chown()ing. We'll also use chown()ing
if we detect that an image is already ID shifted, both to increase
compatibility with the status quo ante, and to simplify our codepaths,
since the mappings become a lot simpler if we only have to map from zero
to something else, instead of from anything to anything else.

The short -U switch, and --private-users=pick will now imply
--private-users-ownership=auto instead of
--private-users-ownership=chown, since the new logic should be the much
better choice.
2021-05-07 22:44:13 +02:00
Lennart Poettering
993da6d461 nspawn: drop an unnecessary local variable 2021-05-07 22:44:10 +02:00
Lennart Poettering
21b61b1dd2 dissect-image: add support for optionally mounting images with idmapping on 2021-05-07 22:44:05 +02:00
Lennart Poettering
35fd355842 mount-util: add a helper that can add an idmap to an existing mount
This makes use of the new kernel 5.12 APIs to add an idmap to a mount
point. It does so by cloning the mountpoint, changing it, and then
unmounting the old mountpoint, replacing it later with the new one.
2021-05-07 22:43:52 +02:00
Lennart Poettering
58e13de539 nspawn: tighten userns UID shift/range checks
Let's add a helper that ensures the UID shift/range parameters actually
fit together.
2021-05-07 22:43:48 +02:00
Lennart Poettering
5f9687363a process-util: add option for cloning with CLONE_NEWUSER
This is useful for allocating a userns fd later on for use in idmapped
mounts.
2021-05-07 22:43:42 +02:00
Lennart Poettering
14a25e1fae mount-util: add helper that ensures something is a mount point 2021-05-07 22:43:29 +02:00
Lennart Poettering
6c045a9998 nspawn: replace boolean --private-user-chown by enum
This replaces --private-user-chown by an enum value
--private-user-ownership=off|chown. Changes otherwise very little.

This is mostly preparation for a follow-up commit adding a new "map"
mode, using kernel 5.12 UID mapping mounts.

Note that this does alter codeflow a bit: the new enum already knows
three different values instead of the old true/false pair. Besides "off"
and "chown" it knows -EINVAL, i.e. whenever the value wsn't set
explicitly. This value is changed to "off" or "chown" before use, thus
retaining compat to the status quo before, except it won't override
explicit configuration anymore. Thus, if you explicitly request
--private-user=pick you can now combine it wiht an explicit
--private-user-ownership=off if you like, which will give you a
container that runs under its own UID set, but the files will be owned
by the original image. Makes not much sense besids maybe debugging, but
if requested explicitly I think it's OK to implement.
2021-05-07 22:43:25 +02:00
Lennart Poettering
33eac552ab nspawn: add high-level option for identity userns mapping
userns identity 1:1 mapping is a pretty useful concept since it isolates
capability sets between containers and hosts, even if it doesn't map
any uid ranges. Let's support it with an explicit concept.

(Note that this is identical to --private-users=0:65536 (which in turn
is identical to --private-users=0), but I think it makes to emphasize
this concept as a high-level one that makes sense to support.)
2021-05-07 22:43:05 +02:00
Luca Boccassi
8f214355c6 FIDO2: if defined, check for FIDO_ERR_UV_BLOCKED
Newer libfido versions added this error, so check for it since it
can help the user with a more specific message
2021-05-07 21:36:27 +01:00
Luca Boccassi
896cc0da98 FIDO2: ask and record whether user verification was used to lock the volume
Some tokens support authorization via fingerprint or other biometric
ID. Add support for "user verification" to cryptenroll and cryptsetup.
Disable by default, as it is still quite uncommon.
2021-05-07 21:36:27 +01:00
Luca Boccassi
06f087192d FIDO2: ask and record whether user presence was used to lock the volume
In some cases user presence might not be required to get _a_
secret out of a FIDO2 device, but it might be required to
the get actual secret that was used to lock the volume.
Record whether we used it in the LUKS header JSON metadata.
Let the cryptenroll user ask for the feature, but bail out if it is
required by the token and the user disabled it.
Enabled by default.
2021-05-07 21:36:27 +01:00
Luca Boccassi
cde2f8605e FIDO2: support pin-less LUKS enroll/unlock
Closes: https://github.com/systemd/systemd/issues/19246

Some FIDO2 devices allow the user to choose whether to use a PIN or not
and will HMAC with a different secret depending on the choice.
Some other devices (or some device-specific configuration) can instead
make it mandatory.
Allow the cryptenroll user to choose whether to use a PIN or not, but
fail immediately if it is a hard requirement.
Record the choice in the JSON-encoded LUKS header metadata so that the
right set of options can be used on unlock.
2021-05-07 21:36:27 +01:00
Luca Boccassi
cd5f57bda7 cryptsetup: add 'headless' parameter to skip password/pin query
On headless setups, in case other methods fail, asking for a password/pin
is not useful as there are no users on the terminal, and generates
unwanted noise. Add a parameter to /etc/crypttab to skip it.
2021-05-07 21:36:27 +01:00
Lennart Poettering
134ff8f4d1 userdbd: simplify logic for generating NSS listings
So far we basically had two ways to iterate through NSS records: one via
the varlink IPC and one via the userdb.[ch] infra, with slightly
different implementations.

Let's clean this up, and always use userdb.[ch] also when resolving via
userdbd. The different codepaths for the NameServiceSwitch and the
Multiplexer varlink service now differ only in the different flags
passed to the userdb lookup.

Behaviour shouldn't change by this. This is mostly refactoring, reducing
redundant codepaths.
2021-05-07 22:19:41 +02:00
Lennart Poettering
b214825433 userdb: add new flag for excluding varlink data in lookups
This is useful to later-on use the userdb infra for only some sources.
2021-05-07 22:19:37 +02:00
Lennart Poettering
80d88a8267 userdb: rename userdb lookup flags a bit
Let's use "exclude" for flags that really exclude records from our
lookup. Let's use "avoid" referring to concepts that when flag is set
we'll not use but we have a fallback path for that should yield the same
result. Let' use "suppress" for suppressing partial info, even if we
return the record otherwise.

So far we used "avoid" for all these cases, which was confusing.

Whiel we are at it, let's reassign the bits a bit, leaving some space
for bits follow-up commits are going to add.
2021-05-07 22:19:07 +02:00
Marco Antonio Mauro
0cd70d43a3
Added Teclast X4 ACCEL_MOUNT_MATRIX (#19540) 2021-05-07 22:17:25 +02:00
Yu Watanabe
7971f9030a string-util: fix build error on aarch64
This fixes the following error:
```
In file included from ../src/basic/af-list.h:6,
                 from ../src/basic/af-list.c:7:
../src/basic/string-util.h: In function 'char_is_cc':
../src/basic/string-util.h:133:19: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  133 |         return (p >= 0 && p < ' ') || p == 127;
      |                   ^~
cc1: all warnings being treated as errors
```

Fixes #19543.
2021-05-07 21:55:55 +02:00
Frantisek Sumsal
f2ef6d98e6 test: fix partition check in TEST-58-REPART
Follow-up to 1c41c1dc346dd0d5d235fe0866bbe2d9be924dcd.
2021-05-07 21:17:22 +02:00
Lennart Poettering
37ef2fc9f7
Merge pull request #18863 from keszybz/cmdline-escaping
Escape command lines properly
2021-05-07 17:29:39 +02:00
Zbigniew Jędrzejewski-Szmek
d0f14a6cf4
Merge pull request #19134 from poettering/outbound-special-hostname
introduce a new synthetic hostname "_outbound" that maps to "the" local IP address
2021-05-07 17:15:22 +02:00
Lennart Poettering
2d882d3581 nss-systemd: make llvm work-around for used _cleanup_ explicit 2021-05-07 16:44:03 +02:00
Lennart Poettering
bbfb8c878c userdbd: reverse which path is a socket and which a symlink
userdbd listens on "two" sockets, that are actually the same: one is a
real AF_UNIX socket in the fs, and the other is a symlink to it.

So far, when userdbd was started from the command line it would make one
a symlink and the other a real socket, but when invoked via unit files
they'd be swapped, i.e. the other would be a symlink and the one a real
socket.

Let's bring this in line.

Since the "io.systemd.Multiplexer" is our main interface, let's make it
the one exposed as socket, and then make "io.systemd.NameServiceSwitch"
a symlink to it. Or in other words, let's adjust the C code to match the
unit file.
2021-05-07 16:43:43 +02:00
Lennart Poettering
2708160ccd fileio: optionally, return discovered path of file in search_and_fopen() 2021-05-07 16:43:26 +02:00
Dimitri John Ledkov
9137c03c04
boot: add optional EFI SBAT support
Add SBAT support, when -Dsbat-distro value is specified. One can use
-Dsbat-distro=auto for autodetection of all sbat options. Many meson configure
options added to customize SBAT CSV values, but sensible defaults are auto
detected by default. SBAT support is required if shim v15+ is used to load
systemd-boot binary or kernel.efi (Type II BootLoaderSpec).

Fixes #19247
2021-05-07 14:38:48 +01:00
Zbigniew Jędrzejewski-Szmek
ac2c088939
Merge pull request #19391 from poettering/dissect-grow
optionally, grow file systems to partition size when mounting them via GPT auto-discovery
2021-05-07 15:04:55 +02:00
Lennart Poettering
2a9cfe6b07
Merge pull request #19531 from poettering/nss-systemd-fixes
nss-systemd: two minor fixes
2021-05-07 11:15:53 +02:00
Lennart Poettering
a1aa41e4e1 nss-systemd: properly handle empty membership lists
When we are queried for membership lists on a system that has exactly
zero, then we'll return ESRCH immediately instead of at EOF. Which is
OK, but we need to handle this in various places, and not get confused
by it.
2021-05-07 09:15:40 +02:00
Lennart Poettering
e9b88a6d4e string-util: add strextendf() helper, that allows extending some allocated string via a format string
It's not going to be efficient if called in inner loops, but it's oh so
handy, and we have some code that does this:

   asprintf(&p, "%s…", b, …);
   free(b);
   b = TAKE_PTR(p);

which can now be replaced by the quicker and easier to read:

   strextendf(&p, "…", …);
2021-05-07 09:10:59 +02:00
Lennart Poettering
db1ce3ea1a nspawn: fix the sections .nspawn settings are placed in
The actual section names are quite different from what the comment so
far suggested. Fix that.
2021-05-07 05:57:30 +09:00
Lennart Poettering
1fdfca4da7 nss-systemd: reset the right field 2021-05-06 22:35:49 +02:00
Lennart Poettering
5b235f0df5
Merge pull request #19523 from bluca/coredump_meta_fixes
docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key
2021-05-06 22:34:53 +02:00
Lennart Poettering
53c25ac968 user-util: add generic definition for special password hash values in /etc/passwd + /etc/shadow
Let's add three defines for the 3 special cases of passwords.

Some of our tools used different values for the "locked"/"invalid" case,
let's settle on using "!*" which means the password is both locked *and*
invalid.

Other tools like to use "!!" for this case, which however is less than
ideal I think, since the this could also be a considered an entry with
an empty password, that can be enabled again by unlocking it twice.
2021-05-06 21:55:58 +02:00
Mike Kazantsev
a7bd1656f3 Fix indent prefix being used as a suffix in systemd-analyze dump for some properties 2021-05-06 21:55:35 +02:00
Lennart Poettering
cf38805567
Merge pull request #19527 from poettering/userdb-fixes
various minor userdb fixes
2021-05-06 21:54:42 +02:00
Lennart Poettering
7c67419117 userdb: honour USERDB_AVOID_SHADOW flag also when iterating 2021-05-06 18:36:32 +02:00
Lennart Poettering
d9f5f2a12c userdb: fix typo in comment 2021-05-06 18:36:32 +02:00
Lennart Poettering
d4f560df4f userdb: add missing 'else' 2021-05-06 18:36:32 +02:00
Lennart Poettering
77fe7d1593 userdb: remove unnecesary repeated if check 2021-05-06 18:36:32 +02:00
Lennart Poettering
27a5a22f03 userdb: count NSS records too 2021-05-06 18:36:32 +02:00
Luca Boccassi
201962ef46 docs/COREDUMP_PACKAGE_METADATA.md: add table with well-known keys and their definition 2021-05-06 16:58:43 +01:00
Dimitri John Ledkov
e706aaa7a3 boot/efi: add ARM (THUMB) and RISCV64 machine types
Also drop defines from shared/pe-header.h, appear to be unused.
2021-05-06 15:16:29 +02:00
Mark Wielaard
4f90b052e5 docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key
Signed-off-by: Mark Wielaard <mark@klomp.org>
2021-05-06 13:50:21 +01:00
Yu Watanabe
a83a7d1e9e test: drop default ACL from $TESTDIR
This fixes an issue introduced by the commit 954c77c2510c0328fd98354a59f380945752c38c.

For some reasons, setting default ACL on $TESTDIR makes TEST-29-PORTABLE
fail. Let's drop the default ACL, and set ACL on saved results instead.

Fixes #19519.
2021-05-06 11:28:00 +02:00
Yu Watanabe
853401a6bc test: increase image size when static library or standalone binaries are installed 2021-05-06 11:28:00 +02:00
howl
84e492cdba Unify pn81H3 and cvrLenovoideapadD330-10IGM
D330-10IGM has been added due the fact that 81H3 and 81MD product name belongs to the same product version. So the fact is that now that we know 81MD has the same transformation matrix that the 81H3 we can just use the product version and get rid the product name.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
2021-05-06 11:13:48 +02:00
Phaedrus Leeds
00473ac804 docs: Fix typos in PORTABLE_SERVICES.md 2021-05-06 16:01:23 +09:00
Yu Watanabe
3d396b2837 test: drop log_trace() in test-random-util
It provides almost no inoformation. Moreover, it massively increases
logs, and firefox cannot show the results of Ubuntu CIs due to this.
2021-05-06 12:46:31 +09:00
Yu Watanabe
d8c1422439
Merge pull request #19515 from keszybz/config-parser-crash-fix
Fix crashes in config parsing
2021-05-06 12:46:13 +09:00
Yu Watanabe
d6eaee6e74
Merge pull request #19514 from keszybz/return-UnitNameFlags-more
Return UnitNameFlags from unit_name_to_instance()
2021-05-06 12:46:00 +09:00
Yu Watanabe
5971630cf6
Merge pull request #19513 from takaswie/topic/ieee1394-hwdb-entries-for-video
hwdb: ieee1394-unit-function: add entries to obsolete existent udev rules for video function
2021-05-06 12:45:05 +09:00
Yu Watanabe
f0373df1a7
Merge pull request #19507 from nabijaczleweli/bootctlpsko-lite
bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
2021-05-06 12:44:21 +09:00
Frantisek Sumsal
c191e09230 ci: cover standalone/static binaries in build test 2021-05-06 11:52:58 +09:00
Luca Boccassi
fd7d8bf105
Merge pull request #19498 from poettering/mallinfo2
selinux: use mallocinfo2() if it exists
2021-05-05 22:00:49 +01:00
Alyssa Ross
f8eb41003d udev: make /dev/vfio/vfio 0666
Quoting Documentation/driver-api/vfio.rst in Linux:

> note that /dev/vfio/vfio provides no capabilities on its own and is therefore
> expected to be set to mode 0666 by the system
2021-05-05 17:22:00 +02:00
Zbigniew Jędrzejewski-Szmek
52a89a5f08 sd-device: reject empty driver name
If ":" was the last char in the string, we would call access() on ".../drivers/", which
would pass. It probably doesn't matter, but let's reject this anyway.
2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
3e2d0c6ab2 sd-device: use memdupa_suffix0() where appropriate
No functional change intended.
2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
e17c95af8e sd-device: do no allocate strings of unknown length on the stack
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33881.

Not only we would duplicate unknown input on the stack, we would do it
over and over. So let's first check that the input has reasonable length,
but also allocate just one fixed size buffer.
2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
7ecb052fb3 fuzz-journald-kmsg: silence output as usual 2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
3968ccd0cd core: fix crash in BPFProgram parsing
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33270.
2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
07b3075fad basic/log: use SYNTHETIC_ERRNO in one more place 2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
a687f50009 core: use the same pattern for extract_first_word() checks
No functional change, but there is no reason to write it too verbosely
or in different orders.
2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
d762abece9 core: fix potential crash in BPFProgram= 2021-05-05 17:15:04 +02:00
Zbigniew Jędrzejewski-Szmek
cc87b3f68f core: fix crash in parsing of SocketBind{Allow,Deny}=
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33876.
2021-05-05 17:14:58 +02:00
Takashi Sakamoto
ecd64ffafd udev: uaccess: remove ID_FFADO entry
The ID_FFADO environment variable comes from external FFADO project.
Now we have comprehensive and self-contained rules instead of it.
Let's remove it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
e51d5b9c8a hwdb: ieee1394-unit-function: add entry for AV/C device with vendor unique command set
In IEC 61883-1:1998, we can see some values for AV/C device with vendor
unique command set in IEC 61883-1:1998. Current udev rule handles it
for video. However it brings an issue that the functions in AV/C device
are not distinguished just by the content of configuration ROM.

In former commit, hardware database was added to describe function type
of unit in the node, then udev rules are added to utilize the database.

However, we have an request to obsolete existent udev rules by putting
enough entries to the database. It should be done carefully.

This commit adds entry into hardware database just for backward
compatibility. The entry can match to some node and unit unexpectedly.
Therefore this commit modifies existent entries to invalidate the effect
from added entry.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
002f6e92af hwdb: ieee1394-unit-function: add entry for AV/C device with generic AV/C command set
Typical node of AV/C device has standard content of configuration ROM.
This is defined in documentation of 1394 Trading Association.

 * Configuration ROM for AV/C Devices 1.0 (Dec. 12, 2000, 1394 Trading
   Association, TA Document 1999027)

However, it brings an issue that the functions in AV/C device are not
distinguished just by the content of configuration ROM.

In former commit, hardware database was added to describe function type
of unit in the node, then udev rules are added to utilize the database.

However, we have an request to obsolete existent udev rules by putting
enough entries to the database. It should be done carefully.

This commit adds entry into hardware database just for backward
compatibility. The entry can match to some node and unit unexpectedly.
Therefore this commit modifies existent entries to invalidate the effect
from added entry.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
fae95d9ff5 hwdb: ieee1394-unit-function: remove entry for Cool Stream iSweet
IIDC specification describes configuration ROM without model field, thus
it's not possible to match any entry with vendor ID and model ID.
Current entry for Cool Stream iSweet can match any node and unit of
IIDC.

This commit removes the entry. I note that this model uses Texus
Instruments MC680-DCC as all-in-one chipset for video function in
IEEE 1394 bus.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
70fb7e5da5 hwdb: ieee1394-unit-function: add entries for Point Grey cameras
Point Grey Research, inc. shipped cameras to support IIDC, however some
of them are necessarily compliant to IIDC specification in terms of the
value of software version field in unit directory of configuration ROM.

This commit adds entries for them.

Reviewed-by: Damien Douxchamps <damien@douxchamps.net>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
78eb99c496 hwdb: ieee1394-unit-function: add IIDC generic entries
Instrumentation & Industrial Digital Camera (IIDC) specifications are
defined by 1394 Trading Association for camera device in IEEE 1394 bus.
IIDC2 specifications are defined by joint working group between Japan
Industrial Imaging Association (JIIA) and 1394 Trade Association as
bus-independent specification.

This commit adds entries for the specifications to remove existent udev
rules. Supported specifications are listed below:

 * 1394-based Digital Camera Specification Version 1.04 (Aug. 9, 1996,
   1394 Trading Association)
 * 1394-based Digital Camera Specification Version 1.20 (Jul. 23, 1998,
   1394 Trading Association)
 * IIDC Digital Camera Control Specification Ver.1.30 (Jul. 25, 2000,
   1394 Trading Association)
 * IIDC Digital Camera Control Specification Ver.1.31 (Feb. 2, 2004,
   1394 Trading Association, TA Document 2003017)
 * IIDC Digital Camera Control Specification Ver.1.32 (Jul. 24, 2008,
   1394 Trading Association, Document number 2007009)
 * IIDC2 Digital Camera Control Specification Ver.1.0.0 (Jan 26th, 2012,
   1394 Trading Association, TS2011001)
 * IIDC2 Digital Camera Control Specification Ver.1.1.0 (May 19th, 2015,
   1394 Trading Association, TS2015001)

Reviewed-by: Damien Douxchamps <damien@douxchamps.net>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
cc447b33f6 hwdb: ieee1394-unit-function: add entries for Digital Everywhere FloppyDTV and FireDTV
Linux kernel has firedtv kernel module as driver for Digital Everywhere
FloppyDTV and FireDTV. Although this driver works without any help of
userspace application, it's better to add entries to hardware database
for developer's convenience.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
a9c6f9b8a6 hwdb: ieee1394-unit-function: fix indentation
Zbigniew Jędrzejewski-Szmek points that current entries are against the
convention of indentation. It should be indented by one space instead of
two.

This commit fixes current entries according to it.

Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fixes: 1b6d9a05b14a ("hwdb: add database entries for models with ASICs in BeBoB solution")
Fixes: 0db0564e957f ("hwdb: add database entries for models with Fireworks board module")
Fixes: 38338b302cb0 ("hwdb: add database entries for models with OXFW970/971 ASICs")
Fixes: c0d8b61f9385 ("hwdb: add database entries for models based on DICE ASICs with TCAT specification")
Fixes: a774b5099bce ("hwdb: add database entries for models based on DICE ASICs specialized to M-Audio")
Fixes: ff1cb7b9393a ("hwdb: add database entries for models based on DICE ASICs specialized to Weiss Engineering")
Fixes: 6f44dddbe20a ("hwdb: add database entries for models based on DICE ASICs specialized by Loud Technologies")
Fixes: 49ed0aad525b ("hwdb: add database entries for models based on DICE ASICs specialized by Harman Music Group")
Fixes: effbb4024b8b ("hwdb: add database entries for models based on DICE ASICs specialized by Solid State Logic")
Fixes: 4aaa093b5fb6 ("hwdb: add database entries for models of Digidesign Digi 00x family")
Fixes: c489e7f9d3c4 ("hwdb: add database entries for Tascam FireWire series")
Fixes: 650b8967a57b ("hwdb: add database entries for MOTU FireWire series")
Fixes: 51e9242b9b91 ("hwdb: add database entries for RME Fireface series")
Fixes: a90a6a9ae9f8 ("hwdb: add database entries for Yamaha mLAN 2nd generation")
Fixes: 41f2d0d393a4 ("hwdb: add database entries for Yamaha mLAN 3rd generation")
Fixes: 1d2ee962922f ("hwdb: add database entries for Focusrite Liquid Mix series")
Fixes: 0c20543835d6 ("hwdb: add database entries for TC Electronic PowerCore FireWire series")
Fixes: 8b4b76dc5021 ("hwdb: add database entry for node with single unit with video function")
Fixes: 12dd2404bee8 ("hwdb: add database entries for node with multiple units")
Fixes: dece0357e1c8 ("hwdb: add database entries for node with single unit for multiple functions")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Takashi Sakamoto
5d66d89c42 hwdb: fix parser to execute test for ieee1394-unit-function with no argument
When given no arguments, hwdb parser script seeks test target files by
glob pattern. Although I added a new file for IEEE 1394 unit functions,
the file is excluded as test target due to the pattern.

This commit fixes it.

Fixes: 7713f3fc6a2 ("hwdb: add parser grammar for IEEE 1394 unit function list")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-05-05 23:10:29 +09:00
Zbigniew Jędrzejewski-Szmek
c9816a9ac4 basic/time-util: use _cleanup_ in one more place 2021-05-05 15:08:48 +02:00
Zbigniew Jędrzejewski-Szmek
73ce91a05a Make unit_name_to_instance() return UnitNameFlags
The function returns non-negative UnitNameFlags on success, and negative
errno on error. In the past we kept the return type as int because of those
negative return values. But nowadays _UNIT_NAME_INVALID == -EINVAL. And if
we tried to actually return something that doesn't fit in the return type,
the compiler would throw an error. By changing to the "real" return type,
we allow the debugger to use symbolic representation for the variables.
2021-05-05 15:08:48 +02:00
наб
6a3fff75ba
bootctl: take --make-machine-id-directory=yes|no|auto and make/remove \$MACHINE_ID accordingly
auto resolves to yes if /etc/machine-id resides on non-tmpfs

This effectively reverts commit 31e57550b552e113bd3d44355b237c41e42beb58
2021-05-05 14:35:00 +02:00
Zbigniew Jędrzejewski-Szmek
2f960b3858 core,journald: use quoted commandlines
I think quoting is more useful than not quoting. Without, arguments with
whitespace cannot be split correctly.

Unlike in coredump, "normal" quoting is used in those two cases. This output is
mostly for informational purposes, so the more readable quoting seems apropriate.

dbus GetProcesses:
$ busctl --user call org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/run_2dr4450e1ae73944194bb6593fcfd255fbe_2eservice org.freedesktop.systemd1.Service GetProcesses
a(sus) 2
"/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131494 "/usr/bin/bash -c \"sleep 100; sleep 20\""
"/user.slice/user-1000.slice/user@1000.service/app.slice/run-r4450e1ae73944194bb6593fcfd255fbe.service" 131496 "sleep 100"
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
5dd55303f4 coredump: use "POSIX quotes" for cmdline
$ coredumpctl info |grep Command
  Command Line: bash -c kill -SEGV $$      (before)
  Command Line: bash -c "kill -SEGV \$\$"  (road not taken, C quotes)
  Command Line: bash -c $'kill -SEGV $$'   (now, POSIX quotes)

Before we wouldn't use any quoting, making it impossible to figure how the
command line was split into arguments. We could use "normal" quotes, but this
has the disadvantage that the commandline *looks* like it could be pasted into
the terminal and executed, but this is not true: various non-printable
characters cannot be expressed in this quoting style. (This is not visible in
this example). Thus, "POSIX quotes" are used, which should allow any command
line to be expressed acurrately and pasted directly into a shell prompt to
reexecute.

I wonder if we should another field in the coredump entry that simply shows the
original cmdline with embedded NULs, in the original /proc/*/cmdline
format. This would allow clients to format the data as they see fit. But I
think we'd want to keep the serialized form anyway, for backwards compatibility.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
4e3fbc133e man: add an example of coredumpctl output
People like examples. Also shows off the new quoted command line.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
510c7a953e test-process-util: add test that prints all cmdlines 2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
99009ed0f4 basic/process-util: add mode where posix shell escape is used for quoting
The new flag is not used, except in tests, so no functional change yet.

This way, the command as shown can be copied-and-pasted into the shell
in more cases. For simple cases, shell quoting with "" is enough. But
$'' is needed when there are control characters in the command.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
07468a16e4 test-process-util: run fewer getpid() tests
Significant time was spent in the getpid() measurement code, which is not very
important.  So let's optimize this a bit by running the slower version less
times, and only running both tests a lesser amount of times unless slow tests
are enabled.

This gives the better accuracy then before in slow mode, and still reasonable
accuracy in fast mode without a noticable slowdown.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
daceaabe1f test-process-util: add more debug logging but hide most of it by default
It makes little sense to always print the stuff that is fully deterministic
and verified by asserts. It can be opted-in with $SYSTEMD_LOG_LEVEL when
developing the tests or debugging a failure.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
61977664e9 basic/process-util: allow quoting of commandlines
Since the new functionality is controlled by an option, this causes no change
in output yet, except tests.

The login in the old branch of !(flags & PROCESS_CMDLINE_QUOTE) is essentially
unmodified. But there is an important difference in behaviour: instead of
unconditionally reading the whole virtual file, we now read only 'max_columns'
bytes. This makes out code to write process lists quite a bit more efficient
when there are processes with long command lines.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
82208a9949 test-utf8: hide most output by default
Unless one is working on the code, there is little reason to write most
of the output. So let's hide it unless requested with SYSTEMD_LOG_LEVEL=debug.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
fc96e5c053 basic/escape: allow truncation mode where "…" is always appended
So far we would append "…" or "..." when the string was wider than the specified
output width. But let's add a mode where the caller knows that the string being
passed is already truncated.

The condition for jumping back in utf8_escape_non_printable_full() was
off-by-one. But we only jumped to that label after doing a check with a
stronger condition, so I think it didn't matter. Now it matters because we'd
output the forced ellipsis one column too early.
2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
b19f211698 basic/escape: flagsify xescape_full() 2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
d12ccbc302 test-fileio: modernization 2021-05-05 13:59:23 +02:00
Zbigniew Jędrzejewski-Szmek
ad0e687c07 basic/fileio: add a mode to read_full_virtual_file() where not the whole file is read 2021-05-05 13:59:23 +02:00
Luca Boccassi
73e799387f
Merge pull request #19505 from jwrdegoede/hwdb-2-accel-quirks
hwdb: Add 2 new accel quirks
2021-05-05 11:38:28 +01:00
Zbigniew Jędrzejewski-Szmek
0089ab0800 basic/escape: escape control characters, but not utf-8, in shell quoting
The comment in the code said that so far this didn't matter, but I want to use
shell quoting in more places where this will make a difference. So control
characters are now escaped. Normal utf-8 characters are passed through, it
is 2021 after all and pretty much everyone is (or should be) using utf-8.

While touching the code, change 'char *r' → 'char *buf', in line with modern
style.
2021-05-05 12:12:42 +02:00
Zbigniew Jędrzejewski-Szmek
523e1b14a1 basic/string-util: simplify how str_realloc() is used
All callers ignore failure anyway, so let's do that internally.
2021-05-05 12:12:42 +02:00
Zbigniew Jędrzejewski-Szmek
a01080ceb3 basic/string-util: inline iterator variable declarations 2021-05-05 12:12:42 +02:00
Zbigniew Jędrzejewski-Szmek
6302d38609 basic/string-util: split out helper function 2021-05-05 12:12:42 +02:00
Zbigniew Jędrzejewski-Szmek
566d06ae50 basic/escape: always escape newlines in shell_escape()
shell_escape() is mostly used for mount paths and similar, where we assume
no newlines are present in the string. But if any were ever present, we
should escape them. So let's simplify the code by making this unconditional.
2021-05-05 12:12:42 +02:00
Zbigniew Jędrzejewski-Szmek
1129cd8a71 basic/escape: add mode where empty arguments are still shown as ""
For variables, FOO= is OK. But when quoting positional arguments, we want to
use something with quotes ("", '', or even $'') for an empty string.
2021-05-05 12:12:10 +02:00
Zbigniew Jędrzejewski-Szmek
b086a89695
Merge pull request #19453 from keszybz/consider-instance-aliases
Consider instance aliases
2021-05-05 11:23:42 +02:00
Zbigniew Jędrzejewski-Szmek
4c4c250563
Merge pull request #19454 from keszybz/assorted-cleanups
Assorted cleanups
2021-05-05 11:06:33 +02:00
Zbigniew Jędrzejewski-Szmek
ea0d33e2af tests: use "H" as the hostname
"systemd-testsuite" gets in the way when grepping for "testsuite-*.sh".
Also, the name doesn't matter for anything, so let's just use something
very short to save space.
2021-05-05 11:04:59 +02:00
наб
2d94502724
meson: don't fail if latest tag's commit is signed
Today this is v248 with 938bdfc0fa737d86eb3ecc70506e11e5f740e0dc, which,
if you don't know about the github webflow key fails to configure with
  meson.build:724:8: ERROR:  String "gpg: Signature made Tue 30 Mar 2021 22:59:02 CEST\ngpg:                using RSA key 4AEE18F83AFDEB23\ngpg: Can't check signature: No public key\n1617137942\n" cannot be converted to int
or, if you do, with
  meson.build:724:8: ERROR:  String 'gpg: Signature made Tue 30 Mar 2021 22:59:02 CEST\ngpg:                using RSA key 4AEE18F83AFDEB23\ngpg: Good signature from "GitHub (web-flow commit signing) <noreply@github.com>" [unknown]\ngpg: WARNING: This key is not certified with a trusted signature!\ngpg:          There is no indication that the signature belongs to the owner.\nPrimary key fingerprint: 5DE3 E050 9C47 EA3C F04A  42D3 4AEE 18F8 3AFD EB23\n1617137942\n' cannot be converted to int
2021-05-04 20:08:59 +02:00
Zbigniew Jędrzejewski-Szmek
41b2d7ac1d TEST-15: add test for template aliases 2021-05-04 17:59:34 +02:00
Zbigniew Jędrzejewski-Szmek
fd22838734 basic/unit-file: fix detection of instance aliases
We had the following scenario:
under /etc/systemd/system/
- foo@.service
- bar@tty12.servicefoo@tty12.service
- multi-user.target.wants/foo@tty12.service

Existing code did not "know" that foo@tty12.service has alias bar@tty12.service:
$ systemctl show -P Names foo@tty12.service
foo@tty12.service

Since multi-user.target is always loaded, we would load foo@tty12.service.
When trying to load bar@tty12.service, it would (correctly) detect that
bar@tty12.service is an alias for foo@tty12.service, and try to merge the
bar@tty12.service unit into the foo@tty12.service. This would fail, because
foo@tty12.service was already loaded, and only about-to-be-loaded units can
be merged.

With the patch we consider bar@tty12.service an alias of foo@tty12.service
immediately, so the issue does not occur:
$ systemctl show -P Names foo@tty12.service
foo@tty12.service bar@tty12.service

Fixes #19409.

This turned in a bigger rewrite. The logic add "the main name and all aliases"
was implemented twice, slightly different in both cases. I split that part out
to a new function. The result about the same length, but hopefully a bit easier
to read.

Logging output is also improved a bit. Some left-over debug logs have been
removed or cleaned up.

This is a fairly big change, but (with the addition in the following commit),
we have pretty good coverage of this logic.
2021-05-04 17:59:34 +02:00
Hans de Goede
bda6bfa5c1 hwdb: Add accel orientation quirk for the Toshiba WT8-B tablet
Add a quirk to fix the accelerometer orientation on the Toshiba WT8-B
tablet.
2021-05-04 17:38:33 +02:00
Hans de Goede
e0883f5350 hwdb: Add accel orientation quirk for the Glavey TM800A550L tablet
Add a quirk to fix the accelerometer orientation on the Glavey TM800A550L
tablet.
2021-05-04 17:36:52 +02:00
Lennart Poettering
8b25cab720 update TODO 2021-05-04 16:01:00 +02:00
Lennart Poettering
1885169c2f selinux: use mallocinfo2() if it exists
New glibc deprecated mallocinfo(), even newer glibc added mallocinfo2()
as replacement. Use it, if it exists.

Follow-up for 4b6f74f5a0943e0abfa8e6997811f8f7b7f00a15 and related
commits.
2021-05-04 16:00:53 +02:00
Yu Watanabe
8fc1efa88f hostnamectl: fix hyperlink in "Operating System" field
This fixes a bug introduced by 822be62fb23ed0ec1062ffd18057e53f6c2f8c01.

Before this, if terminal width is not enough, the all subsequent lines
are included in the hyperlink.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1955475.
2021-05-04 15:27:20 +02:00
Yu Watanabe
296c13dec4 tree-wide: fix typo 2021-05-04 15:03:04 +02:00
Zbigniew Jędrzejewski-Szmek
edb83bceec core/automount: drop unecessary cast 2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
4c1f9343b2 core/cgroup: remove some unnecessary variables 2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
905a0abd22 basic/log: directly initialize iovec arrays
It doesn't change much, but removes a bunch of explicit size and index handling
and unnecessary initializations.
2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
2f9d1da95a basic/io-util: move iterator variable declarations into loop headers 2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
cf1e6e6260 resolved: directly initialize iovec array 2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
32f65484d7 basic/io-util: invert return value from IOVEC_INCREMENT()
We would try to return a value that could be nonzero only if the kernel
reported writing more bytes than we gave to it, hopefully a rare occurence.
Instead, assert that this doesn't happen.

Instead, return true if we got to the end of the iovec array. The caller
can use this information to know that the whole iovec array was written.
This allows one loop to be dropped in write_to_syslog().

Also drop _unlikely_: this function is called with very short arrays, and
it *is* likely that we trigger this condition. Let's just let the compiler
generate normal code without giving it a potentially false hint.
2021-05-04 14:57:49 +02:00
Zbigniew Jędrzejewski-Szmek
0f6bb1ed05 core: remove spurious % in dump string 2021-05-04 14:22:58 +02:00
Zbigniew Jędrzejewski-Szmek
806a93623c core/cgroup: use assert_se() more 2021-05-04 14:22:58 +02:00
Zbigniew Jędrzejewski-Szmek
431733b866 core: minor simplification 2021-05-04 14:22:58 +02:00
Zbigniew Jędrzejewski-Szmek
7e92ab4eb8 meson: make one check shorter 2021-05-04 14:22:58 +02:00
Zbigniew Jędrzejewski-Szmek
32464e18b4 test-unit-file: enable colors
There's quite a lot of output and it's much easier to grok this way.
2021-05-04 13:36:05 +02:00
Zbigniew Jędrzejewski-Szmek
6aac02ff1a TEST-15: add forgotten file cleanup 2021-05-04 13:36:05 +02:00
Zbigniew Jędrzejewski-Szmek
998df7ce0d manager: emit a message when we fail to create manager because /run is not set up
$ SYSTEMD_LOG_LEVEL=debug build/systemd --test --user
...
Failed to lookup RuntimeDirectory path: No such device or address   <---- this line is new
Failed to allocate manager object: No such device or address

We would fail and only say "Failed to allocate manager object: ENODEV" which is
not entirely self-explanatory. Let's add a better log message.
2021-05-04 13:36:05 +02:00
Zbigniew Jędrzejewski-Szmek
5169595ec3 TEST-15: use ${:?} and shorten things a bit 2021-05-04 13:36:05 +02:00
Zbigniew Jędrzejewski-Szmek
c0d4409219 test: properly catch tests error with no /testok or empty /failed
When editing this function in 7bf20e48bd7d641a39a14a7feb749b7e8, I couldn't
decide whether to initialize ret at the top and only reset it on success, or
whether to assign a value in each branch. In the end I did neither ;( So if the
test finished without creating any of the result files, we would echo a
message, but return "success".

But there was bigger confusion with /failed: some tests create it empty, some
don't. I think we may want to do away pre-creation of /failed completely, and
assume the test failed unless /testok is found. But I'm leaving that for later
rework. For now let's just make sure we report return success only if /testok
or /skipped is found.
2021-05-04 13:36:05 +02:00
imayoda
d7ffd4f334 Add correct rotation support for Mediacom Winpad 7.0 W700
this patch enables correct bios detection and matrix for the aforementioned tiny tablet (touchscreen support commit pending now in kernel) 
thnx
2021-05-03 20:19:36 +02:00
Jakub Warczarek
572c55ee3c hostnamectl: deprecate set-* methods and expose getters by only using nouns in commands 2021-05-03 20:19:19 +02:00
Ryan Hendrickson
c2503e359a core: apply LogLevelMax to messages about units
This commit applies the filtering imposed by LogLevelMax on a unit's
processes to messages logged by PID1 about the unit as well.

The target use case for this feature is a service that runs on a timer
many times an hour, where the system administrator decides that writing
a generic success message to the journal every few minutes or seconds
adds no diagnostic value and isn't worth the clutter or disk I/O.
2021-05-03 17:48:41 +02:00
Lennart Poettering
16ecdf3c80
Merge pull request #19403 from nmeyerhans/dmi-entries
virt: differentiate Amazon EC2 bare-metal from VM instances using SMBIOS data
2021-05-03 17:48:13 +02:00
Luca Adrian L
19d25fdec1
Document the need to do journalctl --flush for persistent logging (#19481)
Document the need to do journalctl --flush for persistent logging. (fixes #19480)

Co-authored-by: Luca Lindhorst <l.lindhorst@wut.de>
2021-05-03 17:08:25 +02:00
Luca Boccassi
d4d7127d94 Revert "sysusers/firstboot: temporarily disable LoadCredential"
This reverts commit 7c20dd4b6ef6e69862576722ac69b895d7a92dc9.

Debian has now been updated to patch the issue, so SemaphoreCI should
no longer fail. The fix has also been backported to the affected
stable branches.
2021-05-03 12:16:35 +09:00
Yu Watanabe
7afc8abdf3
Merge pull request #19487 from mrc0mmand/test-all-services-in-TEST-01
test: don't mask "supporting" services in TEST-01-BASIC
2021-05-03 12:15:29 +09:00
Frantisek Sumsal
d49b881eaf test: fix a yet another pipefail + pipe race
Basically the same scenario as in
a33e2692e162671f0d97856ad2f49a2620a1ec10, where `awk` exits as soon
as it finds a match, thus sending SIGPIPE to `ldd` if it's not fast
enough. That, in combination with `set -o pipefail` causes random &
unexpected fails, like:

```
No journal files were found.
-rw-r----- 1 root root 16777216 Apr 30 10:31
/var/tmp/TEST-01-BASIC_sanitizers-nspawn/system.journal
TEST-01-BASIC RUN: Basic systemd setup [OK]
systemd is not linked against the ASan DSO
gcc does this by default, for clang compile with -shared-libasan
make: *** [Makefile:2: clean-again] Error 1
make: Leaving directory '/build/test/TEST-01-BASIC'
```
2021-05-01 15:05:16 +09:00
Yu Watanabe
0c9cdcb9d4
Merge pull request #19476 from yuwata/network-can
network: several CAN device related updates
2021-05-01 15:03:22 +09:00
Yu Watanabe
bff97a251d
Merge pull request #18904 from yuwata/udev-watch
udev: several inotify watch fixups
2021-05-01 15:02:43 +09:00
Frantisek Sumsal
0868f6d4e6 test: explicitly pull resolved/networkd in TEST-01-BASIC
to give them at least a basic coverage.
2021-04-30 22:21:29 +02:00
Noah Meyerhans
ce35037928 Use BIOS characteristics to distinguish EC2 bare-metal from VMs
DMI vendor information fields do not provide enough information for us to
distinguish between Amazon EC2 virtual machines and bare-metal instances.
SMBIOS provides a BIOS Information
table (https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0.pdf
Ch. 7) that provides a field to indicate that the current machine is a virtual
machine.  On EC2 virtual machine instances, this field is set, while bare-metal
instances leave this unset, so we inspect the field via the kernel's
/sys/firemware/dmi/entries interface.

Fixes #18929
2021-04-30 12:26:22 -07:00
Bertrand Jacquin
382a46d129 machine-id-setup: generate machine-id from DMI product ID on Amazon EC2
Amazon EC2 Nitro hypervisor is technically based on KVM[1].

[1] https://aws.amazon.com/ec2/faqs/
2021-04-30 12:26:22 -07:00
Frantisek Sumsal
7776b22521 test: don't mask "supporting" services in TEST-01-BASIC
This got lost during one of the code de-duplication attempts.
2021-04-30 21:02:41 +02:00
Bertrand Jacquin
b6eca3731d virt: detect Amazon EC2 Nitro instance
Amazon EC2 Nitro hypervisor is technically based on KVM[1], which
systemd-detect-virt identify propely from CPUID. However the lack of
CPUID on aarch64 (A1, T4 instance type) prevents a correct
identification, impacting hostnamectl and systemd-random-seed. Instead
it's possible to identify virtualization from DMI vendor ID.

Prior to this commit:
  # hostnamectl
     Static hostname: n/a
  Transient hostname: ip-10-97-8-12
           Icon name: computer
          Machine ID: 8e3772fbcfa3dd6f330a12ff5df5a63b
             Boot ID: b7b7e2fe0079448db664839df59f9817
    Operating System: Gentoo/Linux
              Kernel: Linux 5.4.69-longterm
        Architecture: arm64

After this commit:
  # hostnamectl
     Static hostname: n/a
  Transient hostname: ip-10-97-8-12
           Icon name: computer-vm
             Chassis: vm
          Machine ID: 8e3772fbcfa3dd6f330a12ff5df5a63b
             Boot ID: bd04da57084e41078f20541101867113
      Virtualization: amazon
    Operating System: Gentoo/Linux
              Kernel: Linux 5.4.69-longterm
        Architecture: arm64

[1] https://aws.amazon.com/ec2/faqs/
2021-04-30 09:31:34 -07:00
Yu Watanabe
c068a17f6a sd-bus: fix vtable named argument logic
Fixes #19468.
2021-04-30 17:06:29 +01:00
Yu Watanabe
b43669a4b1 test: add a simple test for udev watch 2021-04-30 19:42:09 +09:00
Yu Watanabe
e63916ab29 test: generate debugging logs for udev tests 2021-04-30 19:42:09 +09:00
Yu Watanabe
e1e56f3443 test: run udev tests after currently queued events are finished 2021-04-30 19:42:09 +09:00
Yu Watanabe
e7f781e473 udev,sd_device: also save map from device ID to watch handle in /run/udev/watch
Previously, watch handle is saved in the udev databse. But in most cases,
the handle saved in the database is not updated. Especially, when udevd
is restarted, the inotify watch is restarted, but the database is not
updated.

Moreover, it is not necessary to save watch handle in the database, as
the handle is only take a effect during udevd is running, and the value
is meaningless when udevd is restarted.

So, this makes the opposite map from device ID to watch handle is saved
in /run/udev/watch as a symbolic link, and the handle not saved in the
database anymore.

Fixes #18525.
2021-04-30 19:41:41 +09:00
Yu Watanabe
5e0d051067 udev: make udev_watch_end() noop when device does not have devname 2021-04-30 19:32:14 +09:00
Yu Watanabe
4956f220a1 sd-device: cleanup sd_device_get_subsystem() 2021-04-30 19:32:10 +09:00
Yu Watanabe
6e25642f8e sd-device: drop sysname_set flag
When device_set_sysname() succeeds, sysname is always set.
2021-04-30 19:21:18 +09:00
Yu Watanabe
ff7a8d2938 sd-device: minor optimization for sd_device_new_from_device_id() 2021-04-30 19:21:18 +09:00
Yu Watanabe
db2bad4368 sd-device: check the validity of device id
The device id is used as filename under /run/udev/data or
/run/udev/watch.
2021-04-30 19:21:18 +09:00
Yu Watanabe
fe7323815d sd-device: rename device_get_id_filename() -> device_get_device_id()
We have sd_device_new_from_device_id(), which takes device ID generated
from device_get_id_filename(). For consistency, let's rename the
function.
2021-04-30 19:21:18 +09:00
Yu Watanabe
0d77bc4a18 udev: refuse to enable inotify watch on remove event
Some udev rule may erroneously set inotify watch on remove event.
For safety, silently ignore such an inotify watch enablement.

This also moves inotify watch enablement code to udev-event.c.
2021-04-30 19:21:18 +09:00
Yu Watanabe
4cac2260c8 udev: also propagate error in udev_rules_apply_to_event() on remove event
When udev rules are not applied correctly, then run program lists is
not perfect. So, udev_event_execute_run() later in
worker_process_device() should not be called.
2021-04-30 19:21:18 +09:00
Yu Watanabe
75b4984638 udev: shorten code a bit 2021-04-30 19:21:18 +09:00
Yu Watanabe
fa5d8899aa udev: drop unused variable 2021-04-30 19:21:18 +09:00
Yu Watanabe
99e0c96f31 sd-device: drop doubled empty lines 2021-04-30 19:21:18 +09:00
Yu Watanabe
df7ee95913 udev: do not store inotify fd in a global variable
When manager_exit() or manager_free() is called, the global variable in
udev-watch.c is not set '-1'. Of course, that is safe, as the event source
for the inotify fd is unref()ed in manager_exit() and manager_free().
But let's not store fd globally.
2021-04-30 19:21:18 +09:00
Yu Watanabe
36161cba7c network: do not bring up CAN interface on configure 2021-04-30 19:16:15 +09:00
Yu Watanabe
d9fc3b0da9 network: make CAN device follow activation policy 2021-04-30 19:16:15 +09:00
Yu Watanabe
04952b25e8 network: introduce link_activate() 2021-04-30 19:16:15 +09:00
Yu Watanabe
600b7898e8 network: do not try to configure address or etc on can device 2021-04-30 19:16:02 +09:00
Yu Watanabe
e361398e48 network: can: shorten code a bit 2021-04-30 19:11:25 +09:00
Yu Watanabe
ed52cce33f network: can: do not warn if link does not exist anymore 2021-04-30 19:11:25 +09:00
Yu Watanabe
f282ce20aa network: drop duplicated link_up_can() 2021-04-30 19:11:25 +09:00
Steve Bonds
88c2c8a0ba Clarify that these values are in bytes
Similar to `ProcessSizeMax`. The defaults in percentages can be misunderstood to mean the values for these parameters will be in percentages.
2021-04-30 11:18:39 +02:00
Yu Watanabe
4bd7e99232 test-network: set DNS= and NTP= for DHCP server
Now, RoutesToDNS= and RoutesToNTP= are enabled by default on DHCPv4
client. So, if DHCP server picks up DNS or NTP servers from uplink,
then the routes may break CI environment.

Hopefully fixes #19463.
2021-04-30 10:57:17 +02:00
syyhao1994
96ae72ce1a
man: importd also provides the option of import-fs for machinectl (#19477) 2021-04-30 16:55:50 +09:00
Yu Watanabe
2ff739a6ac kernel-insteall: do not remove the first slash in $ENTRY_DIR
Follow-up for cd0d230e7bf87f979722de7e364619dfa71bd6a2.

Fixes #19456.
2021-04-30 15:37:34 +09:00
Yu Watanabe
65a245c3ef
Merge pull request #19459 from yuwata/network-log-neighbor
network: introduce log_neighbor_debug()
2021-04-30 15:36:29 +09:00
Yu Watanabe
5aa87ec7ec network: neighbor: use sd_netlink_message_read_data() at one more place 2021-04-30 05:44:58 +09:00
Yu Watanabe
2775e1c578 network: introduce log_neighbor_debug() 2021-04-30 05:44:14 +09:00
Yu Watanabe
7653a9dcd3 network: reduce indentation in log_address_debug() or friends 2021-04-30 05:43:22 +09:00
Yu Watanabe
ae8e3c2b25 ether-addr-util: introduce ether_addr_to_string_alloc() 2021-04-30 05:39:10 +09:00
Alexander Sverdlin
4e947bd049 systemd-coredump: Add conflict with shutdown.target
Otherwise a coredump started at the inconvinient moment can stop
shutdown.target leaving the system in a halfway-down state:

Pulling in shutdown.target/start from systemd-poweroff.service/start
Added job shutdown.target/start to transaction.
...
Keeping job shutdown.target/start because of systemd-poweroff.service/start
...
[  OK  ] Stopped target Remote File Systems.
shutdown.target: starting held back, waiting for: systemd-networkd.socket
sysinit.target: stopping held back, waiting for: remount_tmp.service
systemd-coredump.socket: Incoming traffic
...
systemd-coredump@0-243-0.service: Trying to enqueue job systemd-coredump@0-243-0.service/start/replace
Added job systemd-coredump@0-243-0.service/start to transaction.
Pulling in systemd-journald.socket/start from systemd-coredump@0-243-0.service/start
Added job systemd-journald.socket/start to transaction.
Pulling in system.slice/start from systemd-journald.socket/start
Added job system.slice/start to transaction.
Pulling in -.slice/start from system.slice/start
Added job -.slice/start to transaction.
Pulling in system-systemd\x2dcoredump.slice/start from systemd-coredump@0-243-0.service/start
Added job system-systemd\x2dcoredump.slice/start to transaction.
Pulling in system.slice/start from system-systemd\x2dcoredump.slice/start
Pulling in shutdown.target/stop from system-systemd\x2dcoredump.slice/start
Added job shutdown.target/stop to transaction.
...
Keeping job systemd-poweroff.service/stop because of umount.target/stop
Keeping job shutdown.target/stop because of systemd-coredump@0-243-0.service/start
2021-04-29 21:45:23 +02:00
Lennart Poettering
c3a5240e3a
Merge pull request #19458 from yuwata/network-route-remove
network: fix route removal logic a bit
2021-04-29 21:39:30 +02:00
Viktor Mihajlovski
5a7eb46c02 udev: allow onboard index up to 65535
The maximum allowed value of the sysfs device index entry was limited to
16383 (2^14-1) to avoid the generation of unreasonable onboard interface
names.
For s390 the index can assume a value of up to 65535 (2^16-1) which is
now allowed depending on the new naming flag NAMING_16BIT_INDEX.
Larger index values are considered unreasonable and remain to be
ignored.
2021-04-29 21:38:21 +02:00
Lennart Poettering
34bcc67681
Merge pull request #19451 from poettering/hostnamed-json
hostnamed: add JSON output to hostnamectl
2021-04-29 21:37:52 +02:00
Lennart Poettering
97a7243650 man: document new dbus method 2021-04-29 16:39:09 +02:00
Lennart Poettering
ac8a4f6b78 hostnamectl: add --json= switch for JSON output
This wraps the new Describe() bus call of hostnamed.
2021-04-29 16:39:09 +02:00
Lennart Poettering
7ecead8f08 hostnamed: add Describe() call to hostnamed, returning all props a JSON 2021-04-29 16:39:09 +02:00
Lennart Poettering
f8da67cdf2 hostnamed: drop unused enums 2021-04-29 16:39:09 +02:00
Lennart Poettering
f2a434a5b8 hostnamed: split out how we determine the hostname a bit
No changes in code, just some splitting out of code we want to use
elsewhere soon.
2021-04-29 16:39:09 +02:00
Lennart Poettering
61d44b6beb hostnamed: refactor vendor/model querying a bit, reuse function 2021-04-29 16:39:09 +02:00
Lennart Poettering
c52e295d68 hostnamed: use byte array when we need a byte array
it's more corect this way, but shouldn#t change a thing binary-wise
2021-04-29 16:39:09 +02:00
Lennart Poettering
66ee229879 hostnamed: retrieve product UUID after authentication, not before 2021-04-29 16:39:09 +02:00
Lennart Poettering
b4be4ff8ae id128-util: use common implementation of helper to get/validate product ID 2021-04-29 16:39:09 +02:00
Yu Watanabe
3c7f1c0757 network: do not set nexthop ID, gateway, and multipath routes simultaneously
See kernel's rtm_to_fib_config() in net/ipv4/fib_frontend.c and
rtm_to_fib6_config() in net/ipv6/route.c.

Note that if both gateway and multipath routes are specified, then
kernel ignores gateway. So, strictly speaking, setting both gateway and
multipath routes is allowed by kernel. But such situation is mostly
user's misconfiguration. Let's refuse it.

Note that the conditions newly added in route_configure() are redundant,
as all static configurations are already verified in
route_section_verify(), and dynamic configurations do not set
nexthop_id or multipath routes. Just for safety.
2021-04-29 22:54:40 +09:00
caoxia2008cxx
f813b62316
set boot time from monotonic time (#19444)
utmp: calculate boot timestamp from monotonic timestamp instead of realtime timestamp
2021-04-29 11:05:01 +02:00
Yu Watanabe
8a9ce525d1 network: do not remove reject type routes more than once
Usually, removing non-existing addresses, routes, and etc, are safe.
However, when multiple interfaces lost their carriers simultaneously,
then manager_drop_routes() and manager_drop_nexthop() are called multiple
times. If a route with a blackhole nexthop is removed in that process,
the later removal requests of the route fail with -EINVAL, rathar
than -ESRCH, as the corresponding nexthop does not exist anymore.

So, let's not remove routes which managed by Manager more than once.
2021-04-29 09:11:36 +09:00
Yu Watanabe
c3fa1257da network: do not set route type on specific route removal 2021-04-29 09:08:55 +09:00
Yu Watanabe
fd221544f2 network: unify log_link_message_full_errno() and log_message_warning_errno()
This also introduces log_message_error_errno() or friends.
2021-04-29 09:07:42 +09:00
Yu Watanabe
e558d4f47a network: dhcp4: downgrade log level when interface is removed 2021-04-29 08:58:13 +09:00
Yu Watanabe
4cbd379e01 network: drop meaningless bitfield specifiers 2021-04-29 08:58:13 +09:00
Yu Watanabe
bf8a5f6473
Merge pull request #19449 from yuwata/network-downgrade-log-level
network: downgrade log level and fix typo
2021-04-29 08:54:08 +09:00
Yu Watanabe
086a351ad9 network: ndisc: fix ipv6 route preference for routes with Gateway=_ipv6ra 2021-04-29 08:50:54 +09:00
Lennart Poettering
fd98562099
Merge pull request #19374 from yuwata/network-dhcp-routes-to-ntp
network: dhcp4: introduce RoutesToNTP= boolean setting
2021-04-28 22:47:21 +02:00
Lennart Poettering
249e7b6692
Merge pull request #19441 from keszybz/riscv-syscall-lists
Add syscall list for riscv
2021-04-28 21:17:43 +02:00
Yu Watanabe
27a213392f network: neighbor: downgrade log level
As commented in the code, kernel sends messages about neighbors after
a link is removed.
2021-04-29 03:16:30 +09:00
Yu Watanabe
83e7c37b19 network: link: downgrade log level
The error is harmless, and will be ignored. Let's downgrade log level.
2021-04-29 03:16:30 +09:00
Yu Watanabe
dec2ed3e75 network: dhcp4: downgrade log level
It is not necessary to log such information on higher level.
2021-04-29 03:12:29 +09:00
Yu Watanabe
e110d0f0f6 systemctl: fix build failure
Follow-up for 255b1fc8a3055a7d59946a0fc483ee3885740398.
2021-04-29 03:03:55 +09:00
Yu Watanabe
255b1fc8a3 bus-print-property: introduce BusPrintPropertyFlags
Follow-ups for 1ceaad69378272c64da4ecaab0d59ebb7a92ca0a.
2021-04-28 17:36:09 +02:00
Lennart Poettering
feb10c665f docs: document that one shouldn't pass the audit caps to containers
Apparently this is not well know, so let' document this.
2021-04-28 17:29:09 +02:00
Zbigniew Jędrzejewski-Szmek
3796bdc55d basic/unit-file: ignore any hidden files immediately
Hidden and backup files cannot be valid unit name (we reject anything
starting with a dot, and we require type suffixes). So let's not iterate
over those at all.
2021-04-28 17:12:32 +02:00
Zbigniew Jędrzejewski-Szmek
e7702c20aa basic/missing-syscall: add regen instructions 2021-04-28 15:41:34 +02:00
Lennart Poettering
84e8edec30 missing: add syscall wrappers for new mount API 2021-04-28 15:41:34 +02:00
Zbigniew Jędrzejewski-Szmek
9899580a58 basic/missing-syscall: sort syscalls alphabetically and add numbers for mount_setattr, move_mount, open_tree 2021-04-28 15:41:34 +02:00
Zbigniew Jędrzejewski-Szmek
302beee342 basic/missing-syscall: add numbers for riscv (64-bit) 2021-04-28 15:41:34 +02:00
Zbigniew Jędrzejewski-Szmek
94dfd85b0c basic/missing-syscalls: only emit one warning about missing numbers
The ifdef pattern is the same for all syscalls, so most of the time, if one is
not defined, all others will too. So let's reduce the noise a bit and emit one
warning in case the support for the architecture is fully missing. (Current
template was copied over from before when we added numbers for each syscall by
hand and stopped making sense when we started generating the header from a
table that is expected to have all syscall numbers.)
2021-04-28 15:41:34 +02:00
Lennart Poettering
e6f1d7f4ec
Merge pull request #19316 from keszybz/mkosi-f34
Bump mkosi config for F34
2021-04-28 15:12:59 +02:00
Lennart Poettering
53515c6939
Merge pull request #19446 from poettering/logind-trigger-new
logind/dissect: use sd_device_trigger() more
2021-04-28 13:26:29 +02:00
Perry.Yuan
5ed0ea2928
hwdb: 60-keyboard:: Update Dell Privacy Local Mic Mute Hotkey (#19261)
This patch fix scancode 0x120001 mapping to key code F20 micmute
The previous scancode is not correct, it will cause the micmute
hotkey no function when testing the mic mute
2021-04-28 12:37:39 +02:00
Zbigniew Jędrzejewski-Szmek
686fd8f619 mkosi: do not pull in perl dependencies
It was added in e2c5e698c0, but nobody remembers why exactly.
2021-04-28 11:32:58 +02:00
Zbigniew Jędrzejewski-Szmek
ecd1bfdd3c hwdb-test: pass an explit path to systemd-hwdb
https://github.com/systemd/systemd/pull/19316 failed with:
[1065/1670] Linking target systemd-hwdb
--- command ---
14:28:29 /root/src/test/hwdb-test.sh
--- stdout ---
./systemd-hwdb does not exist, please build first

I'm not sure what is going on here… In principle meson says that tests may be
called from any directory, but in practice is was always the build directory.
So far we were relying on systemd-hwdb being present in '.', and this worked.
Either way, it's nicer to pass the exact path, so let's do that.
2021-04-28 11:32:58 +02:00
Zbigniew Jędrzejewski-Szmek
fe12f036fe mkosi,man: bump fedora version
F34 was just released and should be fine for systemd builds.

Cloud-1.2 is the latest version.
2021-04-28 11:32:48 +02:00
Uwe Kleine-König
cbcdcaaa0e Add support for conditions on the machines firmware
This allows to limit units to machines that run on a certain firmware
type. For device tree defined machines checking against the machine's
compatible is also possible.
2021-04-28 10:55:55 +02:00
Lennart Poettering
b64c4ece74 dissect-image: use sd_device_trigger() API
Let's use the new API here too.
2021-04-28 10:24:20 +02:00
Lennart Poettering
d8021ea1da logind: use new sd_device_trigger() API
This is a follow-up for 21012e20a4f0b939d449ad31d9bcbeafdfb8b931 and
related commits, i.e. one more occasion we can use the
sd_device_trigger() API.
2021-04-28 09:48:42 +02:00
William A. Kennington III
192a9d95ea network: neighbor: Always add neighbors with replace
We were duplicating setting flags for the message and a combination of
NLM_F_APPEND and NLM_F_CREATE which does not make sense. We should have
been using NLM_F_REPLACE and NLM_F_CREATE since the kernel can
dynamically create neighbors prior to us adding an entry. Otherwise, we
can end up with cases where the message will time out after ~25s even
though the neighbor still gets added. This delays the rest of the setup
of the interface even though the error is ultimately ignored.
2021-04-28 00:06:20 +09:00
Franck Bui
45b1fc3a88 system-conf: drop reference to ShutdownWatchdogUsec=
Commit 65224c1d0e50667a87c2c4f840c49d4918718f80 renamed ShutdownWatchdogUsec
into RebootWatchdogUsec but left a reference of ShutdownWatchdogUsec in
system.conf.
2021-04-27 12:38:57 +01:00
Zbigniew Jędrzejewski-Szmek
862e01d70f
Merge pull request #17655 from wat-ze-hex/bpf-build-rule
Introduce SocketBind{Allow|Deny}= properties powered by source compiled BPF
2021-04-27 12:52:30 +02:00
Frantisek Sumsal
1ceaad6937 systemctl: hide some empty properties without --all
Fixes: #19423
2021-04-27 12:16:50 +09:00
Julia Kartseva
7dc1707aab fuzz: add SocketBind{Allow|Deny}= directive 2021-04-26 16:26:28 -07:00
Julia Kartseva
c308025875 readme: update README with requirements for bpf 2021-04-26 16:26:28 -07:00
Julia Kartseva
6359811021 man: add SocketBind{Allow|Deny}= documentation 2021-04-26 16:26:28 -07:00
Julia Kartseva
18ef723ef6 systemctl: show SocketBind{Allow|Deny} properties 2021-04-26 16:26:28 -07:00
Julia Kartseva
dcf4781caf dbus: add dbus-cgroup for SocketBind{Allow|Deny}= 2021-04-26 16:26:28 -07:00
Julia Kartseva
28b76fc82a tests: add test program for SocketBind{Allow|Deny}=
Verify that service exited correctly if valid ports are passed to
SocketBind{Allow|Deny}=
Use `ncat` program starting a listening service binding to a specified
port, e.g.
"timeout --preserve-status -sSIGTERM 1s /bin/nc -l -p ${port} -vv"
2021-04-26 16:26:28 -07:00
Julia Kartseva
3d027d4d60 shared, bpf: add bpf link serialization
core: serialize socket_bind bpf links
2021-04-26 16:26:24 -07:00
Julia Kartseva
8dd210ab66 core: add SocketBind{Allow|Deny} fragment parser 2021-04-26 16:21:59 -07:00
Julia Kartseva
a8e5eb1788 core: add socket-bind cgroup mask harness
Standard cgroup harness for bpf feature.
2021-04-26 16:21:59 -07:00
Julia Kartseva
91ce91c76c core, bpf: add socket-bind feature to unit
Add supported and install unit interface for socket-bind feature.

supported verifies that
- unified cgroup hierarchy (cgroup v2) is used
- BPF_FRAMEWORK (libbpf + clang + llvm + bpftool) was available in
compile time
- kernel supports BPF_PROG_TYPE_CGROUP_SOCK_ADDR
- bpf programs can be loaded into kernel
- bpf link can be used

install:
- load bpf_object from bpf skeleton
- resize rules map to fit socket_bind_allow and socket_bind deny rules
from cgroup context
- populate cgroup-bpf maps with rules
- get bpf programs from bpf skeleton
- attach programs to unit cgroup using bpf link
- save bpf link in the unit
2021-04-26 16:21:59 -07:00
Julia Kartseva
b18e9fc167 cgroup: add socket-bind to cgroup context 2021-04-26 16:21:59 -07:00
Julia Kartseva
43b3f0fb00 shared, bpf: add bpf link helpers
add can_link_bpf_program and bpf_link_free helpers.
2021-04-26 16:21:59 -07:00
Julia Kartseva
09fc220c52 meson, bpf: add build rule for socket-bind program 2021-04-26 16:21:59 -07:00
Julia Kartseva
7d861e1263 meson, bpf: add HAVE_LIBBPF, BPF_FRAMEWORK options
* Add `bpf-framework` feature gate with 'auto', 'true' and 'false' choices
* Add libbpf [0] dependency
* Search for clang llvm-strip and bpftool binaries in compile time to
generate bpf skeleton.

For libbpf [0], make 0.2.0 [1] the minimum required version.
If libbpf is satisfied, set HAVE_LIBBPF config option to 1.

If `bpf-framework` feature gate is set to 'auto', means that whether
bpf feature is enabled or now is defined by the presence of all of
libbpf, clang, llvm and bpftool in build
environment.
With 'auto' all dependencies are optional.
If the gate is set to `true`, make all of the libbpf, clang and llvm
dependencies mandatory.
If it's set to `false`, set `BPF_FRAMEWORK` to false and make libbpf
dependency optional.

libbpf dependency is dynamic followed by the common pattern in systemd.

meson, bpf: add build rule for socket_bind program
2021-04-26 16:20:58 -07:00
Julia Kartseva
cf4f9a57f2 bpf: add build script for bpf programs
Add a build script to compile bpf source code. A program in restricted
C is compiled into an object file. Object file is converted to BPF
skeleton [0] header file.
If build with custom meson build rule, the target header will reside in
build/ directory (not in source tree), e.g the path for socket_bind:
`build/src/core/bpf/socket_bind/socket-bind.skel.h`

Script runs the phases:
* clang to generate *.o from restricted C
* llvm-strip to remove useless DWARF info
* bpf skeleton generation with bpftool
These phases are logged to stderr for debug purposes.

To include BTF debug information, -g option is passed to clang.

[0] https://lwn.net/Articles/806911/
2021-04-26 16:07:41 -07:00
Julia Kartseva
58a33faf80 bpf: add socket-bind BPF program code sources
Introduce BPF program compiled from BPF source code in
restricted C - socket-bind.
It addresses feature request [0].

The goal is to allow systemd services to bind(2) only to a predefined set
of ports. This prevents assigning socket address with unallowed port
to a socket and creating servers listening on that port.

This compliments firewalling feature presenting in systemd:
whereas cgroup/{egress|ingress} hooks act on packets, this doesn't
protect from untrusted service or payload hijacking an important port.

While ports in 0-1023 range are restricted to root only, 1024-65535
range is not protected by any mean.

Performance is another aspect of socket_bind feature since per-packet
cost can be eliminated for some port-based filtering policies.

The feature is implemented with cgroup/bind{4|6} hooks [1].
In contrast to the present systemd approach using raw bpf instructions,
this program is compiled from sources. Stretch goal is to
make bpf ecosystem in systemd more friendly for developer and to clear
path for more BPF programs.

[0] https://github.com/systemd/systemd/pull/13496#issuecomment-570573085
[1] https://www.spinics.net/lists/netdev/msg489054.html
2021-04-26 16:07:41 -07:00
Zbigniew Jędrzejewski-Szmek
ea1036e253
Merge pull request #19416 from mrc0mmand/test-id-detection
test: "detect" the test number automagically
2021-04-26 23:03:13 +02:00
Frantisek Sumsal
9abef4b1b4 test: reorganize the TEST-52 a bit 2021-04-26 19:24:47 +02:00
Frantisek Sumsal
6695c41c31 test: add a couple of hooks for the check_result_*() functions
So we don't have to duplicate the whole functions if we need to inject
some test-specific checks.
2021-04-26 19:24:41 +02:00
Frantisek Sumsal
c4cd6205e0 test: "detect" the test number automagically
Specifying the test number manually is tedious and prone to errors (as
recently proven). Since we have all the necessary data to work out the
test number, let's do it automagically.
2021-04-26 19:20:18 +02:00
Frantisek Sumsal
732a487fad
Merge pull request #19383 from keszybz/test58-fixes
Fixes for TEST-58-REPART and ExecStart deserialization logic
2021-04-26 19:16:44 +02:00
Yu Watanabe
e1220a70de test-network: add tests for RoutesToNTP= 2021-04-27 00:01:18 +09:00
Yu Watanabe
d7b0450639 network: dhcp4: introduce RoutesToNTP= boolean setting 2021-04-27 00:01:18 +09:00
Yu Watanabe
949b2c95c9 network: dhcp4: split and rename link_set_dns_routes() 2021-04-27 00:01:18 +09:00
Yu Watanabe
7057030610 network: dhcp4: enable RoutesToDNS= by default 2021-04-27 00:01:18 +09:00
Zbigniew Jędrzejewski-Szmek
35243b7736 test-unit-serialize: add a very basic test that command deserialization works
We should test both serialization and deserialization works properly.
But the serialization/deserialization code is deeply entwined with the
manager state, and I think quite a bit of refactoring will be required before
this is possible. But let's at least add this simple test for now.
2021-04-26 16:15:26 +02:00
Zbigniew Jędrzejewski-Szmek
2b4d791e41
Merge pull request #19286 from yuwata/network-dhcp-routes-to-dns-19077
network: dhcp4: set gateway for route to dns server if it is not in the same network
2021-04-26 15:10:41 +02:00
Yu Watanabe
0e27527170 network: update comment and log message
After 4b30f2e135ee84041bb597edca7225858f4ef4fb, reading stable_secret
sysctl property fails with -ENOMEM, instead of -EIO.
This is due to read_full_virtual_file() uses read() as the backend while
read_one_line_file() uses fgetc(). And each functions return different
error on fails.

Anyway, the failure is harmless here. So, the log message and comment is
updated.

Closes one of the issues in #19410.
2021-04-26 10:08:41 +01:00
Luca Boccassi
bb35478bf9
Merge pull request #19421 from yuwata/fix-typo
core, network: Fix typo
2021-04-26 10:08:07 +01:00
Yu Watanabe
25054e1bfb network: add missing sections
Follow-up for 4e26a5baa0045c8bbb899f0c72f07ac630692bd3.

Fixes one of issues in #19410.
2021-04-26 10:07:52 +02:00
Yu Watanabe
8170992a79 core/service: fix typo
Follow-up for bbe19f68846bb3cd5fcf3e4f612268064df53b53.
2021-04-26 09:20:30 +09:00
Yu Watanabe
cead8ed66e network: fix typo
Follow-up for 4b409e855b18c263b0526c826fdca16215a4cf2e.
2021-04-26 09:19:41 +09:00
Lennart Poettering
be8fc0ef2e
Merge pull request #19411 from poettering/homectl-fixes
homectl password caching fixes
2021-04-24 09:17:38 +02:00
Lennart Poettering
57bb9bcba5 homectl: pick up cached/credential store/env var passwords *before* issuing first request
Previously, we'd generally attempt the operation first, without any
passwords, and only query for a password if that operation then fails
and asks for one. This is done to improve compatibility with
password-less authentication schemes, such as security tokens and
similar.

This patch modifies this slightly: if a password can be acquired cheaply
via the keyring password cache, the $CREDENTIALS_PATH credential store,
or the $PASSWORD/$PIN environment variables, acquire it *before* issuing
the first requested.

This should save us a pointless roundtrip, and should never hurt.
2021-04-23 23:22:37 +02:00
Lennart Poettering
7bdbafc261 homectl: don't use password cache if we operate on other user 2021-04-23 23:22:37 +02:00
Lennart Poettering
ea086f0610 homectl: don't use cached passwords when re-requesting password because wrong
Asking repeatedly for a password is pointless if we always use the same
cached one. Let's thus disable cache use whenever we failed already
once.
2021-04-23 23:18:43 +02:00
Lennart Poettering
43ed3d294a test: use systemd-run -P instead of -t in TEST-50
We want to use the result in a shell pipeline hence use -P mode (pipe
mode) instead of -t mode (interactive tty mode) for systemd-run.

This shouldn't change much about the test, but is slightly more correct
(and quicker).
2021-04-23 22:23:19 +02:00
Zbigniew Jędrzejewski-Szmek
954c77c251 tests: use setfacl to give $SUDO_USER read permissions on artifacts
We have to invoke the tests as superuser, and not being able to read
the journal as the invoking user is annoying. I don't think there are
any security considerations here, since the invoking user can already
put arbitrary code in the Makefile and test scripts which get executed
with root privileges.
2021-04-23 20:19:09 +02:00
Lennart Poettering
cd4d2b1777 update TODO 2021-04-23 17:57:26 +02:00
Lennart Poettering
400c1e8f98 gpt-auto-generator: pull in systemd-growfs@.service if new GPT growfs partition flag is set 2021-04-23 17:57:22 +02:00
Lennart Poettering
66e482cbdb man: document the new grow-file-system flag 2021-04-23 17:57:19 +02:00
Lennart Poettering
1c41c1dc34 repart: add GrowFileSystem= setting to set new GPT partition flag for newly created partitions
And set it to on by default, except if partition is marked read-only.
2021-04-23 17:56:55 +02:00
Lennart Poettering
c65f854af6 tree-wide: enable automatic growing of file systems in images in various tools that deal with OS images
Let's enable this in all tools that intend to write to the OS images.
It's not conditionalized for now, as there already is conditionalization
in the existance or absence of the flag in the GPT partition table (and
it's opt-in), hence it should be OK to just enable this by default for
now if the flag is set.
2021-04-23 17:56:51 +02:00
Lennart Poettering
74a54baeec dissect: enable growfs by default, but make it configurable
This adds a new --growfs=yes|no switch to systemd-dissect, defaulting to
on.
2021-04-23 17:56:34 +02:00
Lennart Poettering
81939d9d5e dissect-image: optionally, grow file systems on mount
The new GPT partition flag the previous commits added is now honoured on
mount.
2021-04-23 17:56:23 +02:00
Lennart Poettering
ee8e497d24 dissect: show growfs flag in systemd-dissect table output 2021-04-23 17:56:19 +02:00
Lennart Poettering
de98f63140 dissect: look for new GPT partition flag marking partitions for growing
systemd-repart can grow partitions dynamically at boot, but it won't
grow the file systems inside them. In /etc/fstab you can request that
via x-systemd.growfs. So far we didn't have a nice scheme for images
with GPT auto-discovery however, and that meant in particular in tools
such as systemd-nspawn the file systems couldn't be grown automatically.

Let's address this: let's define a new GPT partition flag that can be
set for our partition types. If set it indicates that the file system
should be grown to the partition size on mount.

This commit adds the flag and adds code to discover it when dissecting
images. There's no code yet to actually do something about it.
2021-04-23 17:55:45 +02:00
Luca Boccassi
778139c6e4
Merge pull request #19156 from dtardon/enable-warn
install: warn if WantedBy targets don't exist
2021-04-23 16:43:45 +01:00
Lennart Poettering
d2194e15db fstab-generator: clean up mount point flags handling
Let's rename MountpointsFlags → MountPointFlags. In most of our codebase
we name things mount_point/MountPoint rather than mountpoint/Mountpoint,
do so here too.

Also, prefix the enum values with "MOUNT_". The fact the enum values
weren#t prefixed was pretty unique in our codebase, and pretty
surprising. Let's fix that.

This is just refactoring, no actual change in behaviour
2021-04-23 16:55:29 +02:00
Zbigniew Jędrzejewski-Szmek
9020479246 core/service: also reject deserialized commands with no argv[0]
I'm pretty sure that bad things would happen later on.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek
1a128a468d core/service: fix deserialization of non-absolute commands
We'd fail with:
Apr 23 10:58:26 systemd[1]: Deserializing state...
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Failed to parse serialized command "ExecStart 0 sh "sh" "-e" "-x" "-c" "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"": Invalid argument
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Reinstalled deserialized job testsuite-01.service/start as 209

This was missed in 5008da1ec1, and apparently nobody noticed until now :(
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek
f89a20f1d4 TEST-58: exit immediately if systemd-repart is not available
Debian disables systemd-repart at config time.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek
dd1fa6c89a TEST-58: only run under qemu
In a container, /dev/loop* will most likely be inaccessible.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek
7bf20e48bd test: move the logic to support /skipped into shared logic
The logic to query test state was rather complex. I don't quite grok the point
of ret=$((ret+1))… But afaics, the precise result was always ignored by the
caller anyway.
2021-04-23 15:12:35 +02:00
Zbigniew Jędrzejewski-Szmek
7b87fe4c30 various: print the image path when setting up of the loopback device fails 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
409607c111 core: fix typos in comment 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
3d3aafa453 TODO: add some items for repart 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
b0f04bafe0 TEST-58: remove stale artifacts to not fail on repeated invocations
We would remove stuff only if successful, so repeated invocations would
trivially fail.

Also drop "-f", so that if we expect to remove something, it must be there.
2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
0dd77c159a tests: install mkfs.ext4, mkfs.vfat and modules into the test image
This allows TEST-58-REPART to at least start. It fails later with with loopback
device errors.
2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
30f56248f5 TEST-58: adjust whitespace and enable pipefail 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek
86df23b67c TEST-58: execute the right test 2021-04-23 15:11:38 +02:00
Frantisek Sumsal
6f47e45c67 test: configure swap for TEST-55-OOMD
oomd works way better with swap, so let's make the test less flaky by
configuring a swap device for it. This also allows us to drop the ugly
`cat`s from the load-generating script.
2021-04-23 14:36:14 +02:00
jiangchuangang
3a1e9d8083 logind:add missing equal sign 2021-04-23 11:56:16 +01:00
Lennart Poettering
2f166bb79b man: document _outbound 2021-04-23 12:02:24 +02:00
Lennart Poettering
ee18f107d3 resolved: synthesize _outbound magic hostname here too 2021-04-23 12:02:20 +02:00
Lennart Poettering
a1fdbcbe3d nss-myhostname: expose the "outbound" IP addresses under the synthetic "_outbound" hostname
I found myself often looking for a quick way to determine "the local IP
address", and then being lost in the "ip addr" output to find for the
right one to use. This is supposed to help a bit with that. Let's
introduce a new special hostname "_outbound" with semantics similar to
"_gateway" that resolves to addresses that are the closest I could come
up with that maps to "the" local IP address.
2021-04-23 12:02:11 +02:00
Lennart Poettering
54e6f97bc9 local-addresses: add helper for determining local "outbound" IP addresses
This adds a small helper, similar in style to local_addresses() and
local_gateways() that determines the local "outbound" addresses.

What's an "outbound" address supposed to be? The local IP addresses that
are the most likely used for outbound communication. It's determined
by using connect() towards the default gws on an UDP socket, and then
reading the address of the socket this caused it to be bound to.

This is not the "public" or "external" IP address of the local system,
and is not supposed to be. It's just the local IP addresses that are
likely the ones going to be used by the local IP stack for
communication with other hosts.
2021-04-23 12:01:41 +02:00
Lennart Poettering
ce0cedacc4
Merge pull request #19124 from takaswie/topic/fw-audio-entries
hwdb/rule: add database and rules for known audio  and music unit in IEEE 1394 bus
2021-04-23 11:31:34 +02:00
Flos Lonicerae
c44a285c41
Add D-Bus property exposing Ctrl-Alt-Delete action (#19217) 2021-04-23 09:57:14 +02:00
David Tardon
8adbad370f test-install-root: add test for unknown WantedBy= target 2021-04-23 07:28:37 +02:00
Jan Synacek
8ae27441c2 install: warn if WantedBy targets don't exist
Currently, if [Install] section contains WantedBy=target that doesn't exist,
systemd creates the symlinks anyway. That is just user-unfriendly.
Let's be nice and warn about installing non-existent targets.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1835351.

Replaces: #15834
2021-04-23 07:28:37 +02:00
David Tardon
cd228002cc test-install-root: create referenced targets 2021-04-23 07:28:37 +02:00
Yu Watanabe
625772c9c1 test-network: update tests for DHCP routes
This removes static-route option from the default dnsmasq command.
2021-04-23 08:49:29 +09:00
Yu Watanabe
3e42968342 network: dhcp4: ignore null dns address 2021-04-23 08:49:29 +09:00
Yu Watanabe
afe23f876e network: dhcp4: set gateway for route to DNS server if it is not in the same network
Fixes #19077.
2021-04-23 08:49:29 +09:00
Yu Watanabe
7f206276ad network: dhcp4: ignore gateway in static routes if destination is link-local or in the same network
This also configures routes to gateways in static routes if the
destination is not in the same network.
2021-04-23 08:49:29 +09:00
Yu Watanabe
b714d9a6e3 network: dhcp4: also set route MTU to prefix route and DNS routes 2021-04-23 08:49:29 +09:00
Yu Watanabe
ec39af3249
Merge pull request #19392 from yuwata/network-dhcp-split-link_set_dhcp_routes
network: split link_set_dhcp_routes() into smaller functions
2021-04-23 08:32:46 +09:00
Lennart Poettering
4990780ed0
Merge pull request #19336 from pdmorrow/reloading_restart
core,test: services in reloading state should exit without waiting TimeoutStartSec
2021-04-22 16:39:06 +02:00
Dimitri John Ledkov
a25100488b
Merge pull request #19346 from mihajlov/dhcp_broadcast_l3
network: enable DHCP broadcast flag if required by interface
2021-04-22 14:22:50 +01:00
Luca Boccassi
f1db009d0e
Merge pull request #19390 from poettering/repart-copy-fixes
repart: fix CopyFiles= corner case when copying into root dir of newly formatted fs
2021-04-22 14:06:10 +01:00
Lennart Poettering
7d25c2463f dissect: fix two minor typos in comments 2021-04-22 13:39:01 +01:00
Emil Renner Berthing
a00ff2e1b5 boot/efi: compile on riscv64
This makes systemd-boot compile against the latest gnu-efi which
just added support for riscv64.
2021-04-22 14:37:25 +02:00
Lennart Poettering
c1737506f3 dissect-image: prefer PARTN= uevent property over "partition" sysfs attr
The kernel will send us a PARTN= uevent proprty with partition add
events, let's use it instead of going for the "partition" sysfs attr.
It's less racy that way and there are reports the sysfs attr shows up
after the device, which makes it evern worse.
2021-04-22 14:31:27 +02:00
Peter Morrow
f209d8f50c test: add a test to cover restarting services in reloading state
Cover the case where a service is recovered out of reloading state via
a restart Restart= configuration.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2021-04-22 09:33:37 +01:00
Peter Morrow
bbe19f6884 core: allow services stuck in reloading state to exit
If a service is in reloading state but has exited do not delay
the final exit until the service reload timer expires. Instead allow
the service to exit immediately since we can't expect the service to
ever transition out of reloading state.

For example if a service sent RELOADING=1 but crashed before it could
send READY=1 then it should be restarted if the service had
Restart= configured.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
2021-04-22 09:28:50 +01:00
Jóhann B. Guðmundsson
eb34cce178 fix: point to the correct drop-ins subdirectory for confs 2021-04-22 09:36:14 +02:00
Lennart Poettering
5a44565cb7 gpt: we actually honour the ReadOnly= flag on XBOOTLDR partitions too
The partition type is defined in our Discoverable Partition Spec, and we
honour the flag for it, hence allow setting it too.
2021-04-22 09:34:41 +02:00
Yu Watanabe
e1c08a3d0a network: dhcp4: simplify link_set_dns_routes() 2021-04-22 12:49:56 +09:00
Yu Watanabe
ff2cf67740 network: dhcp4: introduce link_set_dhcp_gateway() and link_set_dhcp_route_to_gateway() 2021-04-22 12:49:56 +09:00
Yu Watanabe
7872d0f7b6 network: dhcp4: introduce link_set_dhcp_static_routes() 2021-04-22 12:49:56 +09:00
Yu Watanabe
c0fef8f349 network: dhcp4: introduce link_set_dhcp_prefix_route() 2021-04-22 12:49:56 +09:00
Lennart Poettering
f21a3a82fb repart: don't try to extract directory of root dir when copying directories
It's OK to specify the root dir as target directory when copying
directories. However, in that case path_extract_filename() is going to
fail, because the root dir simply has not filename.

Let's address that by moving the call further down into the loop, when
we made sure that the target dir doesn't exist yet (the root dir always
exists, hence this check is sufficient).

Moreover, in the branch for copying regular files, also move the calls
down, and generate friendly error messages in case people try to
overwrite dirs with regular files (and the root dir is just a special
case of a dir).

Altogether this makes CopyFiles=/some/place:/ work, i.e. copying some
dir on the host into the root dir of the newly created fs. Previously
this would fail with an error about the inability to extract a filename
from "/", needlessly.
2021-04-21 23:30:49 +02:00
Lennart Poettering
e28190673c repart: don't use basename() when we called path_extract_filename() anyway already
We already have the string, use it.
2021-04-21 23:30:46 +02:00
Lennart Poettering
554a2b6493 repart: prefix the correct path with root dir in log output
When we copy files into the freshly formatted file system, the mount
point prefix must be prepended to the *target* path, not the *source*
path. Not just in code but in the log message about it, too.
2021-04-21 23:30:00 +02:00
Zbigniew Jędrzejewski-Szmek
7feb1dd654
Merge pull request #19387 from poettering/discoverable-part-fix
minor doc fixes
2021-04-21 23:10:48 +02:00
Igor Zhbanov
4c54768c97 journald: Retry if posix_fallocate returned -1 (EINTR)
On some conditions (particularly when mobile CPUs are going to sleep),
the posix_fallocate(), which is called when a new journal file is allocated,
can return -1 (EINTR). This is counted as a fatal error. So the journald
closes both old and journals, and simply throwing away further incoming
events, because of no log files open.

Introduce posix_fallocate_loop() that restarts the function in the case
of EINTR. Also let's make code base more uniform by returning negative
values on error.

Fix assert in test-sigbus.c that incorrectly counted positive values as
success. After changing the function return values, that will actually work.

Fixes: #19041

Signed-off-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
2021-04-21 23:08:35 +02:00
Lennart Poettering
eb3c3a89c9 doc: slightly reorder/improve partition type table
Let's put swap and generic linux data partitions next to each other, and
clarify they predated this spec.
2021-04-21 22:25:10 +02:00
Lennart Poettering
1d6ca0a219 doc: verity partitions may only contain Verity data (fix copypasta) 2021-04-21 22:25:08 +02:00
Lennart Poettering
60c6c2101c man: --add was renamed --copy-to when it was merged, fix man page reference to it 2021-04-21 22:24:38 +02:00
Lennart Poettering
6f4a5f25fc
Merge pull request #19271 from yuwata/dhcp-duid-uuid
network: fix issues arround DHCP DUID-UUID
2021-04-21 21:59:35 +02:00
Lennart Poettering
e19479aa7d
Merge pull request #19365 from keszybz/sd_id128_equals
Add sd_id128_in_set()
2021-04-21 21:45:14 +02:00
Lennart Poettering
192b31f28f update TODO 2021-04-21 21:44:02 +02:00
Lennart Poettering
347d8a2889
Merge pull request #19381 from poettering/generator-tweaks
generator: two minor tweaks
2021-04-21 18:33:05 +02:00
Lennart Poettering
2b66f48e4e generator: write out special systemd-fsck-usr.service
So far all file systems where checked by instances of
systemd-fsck@.service, with the exception of the root fs which was
covered by systemd-fsck-root.service. The special handling is necessary
to deal with ordering issues: we typically want the root fs to be
checked before all others, and — weirdly — allow mounting it before the
fsck done (for compat with initrd-less boots).

This adds similar special handling for /usr: if the hierarchy is placed
on a separate file system check it with a special
systemd-fsck-usr.service instead of a regular sysemd-fsck@.service
instance. Reason is again ordering: we want to allow mounting of /usr
without the root fs already being around in the initrd, to cover for
cases where the root fs is created on first boot and thus cannot be
mounted/checked before /usr.
2021-04-21 18:32:29 +02:00
Zbigniew Jędrzejewski-Szmek
1f2a7ca7ac
Merge pull request #19362 from yuwata/network-dhcp6-pd-log-19354
network: dhcp6: add logs about delegated prefix
2021-04-21 18:20:49 +02:00
Zbigniew Jędrzejewski-Szmek
59ab650fc5
Merge pull request #19370 from mrc0mmand/shellcheck-pt4
More shellcheck shenanigans
2021-04-21 18:14:32 +02:00
Viktor Mihajlovski
e70eca9b48 network: enable DHCP broadcast flag if required by interface
Some interfaces require that the DHCPOFFER message is sent via broadcast
if they can't receive unicast messages before they've been configured
with an IP address.

E.g., s390 ccwgroup network interfaces operating in layer3 mode face
this limitation. This can prevent the interfaces from receiving an
IP address via DHCP, if the have been configured for layer3.

To allow DHCP over such interfaces, we're introducing a new device
property ID_NET_DHCP_BROADCAST which can be set for those.
The networkd DHCP client will check whether this property is set
for an interface, and if so will set the broadcast flag, unless
the network configuration for the interface has an explicit
RequestBroadcast setting.

Besides that, we're adding a udev rule to set this device property
for ccwgroup devices operating in layer3 mode, which is the case
if the ID_NET_DRIVER property is qeth_l3.

Supercedes #18829
2021-04-21 18:11:18 +02:00
Zbigniew Jędrzejewski-Szmek
da1af43dc1 repart: reword log message
The UUID does not exist, a partion with the UUID exists. So let's
say that the UUID is "already used" for clarity.
2021-04-21 17:51:24 +02:00
Zbigniew Jędrzejewski-Szmek
580f48cc02 partition,shared/gpt: use sd_id128_in_set()
I was worried that the text size will grow, but apparently that's not the
case:
With --optimization=2:
$ size build/src/shared/libsystemd-shared-248.a.p/gpt.c.o*
   text	   data	    bss	    dec	    hex	filename
   3674	   1104	      0	   4778	   12aa	build/src/shared/libsystemd-shared-248.a.p/gpt.c.o.old
   3085	   1104	      0	   4189	   105d	build/src/shared/libsystemd-shared-248.a.p/gpt.c.o

(I don't understand the generated assembly, even though it seems to work:

Disassembly of section .text.gpt_partition_type_is_usr_verity:

0000000000000000 <gpt_partition_type_is_usr_verity>:

bool gpt_partition_type_is_usr_verity(sd_id128_t id) {
   0:   48 83 ec 08             sub    $0x8,%rsp
        return sd_id128_in_set(id,
   4:   4c 8b 05 00 00 00 00    mov    0x0(%rip),%r8        # b <gpt_partition_type_is_usr_verity+0xb>
   b:   31 c0                   xor    %eax,%eax
   d:   4c 8b 0d 00 00 00 00    mov    0x0(%rip),%r9        # 14 <gpt_partition_type_is_usr_verity+0x14>
  14:   48 8b 15 00 00 00 00    mov    0x0(%rip),%rdx        # 1b <gpt_partition_type_is_usr_verity+0x1b>
  1b:   48 8b 0d 00 00 00 00    mov    0x0(%rip),%rcx        # 22 <gpt_partition_type_is_usr_verity+0x22>
  22:   6a 00                   pushq  $0x0
  24:   6a 00                   pushq  $0x0
  26:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 2c <gpt_partition_type_is_usr_verity+0x2c>
  2c:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 32 <gpt_partition_type_is_usr_verity+0x32>
  32:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 38 <gpt_partition_type_is_usr_verity+0x38>
  38:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 3e <gpt_partition_type_is_usr_verity+0x3e>
  3e:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 44 <gpt_partition_type_is_usr_verity+0x44>
  44:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 4a <gpt_partition_type_is_usr_verity+0x4a>
  4a:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 50 <gpt_partition_type_is_usr_verity+0x50>
  50:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 56 <gpt_partition_type_is_usr_verity+0x56>
  56:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 5c <gpt_partition_type_is_usr_verity+0x5c>
  5c:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 62 <gpt_partition_type_is_usr_verity+0x62>
  62:   e8 00 00 00 00          callq  67 <gpt_partition_type_is_usr_verity+0x67>
  67:   85 c0                   test   %eax,%eax
  69:   0f 95 c0                setne  %al
                               GPT_USR_ARM_VERITY,
                               GPT_USR_ARM_64_VERITY,
                               GPT_USR_IA64_VERITY,
                               GPT_USR_RISCV32_VERITY,
                               GPT_USR_RISCV64_VERITY);
}
  6c:   48 83 c4 68             add    $0x68,%rsp
  70:   c3                      retq
)
2021-04-21 17:51:24 +02:00
Zbigniew Jędrzejewski-Szmek
64b21afc72 sd-id128: add convenience functions to compare multiple sd_id128_t
Similar to sd_bus_error_has_names() that was added in
2b07ec316a0e25a3e10c270c7f6baee9e0187bf8.

It is made inline in the hope that the compiler will be able to optimize
all the va_args boilerplate away, and do an efficient comparison when
the arguments are all constants.
2021-04-21 17:51:24 +02:00
Yangyang Shen
80e9720616 journald: enforce longer line length limit during "setup" phase of stream protocol
This PR made modification on Lennart Poettering's basis. Fix the LineMax's function failure problem.

Signed-off-by: Yangyang Shen <shenyangyang4@huawei.com>
2021-04-21 17:22:24 +02:00
Lennart Poettering
599aee40a3 generator: explain why systemd-root-fsck.service exists in a comment 2021-04-21 15:18:07 +02:00
Lennart Poettering
122860f102 generator: exit early when asked to generate fsck unit for / and /usr in initrd
Let's exit early if we are invoked to generate an fsck unit for the
rootfs or /usr of the initrd itself. The "systemd-root-fsck.service" and
"systemd-usr-fsck.service" units are after all for the host file
systems, and the initrd file hierarchy is from an unpacked cpio anyway.
Hence, this semantically doesn't really make sense, so quickly exit if
we detect this case. This allows us to remove some checks further down
the codepath.
2021-04-21 15:18:07 +02:00
Yu Watanabe
28f9667d05 network: dhcp: constify link_get_duid() 2021-04-21 21:00:45 +09:00
Yu Watanabe
8c72f5c077 network: dhcp: introduce duid_needs_product_uuid() helper function 2021-04-21 21:00:45 +09:00
Yu Watanabe
294f129b0d network: configure non-dhcp configs earlier even DUID-UUID is used by DHCP clients
Previously, if DUID-UUID is used, all configurations are configured
after networkd gets product uuid of machine.

This makes only DHCP clients are delayed, and other configs are
configured earlier.
2021-04-21 21:00:45 +09:00
Yu Watanabe
4e26a5baa0 network: make IAID and DUID for DHCPv6 configurable explicitly
Closes #18996.
2021-04-21 21:00:11 +09:00
Yu Watanabe
cde74a65c1 network: move dhcp related conf parsers to networkd-dhcp-common.c 2021-04-21 20:56:58 +09:00
Yu Watanabe
b67bbfef14
Merge pull request #19344 from yuwata/network-route-metric-19028
network: add RouteMetric= setting in [Address] and more
2021-04-21 20:51:31 +09:00
Lennart Poettering
2671fbefce units: fix repart conditions to run if definitions exist in /sysroot + /sysusr
The systemd-repart code was already smart enough to look for definitions
there, but the unit file conditions made that pointless. Let's fix that.
2021-04-21 12:23:31 +01:00
Yu Watanabe
ea846e45c1 doc: fix typo 2021-04-21 09:57:30 +02:00
Zbigniew Jędrzejewski-Szmek
78aa5b6f59 man: mention sd_id128_is_allf(), SD_ID128_ALLF
It was added in 670814387ba8973245c08123e7240669f51a55a8, but not
mentioned in the man pages.
2021-04-21 08:45:05 +02:00
Zbigniew Jędrzejewski-Szmek
e0a41aa4c6 man: dedent examples in sd-id128 to 2 columns
In man pages, horizontal space it at premium, and everything should
generally be indented with 2 spaces to make it more likely that the
examples fit on a user's screen.

C.f. 798d3a524ea57aaf40cb53858aaa45ec702f012d.
2021-04-21 08:45:05 +02:00
Yu Watanabe
baad6421b1 network: dhcp6: logs about generated addresses in delegated prefix 2021-04-21 14:04:39 +09:00
Yu Watanabe
4b409e855b network: dhcp6: logs about delegated prefixes
Closes #19354.
2021-04-21 14:04:33 +09:00
Yu Watanabe
eccdc68771 in-addr-util: introduce 'struct in_addr_prefix' and hash ops for it 2021-04-21 13:57:47 +09:00
Yu Watanabe
93e44aa92f in-addr-util: add assertions 2021-04-21 13:57:47 +09:00
Yu Watanabe
3e726c156b test-network: update test for RouteMetric= 2021-04-21 13:55:02 +09:00
Yu Watanabe
4c0aae015f man: update explanation about route metric 2021-04-21 13:55:02 +09:00
Yu Watanabe
b3cde1c3f5 network: set metric for prefix route of IPv4 link-local address 2021-04-21 13:55:02 +09:00
Yu Watanabe
0e1fb1d09a network: radv: add RouteMetric= setting in [IPv6Prefix] 2021-04-21 13:55:02 +09:00
Yu Watanabe
9fe0b7b493 network: dhcp6-pd: add RouteMetric= setting in [DHCPv6PrefixDelegation] 2021-04-21 13:55:02 +09:00
Yu Watanabe
8ebafba9f9 network: move RouteMetric= from [DHCPv6] to [IPv6AcceptRA]
As the value is used in the routes in RA.
2021-04-21 13:55:02 +09:00
Yu Watanabe
415deef9c3 network: dhcp4: also apply RouteMetric= setting in [DHCPv4] to prefix route 2021-04-21 13:55:02 +09:00
Yu Watanabe
c4ff0629dd network: add RouteMetric= setting in [Address] section 2021-04-21 13:54:59 +09:00
Yu Watanabe
a8d21c91f9 network: show route metric in debug log 2021-04-21 13:42:45 +09:00
Yu Watanabe
0e7bb99ff9 sd-netlink: add missing address types 2021-04-21 13:42:08 +09:00
Lennart Poettering
5efbd0bf89
Merge pull request #19371 from poettering/repart-initrd-usr-only
two /sysusr/ changes for repart, split out of #19234
2021-04-20 23:46:17 +02:00
Lennart Poettering
0aa714778a
Merge pull request #19372 from poettering/repart-initrd-usr-begin
fstab-generator: mount.usr= handling changes, split out of #19234
2021-04-20 23:44:49 +02:00
Lennart Poettering
ac02dccabc
Merge pull request #19368 from poettering/loop-seqnum
loop-util: let's try harder to avoid loopback block device recycle issues
2021-04-20 23:43:57 +02:00
Frantisek Sumsal
3b6fd3c1de tools: shellcheck-ify most of the tool scripts 2021-04-20 20:11:13 +02:00
Lennart Poettering
3464514457 man: document new initrd-usr-fs.target 2021-04-20 19:11:07 +02:00
Lennart Poettering
632b551ca2 units: change order of settings to match order in other similar unit 2021-04-20 19:11:07 +02:00
Lennart Poettering
8f47e32a3e repart: use /sysusr/ as --root= default in initrd, if mounted 2021-04-20 18:53:15 +02:00
Lennart Poettering
a73b2ad041 repart: try harder to find OS prefix
This teaches repart to look for the root block device both as the
backing for /sysroot and for /sysusr/usr.

The latter is a new addition, and starts making more sense with the next
commit. It's about supporting systems that are shipped with only a /usr/
fs, but where a root fs is allocated and formatted on first boot via
systemd-repart (or a similar tool). In this case it's useful to be able
to mount the ultimate /usr/ early on without mounting the root fs
right-away (simple because the rootfs might not exist yet, and we need
the repart data encoded in /usr/ to actually format it). Hence, instead
of requiring that we mount /sysroot/ first and /sysroot/usr/ second as
we did so far, let's rearrange things slightly:

1. We mount the /usr/ file system we discover to /sysusr/usr/
2. We mount the root file system we discover to /sysroot/
3. Once both are established we bind mount /sysusr/usr/ to /sysroot/usr/

And that' it. The first two steps can happen in either order, and we can
access /usr/ with or without a rootfs being around.

This commit implements nothing of the above. Instead, it teaches
systemd-repart to check both /sysroot/ and /sysusr/ for repart drop-ins,
and use the first of these hierarchies it finds populated. This way
systemd-repart can be spawned once /usr is mounted and it will work
correctly without root fs having to exist, or we can invoke it when the
root fs is already mounted, where it also will work correctly.
2021-04-20 18:53:15 +02:00
Frantisek Sumsal
437e889b18 src: shellcheck-ify shell scripts 2021-04-20 18:39:36 +02:00
Lennart Poettering
fa138f5e26 fstab-generator: properly order generated mount units before "post" target units
Let's make sure, that our mount unit are properly ordered before the
"post" target unit even if DefaultDependencies= is used on the target
unit.
2021-04-20 18:26:17 +02:00
Lennart Poettering
e19ae92af6 fstab-generator: extend logging a bit 2021-04-20 18:26:17 +02:00
Lennart Poettering
29a24ab28e fstab-generator: if usr= is specified, mount it to /sysusr/usr/ first
This changes the fstab-generator to handle mounting of /usr/ a bit
differently than before. Instead of immediately mounting the fs to
/sysroot/usr/ we'll first mount it to /sysusr/usr/ and then add a
separate bind mount that mounts it from /sysusr/usr/ to /sysroot/usr/.

This way we can access /usr independently of the root fs, without for
waiting to be mounted via the /sysusr/ hierarchy. This is useful for
invoking systemd-repart while a root fs doesn't exist yet and for
creating it, with partition data read from the /usr/ hierarchy.

This introduces a new generic target initrd-usr-fs.target that may be
used to generically order services against /sysusr/ to become available.
2021-04-20 18:26:17 +02:00
Lennart Poettering
6e1454b4b9 ci: drop test/TEST-50-DISSECT/deny-list-ubuntu-ci
Let's see if this makes the test stable on the CI.
2021-04-20 17:21:22 +02:00
Lennart Poettering
4a62257d68 dissect: ignore udev database entries from before the loopback attachment
This tries to shorten the race of device reuse a bit more: let's ignore
udev database entries that are older than the time where we started to
use a loopback device.

This doesn't fix the whole loopback device raciness mess, but it makes
the race window a bit shorter.
2021-04-20 17:20:38 +02:00
Lennart Poettering
8ede1e86b2 loop-util: track CLOCK_MONOTONIC timestamp immediately before attaching a loopback device
This is similar to the preceding work to store the uevent seqnum, but
this stores the CLOCK_MONOTONIC timestamp.

Why? This allows to validate udev database entries, to determine if they
were created *after* we attached the device.

The uevent seqnum logic allows us to validate uevent, and the timestamp
database entries, hence together we should be able to validate both
sources of truth for us.

(note that this is all racy, just a bit less racy, since we cannot
atomically attach loopback devices and get the timestamp for it, the
same way we can't get the uevent seqnum. Thus is shortens the race
window, but doesn#t close it).
2021-04-20 17:20:38 +02:00
Lennart Poettering
8626b43be4 sd-device: add API to query from when a udev database entry is
We already store a CLOCK_MONOTONIC timestamp for each device appearance,
let' make this queriable.

This is useful to determine whether a udev device database entry is from
a current appearance of the device or a previous one, by comparing it
with appropriately taken timestamps.
2021-04-20 17:14:10 +02:00
Lennart Poettering
75dc190d39 dissect: ignore old uevents when waiting for loopback partition scan
Let's drop all monitor uevent that were enqueued before we actually
started setting up the device.

This doesn't fix the race, but it makes the race window smaller: since
we cannot determine the uevent seqnum and the loopback attachment
atomically, there's a tiny window where uevents might be generated by
the device which we mistake for being associated with out use of the
loopback device.
2021-04-20 17:14:10 +02:00
Lennart Poettering
31c75fcc41 loop-util: read kernel's uevent seqnum right before attaching a loopback device
Later, this will allow us to ignore uevents from earlier attachments a
bit better, as we can compare uevent seqnums with this boundary. It's
not a full fix for the race though, since we cannot atomically determine
the uevent and attach the device, but it at least shortens the window a
bit.
2021-04-20 17:13:56 +02:00
Lennart Poettering
79e8393a6a loop-util: initialize .devno in loop_device_open() too 2021-04-20 17:12:39 +02:00
Lennart Poettering
b0dbffd868 loop-util: port to random_u64_range()
Doesn't matter, but it's a bit easier to read I'd claim.
2021-04-20 17:12:39 +02:00
Lennart Poettering
38bd449f96 loop-util: make loop_device_make() return fd in all code paths
Previously, loop_device_make() would return the device fd in one success
code path, but not the other (where' we'd just return 0).
loop_device_open() returns it in all cases.

Hence, let's clean this up, and make sure in all success code paths of
both functions we return it (even though it strictly speaking is
redundant, since we return it in LoopDevice anyway, and currently noone
actually relies on this).
2021-04-20 17:12:39 +02:00
Lennart Poettering
02ef01ade3 sd-device: use right clock when comparing initialization usec
we actually use CLOCK_MONOTONIC for the timestamp, hence when
comparing/subtracting it from the current time, also use
CLOCK_MONOTONIC.
2021-04-20 17:12:39 +02:00
Lennart Poettering
a156eb89c8 sd-device: use right type for usec_initialized 2021-04-20 17:11:21 +02:00
Lennart Poettering
ee7561d014 update TODO 2021-04-20 16:32:24 +02:00
Yegor Alexeyev
c95df5879e relay role implementation 2021-04-20 15:11:53 +02:00
Yu Watanabe
d5bfddf037 man: fix typo
Follow-up for e73309c532999cb15490a78575dd882b24bbe96f.
2021-04-20 11:41:05 +01:00
Miroslav Suchý
0084d4f6b5 document DefaultOOMPolicy
the `man systemd.service` say:
   Defaults to the setting DefaultOOMPolicy= in systemd-system.conf(5) is set to
but there is no such line in this config.
This is the default value I extracted from
   systemctl show --property=DefaultOOMPolicy
2021-04-20 10:40:42 +02:00
Yu Watanabe
66205cb3f5 wifi-util: do not set zero errno to log_debug_errno() 2021-04-20 10:39:50 +02:00
Frantisek Sumsal
3f161ba9bc test: make the test entrypoint scripts shellcheck-compliant 2021-04-20 10:26:43 +02:00
Lennart Poettering
4d686e6b0b mount-util: make umount_and_rmdir_and_freep() cleanup handler deal with NULL 2021-04-20 10:23:30 +02:00
Lennart Poettering
fd2f6f7248
Merge pull request #19096 from poettering/repart-features
repart: four new features: CopyBlocks=auto + --image= + ReadOnly=/Flags= + MakeDirectories=
2021-04-20 10:20:22 +02:00
Peter Hutterer
7a4afd3a15 shell-completion: use base.lst, not xorg.lst
Since 2005 xorg.lst has been the legacy symlink to the real file base.lst.
2021-04-20 10:19:41 +02:00
Luca Boccassi
ba81458350
Merge pull request #19356 from zxzax/sd-login-typos
Fix some typos in sd-login header, docs
2021-04-19 22:26:36 +01:00
Lennart Poettering
7cc3966693 update TODO 2021-04-19 23:19:52 +02:00
Lennart Poettering
5a3b86404a test: add test for new repart features 2021-04-19 23:19:52 +02:00
Lennart Poettering
b620bf332f dissect: ext4 and loopback files are unimpressed by read-only access
Even if we set up a loopback device read-only and mount it read-only
this means nothing, ext4 will still write through to the backing storage
file.

Yes, I lost 6h debugging time on this.

Apparently, we have to specify "norecovery" when mounting such file
systems, to force them into truly read-only mode. Let's do so.
2021-04-19 23:16:02 +02:00
Lennart Poettering
e73309c532 repart: add new ReadOnly= and Flags= settings for repart dropins
Let's make the GPT partition flags configurable when creating new
partitions. This is primarily useful for the read-only flag (which we
want to set for verity enabled partitions).

This adds two settings for this: Flags= and ReadOnly=, which strictly
speaking are redundant. The main reason to have both is that usually the
ReadOnly= setting is the one wants to control, and it' more generic.
Moreover we might later on introduce inherting of flags from CopyBlocks=
partitions, where one might want to control most flags as is except for
the RO flag and similar, hence let's keep them separate.
2021-04-19 23:16:02 +02:00
Lennart Poettering
5c08da586f repart: add CopyBlocks=auto support
When using systemd-repart as an installer that replicates the install
medium on another medium it is useful to reference the root
partition/usr partition or verity data that is currently booted, in
particular in A/B scenarios where we have two copies and want to
reference the one we currently use. Let's add a CopyBlocks=auto for this
case: for a partition that uses that we'll copy a suitable partition
from the host.

CopyBlocks=auto finds the partition to copy like this: based on the
configured partition type uuid we determine the usual mount point (i.e.
for the /usr partition type we determine /usr/, and so on). We then
figure out the block device behind that path, through dm-verity and
dm-crypt if necessary. Finally, we compare the partition type uuid of
the partition found that way with the one we are supposed to fill and
only use it if it matches (the latter is primarily important on
dm-verity setups where a volume is likely backed by two partitions and
we need to find the right one).

This is particularly fun to use in conjunction with --image= (where
we'll restrict the device search onto the specify device, for security
reasons), as this allows "duplicating" an image like this:

    # systemd-repart --image=source.raw --empty=create --size=auto target.raw

If the right repart data is embedded into "source.raw" this will be able
to create and initialize a partition table on target.raw that carrries
all needed partitions, and will stream the source's file systems onto it
as configured.
2021-04-19 23:16:02 +02:00
Lennart Poettering
e81acfd251 gpt: add some simple helpers for categorizing GPT partition types 2021-04-19 23:16:02 +02:00
Lennart Poettering
f3859d5f55 loop-util: store device major/minor in LoopDevice object
Let's store this away. It's useful when matching up mounts (i.e.  struct
stat's .st_dev field) with loopback devices.
2021-04-19 23:16:02 +02:00
Lennart Poettering
d83d804863 repart: add high-level setting for creating dirs in formatted file systems
So far we already had the CopyFiles= option in systemd-repart drop-in
files, as a mechanism for populating freshly formatted file systems with
files and directories. This adds MakeDirectories= in similar style, and
creates simple directories as listed. The option is of course entirely
redundant, since the same can be done with CopyFiles= simply by copying
in a directory. It's kinda nice to encode the dirs to create directly in
the drop-in files however, instead of providing a directory subtree to
copy in somehere, to make the files more self-contained — since often
just creating dirs is entirely sufficient.

The main usecase for this are GPT OS images that carry only a /usr/
tree, and for which a root file system is only formatted on first boot
via repart.  Without any additional CopyFiles=/MakeDirectories=
configuration these root file systems are entirely empty of course
initially. To mount in the /usr/ tree, a directory inode for /usr/ to
mount over needs to be created.  systemd-nspawn will do so automatically
when booting up the image, as will the initrd during boot. However, this
requires the image to be writable – which is OK for npawn and
initrd-based boots, but there are plenty tools where read-only operation
is desirable after repart ran, before the image was booted for the first
time. Specifically, "systemd-dissect" opens the image in read-only to
inspect its contents, and this will only work of /usr/ can be properly
mounted. Moreover systemd-dissect --mount --read-only won't succeed
either if the fs is read-only.

Via MakeDirectories= we now provide a way that ensures that the image
can be mounted/inspected in a fully read-only way immediately after
systemd-repart completed. Specifically, let's consider a GPT disk image
shipping with a file usr/lib/repart.d/50-root.conf:

       [Partition]
       Type=root
       Format=btrfs
       MakeDirectories=/usr
       MakeDirectories=/efi

With this in place systemd-repart will create a root partition when run,
and add /usr and /efi into it as directory inods. This ensures that the
whole image can then be mounted truly read-only anf /usr and /efi can be
overmounted by the /usr partition and the ESP.
2021-04-19 23:16:02 +02:00
Lennart Poettering
78eee6ce4d repart: use free_and_strdup_warn() where appropriate 2021-04-19 23:16:02 +02:00
Lennart Poettering
be9ce0188e repart: deal with empty partition label sensibly
libfdisk appears to return NULL when encountering an empty partition
label, let's handle this sanely, and treat NULL and "" for the current
label as the same, but for the new label as distinct: there NULL means
nothing is set, and "" means an actual empty label.
2021-04-19 23:16:02 +02:00
Lennart Poettering
22163eb51b repart: handle DISCARD failing with EBUSY gracefully 2021-04-19 23:16:02 +02:00
Lennart Poettering
55d380144a repart: add one more overflow check 2021-04-19 23:16:02 +02:00
Lennart Poettering
d17db7b2bf repart: when we can't fit in all partitions explain how large the image would have to be 2021-04-19 23:16:02 +02:00
Lennart Poettering
252d626711 repart: add --image= switch
This is similar to the --image= switch in the other tools, like
systemd-sysusers or systemd-tmpfiles, i.e. it apply the configuration
from the image to the image.

This is particularly useful for downloading minimized GPT image, and
then extending it to the desired size via:

   # systemd-repart --image=foo.image --size=5G
2021-04-19 23:16:02 +02:00
Lennart Poettering
8e5f3cecdf repart: slightly improve error message if partition is not on dm-crypt/dm-verity 2021-04-19 23:16:02 +02:00
Lennart Poettering
0efb3f83da repart: move NOP destructors into shared code 2021-04-19 23:16:02 +02:00
Lennart Poettering
ef9c184d3d dissect: split read-only flag into two
Let's have one flag to request that when dissecting an image the
loopback device is made read-only, and another one to request that when
it is mounted to make it read-only. Previously both concepts were always
done read-only together.

(Of course, making the loopback device read-only but mounting it
read-write doesn't make too much sense, but the kernel should catch that
for us, no need to make restrictions from our side there)

Use-case for this: in systemd-repart we'd like to operate on images for
adding partitions. Thus we'd like to have the loopback device writable,
but if we read repart.d/ snippets from it, we want to do that read-only.
2021-04-19 23:16:02 +02:00
Lennart Poettering
0ade2213e6 repart: port more code to generic path_simplify_and_warn()
We have this nice helper, hence use it when parsing paths and logging
about it.
2021-04-19 23:16:02 +02:00
Lennart Poettering
a0ff997180 repart: fix incorrect error code propagation 2021-04-19 23:16:02 +02:00
Zbigniew Jędrzejewski-Szmek
05e13b3558 udev/cdrom_id: add forgotten return and fix typo
Fixup for 092c05717c.
2021-04-19 18:25:17 +01:00
Jason Francis
941c5275ea
sd-login: fix wrong constructor used in sd_login_monitor manpage example 2021-04-19 12:20:29 -04:00
Jason Francis
a8310e39e9
sd-login: correct prototype of sd_peer_get_cgroup 2021-04-19 12:13:03 -04:00
Yu Watanabe
4e6c50a5d4 core: add RestrictAddressFamilies=none to deny all address families
Closes #15753.
2021-04-19 11:47:08 +01:00
Luca Boccassi
8441993621
Merge pull request #19351 from keszybz/log-message-tweaks
Log message tweaks
2021-04-19 11:44:35 +01:00
Hans de Goede
189bde4a03 hwdb: Add accel orientation quirk for the Teclast Tbook 11 tablet
Add a quirk to fix the accelerometer orientation on the
Teclast Tbook 11 tablet.
2021-04-19 11:44:16 +01:00
Hans de Goede
e15c079010 60-autosuspend.hwdb: Add Sierra Wireless EM7345-LTE modem to autosuspend list
Add the Sierra Wireless EM7345-LTE modem to the list of USB devices which
can safely autosuspend. This helps the processor reach deaper PC# states
when idle.

This was tested on a ThinkPad8 tablet with such a modem builtin.
2021-04-19 11:43:38 +01:00
Zbigniew Jędrzejewski-Szmek
5c7466b492
Merge pull request #19330 from mrc0mmand/shellcheck-pt2
test: make test-functions shellcheck-compliant
2021-04-19 09:04:19 +02:00
Zbigniew Jędrzejewski-Szmek
59e8042ecd basic/log: change error for unset errno to ESTRPIPE
EIO is used in other contexts, so change ot something otherwise unused.
ENOTRECOVERABLE was also suggested, but it's used in various other places
in the code.

https://github.com/systemd/systemd/pull/19317#discussion_r614887661
2021-04-19 08:46:19 +02:00
Zbigniew Jędrzejewski-Szmek
19cdcd5dca logind: tweak log message
https://github.com/systemd/systemd/pull/19317#pullrequestreview-637765222
2021-04-19 08:37:57 +02:00
Zbigniew Jędrzejewski-Szmek
092c05717c udev/cdrom_id: use random_u64_range() and tweak log messages
https://github.com/systemd/systemd/pull/19317#pullrequestreview-637765222
2021-04-19 08:37:39 +02:00
sverdlin
3181521f92
systemd-networkd.socket: Add conflict with shutdown.target (#19348)
systemd-networkd.socket can re-start systemd-networkd.service in
shutdown and by doing this even stop shutdown.target leaving the
system in halfway-down state.

Fixes #4955.
2021-04-19 11:25:33 +09:00
Frantisek Sumsal
94009c27f4 test: rewrite kernel module handling
This code was partially broken, since the firmware directory was
undefined. Also, some of the parts were a dead code, since they relied
on code from the original dracut test suite.
2021-04-16 19:05:59 +02:00
Frantisek Sumsal
0f1947059b test: use arrays when applicable 2021-04-16 19:05:55 +02:00
Frantisek Sumsal
a33e2692e1 test: avoid using pipes in certain cases
`command -v <bin> | grep ...` can under certain conditions cause the
`command` to exit with SIGPIPE, which in combination with `set -o
pipefail` means that the tests sometimes randomly die during setup.
Let's avoid using pipes in such cases.
2021-04-16 19:05:42 +02:00
Frantisek Sumsal
96af59aabb test: use set -o pipefail
This breaks some existing loops which previously ignored if the piped
program exited with EC >0. Rewrite them to mitigate this (and also make
them more robust in some cases).
2021-04-16 19:05:37 +02:00
Frantisek Sumsal
1b8fcd9c63 test: shell code cleanup
Just some basic stuff, like double quotes around strings, using
predictable values for possibly unset variables, formatting, etc.
2021-04-16 18:49:37 +02:00
Yu Watanabe
6604fb0207 fileio: use take_fdopen_unlocked()
This fixes maybe-uninitialized warning:
```
../src/basic/fileio.c: In function ‘chase_symlinks_and_fopen_unlocked’:
../src/basic/fileio.c:1026:19: warning: ‘f’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1026 |         *ret_file = f;
      |         ~~~~~~~~~~^~~

```
2021-04-17 00:22:12 +09:00
Yu Watanabe
b4bc798f87
Merge pull request #19332 from yuwata/log_xxx_yyy_errno-follow-ups-19317
core,timedate,network: make log_unit_error_errno() or friends refuse zero errno
2021-04-16 23:44:32 +09:00
Yu Watanabe
4ab334472c
Merge pull request #19325 from sainAk/patch-1
hwdb: 60-keyboard:: merge Micro Star in MSI and  merge MSI Prestige And MSI Modern FnKeys and Special keys definitions
2021-04-16 20:01:10 +09:00
Yu Watanabe
74bd6ad016 network: update log message
In some optimization level with gcc, including netdev->ifname in log
message causes error.
2021-04-16 19:48:54 +09:00
Zbigniew Jędrzejewski-Szmek
b990afe152
Merge pull request #19290 from yuwata/network-dhcp-do-not-configure-twice
network: refuse to configure DHCP client more than once
2021-04-16 12:36:23 +02:00
Zbigniew Jędrzejewski-Szmek
b7c3447a2f
Merge pull request #19310 from yuwata/network-dhcp-anonymize
network: dhcp4: several fixes and cleanups for Anonymize=
2021-04-16 11:12:22 +02:00
Anita Zhang
169be51f94 man: correct requirements for systemd-oomd.service
Fixes: #19331
2021-04-16 09:50:44 +01:00
Aakash Singh
afb095e296 hwdb: merge MSI Prestige And MSI Modern FnKeys and Special keys definitions
'A10' was the model name for prestige series with 10th gen intel processors and 'SC' was the gpu config for a specific model
but now msi has refreshed these series with 11th gen intel processors so the model name becomes 'A11X' where x is gpu config name more info [here](https://www.msi.com/Business-Productivity/Prestige-14-A11X/Specification) and [here](https://www.msi.com/Business-Productivity/Prestige-15-A11X/Specification)
[this was the link for model comparison of 10th gen cpus](https://www.msi.com/Business-Productivity/Prestige-15-A10X/Specification) (Dead link now)
complete list of Prestige series laptops [here](https://www.msi.com/Business-Productivity/Products#?tag=Prestige-Series)

And modern series follows the same naming convention, full list of laptops [here](https://www.msi.com/Business-Productivity/Products#?tag=Modern-Series).

examples

Prestige series
Prestige 14 A10x ( 14inch Intel 10th gen )
Prestige 15 A11x ( 15inch Intel 11th gen )

First gen Modern Series
Modern 15 A10x  ( 15inch Intel 10th gen)
Modern 15 A4x ( 15inch AMD 4000 series)

Second gen Modern Series
Modern 15 B10x  ( 15inch Intel first gen modern laptop)
Modern 14 B4x ( 14inch AMD second gen modern laptop)

all these laptops have the same keyboard layouts with same functionality on windows (can be reviewed from their support manuals).
2021-04-16 12:49:45 +05:30
Aakash Singh
dcad324eea hwdb: merge Micro Star in MSI 2021-04-16 12:47:36 +05:30
Yu Watanabe
6064344894 network: make log_netdev_xxx_errno() refuse zero errno 2021-04-16 09:17:28 +09:00
Yu Watanabe
5b098203fd timedate: make log_unit_xxx_errno() refuse zero errno 2021-04-16 08:46:51 +09:00
Yu Watanabe
ac51363496 core: make log_unit_xxx_errno() refuse zero errno 2021-04-16 08:46:11 +09:00
Lennart Poettering
bc32241e6a core: use UNIT_TRIGGER at more places
Just some minor simplification.
2021-04-15 20:38:20 +01:00
Luca Boccassi
672e9aec1b
Merge pull request #19326 from keszybz/reorder-meson-status-output
Reorder meson status output
2021-04-15 20:37:29 +01:00
Luca Boccassi
2969369130
Merge pull request #19318 from yuwata/udev-ignore-additional-newline-on-verify-19314
udev: ignore additional newline at the end on verify
2021-04-15 20:36:55 +01:00
Luca Boccassi
2d8c8549ab
Merge pull request #19317 from keszybz/check-return-values-from-log_errno-functions
Check return values from log_errno functions
2021-04-15 20:33:54 +01:00
simmon
5c17a470a7 po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-04-15 20:16:19 +09:00
Zbigniew Jędrzejewski-Szmek
8d1c9489ef Assert zero is not passed to log_{device,rule,token}_*_errno() 2021-04-15 11:56:22 +02:00
Zbigniew Jędrzejewski-Szmek
9d9fed9ef4 Voidify log_{device,token,rule}_debug()
See analogous change for log_debug() for discussion.
2021-04-15 11:45:44 +02:00
Lennart Poettering
5c9f1c68f0 core: drop pointless assert()
We checked this literally two lines earlier, no point in checking so
quickly again.
2021-04-15 11:26:40 +02:00
Lennart Poettering
64e8e419d9 update TODO 2021-04-15 11:24:50 +02:00
Zbigniew Jędrzejewski-Szmek
2669c66614 core/selinux: fix wrong assertion when 0 is passed to log_debug
https://github.com/systemd/systemd/pull/19317#issuecomment-820245680
2021-04-15 11:18:37 +02:00
Zbigniew Jędrzejewski-Szmek
237f2da9d4 meson: output one "item" for DNS-over-TLS 2021-04-15 11:04:40 +02:00
Zbigniew Jędrzejewski-Szmek
56d68e715b meson: reorder the "features" list
Try to make this more manageable by reording:
- dependencies / inputs
  (with subcategory of compression libraries)
- major components / outputs
- optional features / conditionals that don't fit into the two above categories

The division isn't well defined, because libraries often correspond one-to-one
to feature, but not always.
2021-04-15 11:04:40 +02:00
Zbigniew Jędrzejewski-Szmek
c716c2537f meson: fold static libsystemd and libudev into the generic status line
It's a very specialized feature and we don't need to devote a separate line to it.
2021-04-15 11:04:40 +02:00
Zbigniew Jędrzejewski-Szmek
ba081955fc meson: reindent 2021-04-15 11:04:40 +02:00
Luca Boccassi
cf9844ffab test: use systemd-run --wait in TEST-44-LOG-NAMESPACE
The test appears to be occasionally failing. It uses systemd-run to echo
'hello world' into a namespaced journal and then uses journalctl to look for it,
but it doesn't wait.
In the failed runs it can't find it, but the automated journal dump shows
the message at the end.

Use --wait to avoid races.
2021-04-15 08:16:19 +02:00
Zbigniew Jędrzejewski-Szmek
3d346b8106 udev/cdrom_id: drop unnecessary cleanup and simplify loop 2021-04-15 07:51:58 +02:00
Zbigniew Jędrzejewski-Szmek
ec77d1ab3b udev/cdrom_id: do not pass ioctl return value to log_debug_errno()
While at it, let's print the tray status in human readable form.
2021-04-15 07:49:31 +02:00
Zbigniew Jędrzejewski-Szmek
828b603a79 libsystemd-network: fix dhcp option buffer confusion
We were writing to the wrong buffer with a wrong offset :(
Bug present since the original introduction of the code in
04b28be1a306fd2ba454d3ee333d63df71aa3873.
2021-04-15 13:46:48 +09:00
Sevan Janiyan
d5b3e51044 meson.build: typo 2021-04-15 13:23:13 +09:00
Zbigniew Jędrzejewski-Szmek
00dd6d7770 libsystemd-network: check that errno==0 is not passed to log functions 2021-04-14 23:32:10 +02:00
Zbigniew Jędrzejewski-Szmek
a0c2541b6b libsystemd-network: use macro for definitions of log_{lldp,dhcp,…}_errno
No functional change.
2021-04-14 23:32:07 +02:00
Zbigniew Jędrzejewski-Szmek
f407219cd1 Check that errno passed log_{interface,link}_*_errno() is non-zero 2021-04-14 22:53:49 +02:00
Yu Watanabe
22bbba8444 sd-dhcp-client: introduce sd_dhcp_client_is_running() 2021-04-14 22:31:28 +02:00
Zbigniew Jędrzejewski-Szmek
e89f6ed476 Voidify log_link_debug
See analogous change for log_debug() for discussion.
2021-04-14 22:20:20 +02:00
Luca Boccassi
9264fb47d9
Merge pull request #19315 from yuwata/network-wait-online-address-family-follow-ups
network: several follow-ups for #19069
2021-04-14 21:17:00 +01:00
Zbigniew Jędrzejewski-Szmek
cf5a2ee825 journald: fix %m usage 2021-04-14 22:06:02 +02:00
Yu Watanabe
6fb61918cc udev: ignore additional newline in sysfs attribute on verify
Some driver may automatically add additional newline at the end.
E.g., portno attribute for qeth driver.

Fixes #19314.
2021-04-15 01:46:58 +09:00
Yu Watanabe
6873d20392 fileio: introduce a new flag to make write_string_file() ignore trailing newline
When writing a sysfs attribute, kernel may automatically append newline
at the end, e.g., 'portno' attribute for qeth driver.
2021-04-15 01:40:52 +09:00
Zbigniew Jędrzejewski-Szmek
75029e150b Do not try to return 0 from log_debug()
As @yuwata correctly points out, this became broken when log_debug()
started returning -EIO. I wanted to preserve this pattern, but it turns
out it is not very widely used, and preserving it would make the whole
thing, already quite complicated, even more complex.

log_debug() is made like log_info() and friends, and returns void.
2021-04-14 17:45:11 +02:00
Zbigniew Jędrzejewski-Szmek
a2eb2267e4 shared/module-util: fix errno value passed to log function
If r == 0, no harm done. But if r > 0, this would be interpreted as an
errno value, wrongly.
2021-04-14 17:10:36 +02:00
Zbigniew Jędrzejewski-Szmek
a626cb15c0 basic/log: assert that 0 is not passed as errno, except in test code
Let's assert if we ever happen to pass 0 to one of the log functions.
With the preceding commit to return -EIO from log_*(), passing 0 wouldn't
affect the return value any more, but it is still most likely an error.
The unit test code is an exception: we fairly often pass the return value
to print it, before checking what it is. So let's assert that we're not
passing 0 in non-test code. As with the previous check for %m, this is only
done in developer mode. We are depending on external code setting
errno correctly for us, which might not always be true, and which we can't
test, so we shouldn't assert, but just handle this gracefully.

I did a bunch of greps to try to figure out if there are any places where
we're passing 0 on purpose, and couldn't find any.
The one place that failed in tests is adjusted.

About "zerook" in the name: I wanted the suffix to be unambiguous. It's a
single "word" because each of the words in log_full_errno is also meaningful,
and having one term use two words would be confusing.
2021-04-14 17:07:06 +02:00
Zbigniew Jędrzejewski-Szmek
c5cb37d95e
Merge pull request #19302 from bluca/uninit
tree-wide: avoid uninitialized warning on _cleanup_ variables
2021-04-14 16:25:35 +02:00
Zbigniew Jędrzejewski-Szmek
63275a7032 basic/log: assert that %m is not used when error is not set
This is only done in developer mode. It is a pretty rare occurence that we
make this kind of mistake. And even if it happens, the result is just a misleading
error message. So let's only do the check in non-release builds.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
cbe97b9c92 basic/log: force log_*_errno() to return negative
This silences some warnigns where gcc thinks that some variables are
unitialized. One particular case:

../src/journal/journald-server.c: In function 'ache_space_refresh':
../src/journal/journald-server.c:136:28: error: 'vfs_avail' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  136 |         uint64_t vfs_used, vfs_avail, avail;
      |                            ^~~~~~~~~
../src/journal/journald-server.c:136:18: error: 'vfs_used' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  136 |         uint64_t vfs_used, vfs_avail, avail;
      |                  ^~~~~~~~
cc1: all warnings being treated as errors

which is caused by

   d = opendir(path);
   if (!d)
           return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR,
                                 errno, "Failed to open %s: %m", path);
   if (fstatvfs(dirfd(d), &ss) < 0)
           return log_error_errno(errno, "Failed to fstatvfs(%s): %m", path);

For some reason on aarch64 gcc thinks we might return non-negative here. In
principle errno must be set in both cases, but it's hard to say for certain.
So let's make sure that our code flow is correct, even if somebody forgot to
set the global variable somewhere.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
111a3aae71 partition, random-seed, logind: fix log messages with %m
We would print "...: Success", which is not too terrible, but not pretty
either.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
aca591ac55 sd-device: improve log message and tweak style
We shouldn't say the attribute is missing right after ruling out ENOENT.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
2d359acda5 libsystemd-network: fix dhcp option buffer confusion
We were writing to the wrong buffer with a wrong offset :(
Bug present since the original introduction of the code in
04b28be1a306fd2ba454d3ee333d63df71aa3873.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
47350c5fb6 meson: simplify the BUILD_MODE conditional
Using a enum is all nice and generic, but at this point it seems unlikely that
we'll add further build modes. But having an enum means that we need to include
the header file with the enumeration whenerever the conditional is used. I want
to use the conditional in log.h, which makes it hard to avoid circular imports.
2021-04-14 16:19:54 +02:00
Zbigniew Jędrzejewski-Szmek
5600a26114 bpf-devices: update comment 2021-04-14 15:29:41 +02:00
Yu Watanabe
f11bee0cb9 wait-online: update debug log messages 2021-04-14 22:17:44 +09:00
Yu Watanabe
90afec1834 network: shorten code a bit 2021-04-14 22:13:46 +09:00
Zbigniew Jędrzejewski-Szmek
6634a39469
Merge pull request #19266 from mrc0mmand/testsuite-shellcheck
test: make the test scripts shellcheck-compliant
2021-04-14 13:58:01 +02:00
Luca Boccassi
c2b2df604b tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.
2021-04-14 12:25:06 +01:00
Luca Boccassi
be084c0dd1 meson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used
We intentionally do not inline initializations with definitions for
a bunch of _cleanup_ variables in tests, to ensure valgrind is triggered.
This triggers a lot of maybe-uninitialized false positives when -O2 and
-flto are used. Suppress them.
2021-04-14 11:31:50 +01:00
Yu Watanabe
c68ede3952 util: shorten allow_listed_char_for_devnode() 2021-04-14 11:04:46 +01:00
Yu Watanabe
a2b1572ce4
Merge pull request #19287 from yuwata/network-manage-foreign-routing-policy-rule-19106
network: add ManageForeignRoutingPolicyRules= boolean setting
2021-04-14 19:01:41 +09:00
Yu Watanabe
c7cbe25d11
Merge pull request #19069 from LetzteInstanz/waiting_for_address_family
systemd-networkd-wait-online: wait for specific address family
2021-04-14 18:57:39 +09:00
Luca Boccassi
ab1aa6368a rfkill: add some casts to silence -Werror=sign-compare 2021-04-14 10:26:31 +01:00
Yu Watanabe
86d58c8625 man: update explanation for Anonymize= 2021-04-14 14:15:15 +09:00
Yu Watanabe
f90635f14f network: dhcp4: warn when Anonymize=yes and ClientIdentifier= is not mac 2021-04-14 14:15:11 +09:00
Yu Watanabe
0078195835 network: drop unnecessary explicit initializations 2021-04-14 13:06:54 +09:00
Yu Watanabe
a83bda058c network: dhcp4: do not request any additional options when Anonymize=yes
This makes networkd can use recieved options we do not request.
2021-04-14 13:06:54 +09:00
Yu Watanabe
ae7ea5a7ba network: move and rename network_apply_anonymize_if_set() 2021-04-14 13:06:50 +09:00
LetzteInstanz
70448bb1c1 test-network: test waiting for address family 2021-04-14 09:00:12 +09:00
LetzteInstanz
6dc4531d16 wait-online: wait for address family
This introduce -4 and -6 commandline options.
2021-04-14 09:00:08 +09:00
LetzteInstanz
bbea881312 sd-network: read IPv4/IPv6 address states from state files 2021-04-14 08:51:08 +09:00
LetzteInstanz
8430841b5e network: save IPv4/IPv6 address states into state file
This also introduces RequiredFamilyForOnline= setting to .network file,
and IPv4AddressState/IPv6AddressState DBus properties.
2021-04-14 08:51:02 +09:00
LetzteInstanz
86ae2d69a3 network: move AddressFamily into network-util for the use by wait-online later 2021-04-14 08:30:18 +09:00
gaoyi
993eb00016 udev: delete useless codes
It seems no one will touch queue.bin
2021-04-14 08:07:40 +09:00
Yegor Alexeyev
21b6b87eb3 dhcp: Implemented BindToInterface= configuration option 2021-04-14 07:30:40 +09:00
Frantisek Sumsal
84031b5d6e test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
Frantisek Sumsal
4544002cae test: use arrays to make things a bit cleaner 2021-04-13 13:20:22 +02:00
Frantisek Sumsal
ea539ad297 test: replace the obsolete `` syntax with $() 2021-04-13 12:08:01 +02:00
Frantisek Sumsal
70ad107bdf test: use an explicit no-op for file truncation 2021-04-13 12:08:01 +02:00
Frantisek Sumsal
f794098356 test: tidy up arithmetic expressions 2021-04-13 12:08:01 +02:00
Frantisek Sumsal
3882526798 test: use quotes where necessary
to avoid possible word splitting.
2021-04-13 12:08:01 +02:00
Frantisek Sumsal
084575ff91 test: use set -eux and set -o pipefail everywhere
This should make the scripts more robust.
2021-04-13 12:08:01 +02:00
Luca Boccassi
bcaf24cd77
Merge pull request #19303 from yuwata/fix-typo
tree-wide: fix typo
2021-04-13 09:44:33 +01:00
Yu Watanabe
57442d2dfe network: fix indentation 2021-04-13 14:50:44 +09:00
Yu Watanabe
dfc58b4740 network: lldp: update mac address 2021-04-13 14:45:54 +09:00
Yu Watanabe
bc9e40c9a1 network: refuse to configure engines such as DHCP client more than once 2021-04-13 14:38:24 +09:00
Yu Watanabe
050f05c2eb tree-wide: update comment about unnecessary initialization 2021-04-13 12:53:32 +09:00
Yu Watanabe
f1a5c566c1 man: fix typo 2021-04-13 12:52:56 +09:00
Yu Watanabe
3fe23a96d6 man: update description for ManageForeignRoutes= 2021-04-13 12:23:59 +09:00
Yu Watanabe
d94dfe7053 network: introduce ManageForeignRoutingPolicyRules= boolean setting in networkd.conf
The commit 0b81225e5791f660506f7db0ab88078cf296b771 makes that networkd
remove all foreign rules except those with "proto kernel".

But, in some situation, people may want to manage routing policy rules
with other tools, e.g. 'ip' command. To support such the situation,
this introduce ManageForeignRoutingPolicyRules= boolean setting.

Closes #19106.
2021-04-13 12:22:42 +09:00
Yu Watanabe
6bfadad9bb network: add missing default setting in networkd.conf 2021-04-13 12:07:09 +09:00
Francois Gervais
54cfe9a75f
load-fragment: parse specifiers in CPUAffinity= (#19281) 2021-04-13 07:25:29 +09:00
Zbigniew Jędrzejewski-Szmek
7c5fd25119 meson: do not fail if rsync is not installed with meson 0.57.2
https://github.com/mesonbuild/meson/issues/8641

Our CI started to fail. Even if the change is reverted in meson,
we need a quick workaround here.
2021-04-12 21:28:23 +01:00
Frantisek Sumsal
72ae959efd packit: drop the 'sources' file after cloning the Fedora repo
Otherwise rebase-helper thinks we're are a dist-git repository,
replacing the generated git archive with PR changes with the tarball
found in the 'sources' file.
2021-04-12 18:10:04 +02:00
Lennart Poettering
59b8635a33
Merge pull request #18701 from bugaevc/mdns-unicast
resolved: reply using unicast mDNS when appropriate
2021-04-12 17:53:38 +02:00
Zbigniew Jędrzejewski-Szmek
839eb4a458
Merge pull request #13496 from wat-ze-hex/custom-bpf-progs-parameterized-3
bpf: extend bpf cgroup program support
2021-04-12 14:31:42 +02:00
gaoyi
45f5efdea7 man: fix discriptions for --exec-delay
There are two ambiguity in the original description:
1. It will delay all RUN instructions, include builtin.
2. It will delay before running RUN, not each of RUN{program} instructions.
2021-04-12 13:03:26 +02:00
Yu Watanabe
9bafb8d504 sd-dhcp-client: constify argument in sd_dhcp_lease_get_xxx() 2021-04-12 09:55:26 +02:00
Yu Watanabe
37da8bca92 networkctl: drop unused variables 2021-04-12 09:09:57 +02:00
Luca Boccassi
0efcbecd8b test-repart: use cryptsetup and losetup autoclose
The test occasionally fails as the umount is not yet completed when
cryptsetup close is invoked.
Both cryptsetup and losetup have supported deferred cleanup for some
time now, so use it instead to avoid races.

++ losetup -P --show --find /tmp/test-repart.dMOfYQ8UUF/zzz
+ LOOP=/dev/loop6
+ VOLUME=test-repart-11882
+ touch /tmp/test-repart.dMOfYQ8UUF/empty-password
+ cryptsetup open --type=luks2 --key-file=/tmp/test-repart.dMOfYQ8UUF/empty*** test-repart-11882
+ mkdir /tmp/test-repart.dMOfYQ8UUF/mount
+ mount -t ext4 /dev/mapper/test-repart-11882 /tmp/test-repart.dMOfYQ8UUF/mount
+ diff -r /tmp/test-repart.dMOfYQ8UUF/mount/def /tmp/test-repart.dMOfYQ8UUF/definitions
+ umount /tmp/test-repart.dMOfYQ8UUF/mount
+ cryptsetup close test-repart-11882
Device test-repart-11882 is still in use.
+ rm -rf /tmp/test-repart.dMOfYQ8UUF
2021-04-11 23:50:31 +09:00
Luca Boccassi
3f66ded568 scsi_id: use read_line instead of fgets
LGTM warns about it:

"Call to fgets() is potentially dangerous. Use read_line() instead."
2021-04-11 15:45:06 +01:00
Yu Watanabe
37b7a716d3
Merge pull request #19164 from mmatsuya/main
tmpfiles: use a entry in hashmap as ItemArray in read_config_file()
2021-04-11 16:46:25 +09:00
Luca Boccassi
a7b7cab66d mkosi.arch: add rsync build dependency
Program rsync found: NO

man/meson.build:187:0: ERROR: Program 'rsync' not found
2021-04-10 22:22:08 +02:00
Oleg Popov
b204bdd4cc Extend characters set for PKCS11 URI
There are tokens with dots (and other symbols) in PKCS11 URI:

pkcs11:model=Rutoken%20ECP;manufacturer=Aktiv%20Co.;serial=3xxxxxxb;token=livelace
pkcs11:model=PRO;manufacturer=Aladdin%20R.D.;serial=CC62FB25;token=val%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00;id=%33%32%31%30%33%61%36%37%36%65%32%34%35%62%32%31;type=private
2021-04-10 20:24:18 +01:00
Yu Watanabe
5c078687dc network: refuse to configure NDISC twice 2021-04-10 20:16:11 +01:00
Lennart Poettering
1065501406 resolved: add RFC 8375 "home.arpa" to list of default NTA
RFC 8375 introduced "home.arpa" as special TLD for home networks. Let's
hence add it to our default list of NTAs.
2021-04-10 20:14:57 +01:00
Lennart Poettering
a8fd92b5a3 openssl: make RSA struct const
OpenSSL 3.0 broke API there, but it doesn't hurt to add the "const",
hence add it.

Fixes: #19267
2021-04-10 20:03:06 +01:00
Yu Watanabe
080e5c2fde sd-dhcp6-client: do not use IN_SET() macro when only one target value 2021-04-10 13:24:56 +01:00
Yu Watanabe
942cf4b8d1 network: adjust log message 2021-04-10 13:24:06 +01:00
Yu Watanabe
a78f938aaf network: drop unnecessary bitfield specifier
Manager is allocated only once. It is not necessary to optimize its
size.
2021-04-10 13:23:38 +01:00
Anita Zhang
b5a80aa9d8 units: install dbus-org.freedesktop.oom1.service alias
Fixes: #18469
2021-04-10 13:06:04 +02:00
Julia Kartseva
96734772a7 fuzz: add BPFProgram= to directives 2021-04-09 20:28:47 -07:00
Julia Kartseva
9e009a145d dbus-cgroup: add BPFProgram= dbus support
- Handle BPFProgram= property in string format
"<bpf_attach_type>:<bpffs_path>", e.g. egress:/sys/fs/bpf/egress-hook.
- Add dbus getter to list foreign bpf programs attached to a cgroup.
2021-04-09 20:28:47 -07:00
Julia Kartseva
ee08909059 man: add BPFProgram= documentation 2021-04-09 20:28:47 -07:00
Julia Kartseva
b57162aafb tests: add unit file tests for BPFProgram=
- Pin trivial bpf programs to bpf filesystem, compose BPFProgram= option
string and pass it to a unit. Programs store `0` in r0 BPF register for
denying action, e.g. drop a packet.
- Load trivial BPF programs
- Test is skipped if not run under root or if can not lock enough
memory.
- For egress and ingress hooks, test BPFProgram= option along with
with IP{Egress|Ingress}FilterPath=, expected result should not depend on
which rule is executed first.
Expected results for BPF_CGROUP_INET_INGRESS:
5 packets transmitted, 0 received, 100% packet loss, time 89ms

For BPF_CGROUP_INET_SOCK_CREATE:
ping: socket: Operation not permitted
2021-04-09 20:28:47 -07:00
Julia Kartseva
0879da98dc core: add bpf-foreign to fragment parser
- Parse a string for bpf attach type
- Simplify bpffs path
- Add foreign bpf program to cgroup context
2021-04-09 20:28:47 -07:00
Julia Kartseva
506ea51b48 core: add bpf-foreign cgroup mask and harness
Add CGROUP_MASK_BPF_FOREIGN to CGROUP_MASK_BPF and standard cgroup
context harness.
2021-04-09 20:28:47 -07:00
Julia Kartseva
5f8ba20d7f core: add bpf-foreign unit helpers
- Introduce support of cgroup-bpf programs managed (i.e. compiled,
loaded to and unloaded from kernel) externally. Systemd is only
responsible for attaching programs to unit cgroup hence the name
'foreign'.

Foreign BPF programs are identified by bpf program ID and attach type.

systemd:
- Gets kernel FD of BPF program;
- Makes a unique identifier of BPF program from BPF attach type and
program ID. Same program IDs mean the same program, i.e the same
chunk of kernel memory. Even if the same program is passed multiple
times, identical (program_id, attach_type) instances are collapsed
into one;
- Attaches programs to unit cgroup.
2021-04-09 20:28:47 -07:00
Julia Kartseva
b894ef1b71 cgroup: add foreign program to cgroup context
- Store foreign bpf programs in cgroup context. A program is considered
foreign if it was loaded to a kernel by an entity external to systemd,
so systemd is responsible only for attach and detach paths.
- Support the case of pinned bpf programs: pinning to bpffs so a program
is kept loaded to the kernel even when program fd is closed by a user
application is a common way to extend program's lifetime.
- Aadd linked list node struct with attach type and bpffs path
fields.
2021-04-09 20:28:47 -07:00
Julia Kartseva
9984f4933b shared: bpf_attach_type {from,to} string
Introduce bpf_cgroup_attach_type_table with accustomed attached type
names also used in bpftool.
Add bpf_cgroup_attach_type_{from|to}_string helpers to convert from|to
string representation of pinned bpf program, e.g.
"egress:/sys/fs/bpf/egress-hook" for
/sys/fs/bpf/egress-hook path and BPF_CGROUP_INET_EGRESS attach type.
2021-04-09 20:28:47 -07:00
Julia Kartseva
f23f0ead1f shared: add bpf-program helpers
Add helpers to:
- Create new BPFProgram instance from a path in bpf
filesystem and bpf attach type;
- Pin a program to bpf fs;
- Get BPF program ID by BPF program FD.
2021-04-09 20:28:47 -07:00
Julia Kartseva
a442ccb4eb bpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports
Reduced version of [0].
Use BPF_F_ALLOW_MULTI attach flag for bpf-firewall if kernel supports
it.

Aside from addressing security issue in [0] attaching with 'multi'
allows further attaching of cgroup egress, ingress hooks specified by
BPFProgram=.

[0] 4e42210d40
2021-04-09 20:28:47 -07:00
Lennart Poettering
e2e40e9a9e sd-device: fix error code returned by sd_device_get_sysattr_value() for non-existing attributes
lstat() returns the error in errno, not as return value. Let's propagate
this correctly.

This broke the bolt test suite, as @gicmo discovered.

Follow-up for acfc2a1d15560084e077ffb3be472cd117e9020a.
2021-04-09 19:41:43 +01:00
gaoyi
5b1375035b gpt-auto-generator: don't generate systemd-cryptsetup@.service when --Dlibcryptsetup=false 2021-04-09 17:18:09 +02:00
Zbigniew Jędrzejewski-Szmek
22344fcfb9
Merge pull request #19243 from bluca/lgtm
Fix various issues reported by LGTM
2021-04-09 13:12:41 +02:00
Aakash Singh
d6bf675f0b hwdb: 60-keyboard:: Update MSI Modern backslash and hotkeys
fix typos
2021-04-09 12:03:13 +02:00
Jérôme Carretero
aba9c92896
login: logind-dbus: support scheduled kexec (#19162)
login: logind-dbus: support delayed kexec
2021-04-09 10:55:58 +02:00
Zbigniew Jędrzejewski-Szmek
5c91fdf3f8 man: document system-systemd\x2dcryptsetup.slice
As discussed in
1dc85eff1d (r606821495),
follow-up for commit 1dc85eff1d0dff18aaeaae530c91bf53f34b726e.
2021-04-09 10:38:09 +02:00
Zbigniew Jędrzejewski-Szmek
276dc7af74 docs: use new URL for package-notes 2021-04-09 10:27:36 +02:00
simmon
d1e6dec669 po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-04-09 09:31:00 +02:00
Yu Watanabe
8cd37e4354 network: do not require DHCPv6 addresses when UseAddress=no
Follow-up for 1536b7b2d00819615bf8eba194de7ccd20c3689f.

Fixes #19196.
2021-04-09 08:15:34 +02:00
Zbigniew Jędrzejewski-Szmek
708b299203
Merge pull request #19254 from poettering/native-journal-proto-doc
document native journal protocol
2021-04-09 08:13:21 +02:00
Zbigniew Jędrzejewski-Szmek
33ea9e9c97
Merge pull request #19255 from poettering/glyph-love
some SpecialGlyph tweaks
2021-04-09 08:05:14 +02:00
Zbigniew Jędrzejewski-Szmek
8649ec4725
Merge pull request #19248 from keszybz/make-tests-test
Make tests test
2021-04-09 07:56:04 +02:00
Lennart Poettering
eeb6923d5a core: rework unit_active_state_to_glyph() to use a translation table
Let's make this a bit more readable by implementing this via a
translation table, indexed by the state.
2021-04-08 23:01:25 +02:00
Lennart Poettering
eff60d8cea locale-util: make SpecialGlyph more like our usual enums
Let's define both an enum and a typedef named SpecialGlyph, the way we
usually do it.

Also, introduce an "invalid" special glyph, assigned to -EINVAL, also
like we always do it. (And handle it somewhat sanely in special_glyph()
2021-04-08 23:00:43 +02:00
Lennart Poettering
8ee62e53e8 man: link up new journal protocol docs 2021-04-08 22:16:58 +02:00
Lennart Poettering
1a80f4e0d7 docs: document native journal protocol
Fixes: #17748
2021-04-08 22:16:58 +02:00
Zbigniew Jędrzejewski-Szmek
d0b3039837
Merge pull request #19226 from keszybz/reenable-maybe-unitialized-warning
meson: re-enable -Wmaybe-uninitialized
2021-04-08 20:29:05 +02:00
Zbigniew Jędrzejewski-Szmek
d8e4c59785
Merge pull request #19250 from keszybz/sd-bus-is-ready-simplification
Simplify how sd_bus_is_ready() is used
2021-04-08 20:26:30 +02:00
Zbigniew Jędrzejewski-Szmek
b1e1e5ac25 TEST-17: make the test test
'! grep -v' does *not* test that there are no matching lines.
Instead, it checks that whether there are any non-matching lines.

And of course, for the test to fail, '! grep' cannot be part of
an expression with &&.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
68bb821e21 TEST-46: simplify lossy diff invocation 2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
b9bfa250f2 homectl,TEST-46: fix test and fix homectl return value, update docs
The usual: the test wasn't testing, so we didn't notice that the
command wasn't returning as expected.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
f49467b959 TEST-44: fix test
We were grepping for 'hello world', and in the namespace we would
match on 'hello world', and outside, on 'echo "hello world"'. When
the condition check was fixed, the test gave a false positive.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
d933ccd30b TEST-43: fix exit condition testing
We were invoking 'systemd-run bash', but the test invoked by bash
was not effective. When the result of that check is propagated, the
outer command fails.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
0ee994836c TEST-*: use spacing before redirection operator, but not after
<< EOF → <<EOF
> foo < bar → >foo <bar
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
4e20fe2795 TEST-*: make failure tests actually fail on failure
Here the intent was actually correct, and the tests still pass when the check
is made effective.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
61494724ee TEST-42-EXECSTOPPOST: un-invert test
Since we test for the file right below, it seems we expected the
command to succeed.
2021-04-08 20:21:50 +02:00
Zbigniew Jędrzejewski-Szmek
b88ba6c761 tmpfiles: make handling of existing-but-different targets more consistent
create_fifo() was added in a2fc2f8dd30c17ad1e23a31fc6ff2aeba4c6fa27, and
would always ignore failure. The test was trying to fail in this case, but
we actually don't fail, which seems to be correct. We didn't notice before
because the test was ineffective.

To make things consistent, generally log at warning level, but don't propagate
the error. For symlinks, log at debug level, as before.

For 'e', failure is not propagated now. The test is adjusted to match.

I think warning is appropriate in most cases: we do not expect a device node to
be replaced by a different device node or even a non-device file. This would
most likely be an error somewhere. An exception is made for symlinks, which are
mismatched on purpose, for example /etc/resolv.conf. With this patch, we don't
get any warnings with the any of the 74 tmpfiles.d files, which suggests that
increasing the warning levels will not cause too many unexpected warnings. If
it turns out that there are valid cases where people have expected mismatches
for non-symlink types, we can always decrease the log levels again.
2021-04-08 20:16:37 +02:00
Luca Boccassi
9f519e491f tests: allow for os-release quote variability in TEST-50-DISSECT
Quoting of values differs between distros: Fedora doesn't quote the ID_
fields, but CentOS does.
Adjust the test checks to account for this.

Fixes #19242
2021-04-08 16:16:55 +02:00
Zbigniew Jędrzejewski-Szmek
5dbec9bd32 networkd: simplify sd_bus_is_ready() checks
Also add "system" in the messages, because we set the internal value,
and are just skipping the setting of the external value, so the message
could be confusing without that clarification.
2021-04-08 15:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
3bbb76f621 sd-bus: make sd_bus_is_{ready,open} accept NULL
We didn't document this behaviour one way or another, so I think it's
OK to change. All callers do the NULL check before callling this to avoid
the assert warning, so it seems reasonable to do it internally.

sd_bus_can_send() is similar, but there we expressly say that an
error is returned on NULL, so I didn't change it.
2021-04-08 14:59:10 +02:00
Yu Watanabe
a73f8e9f32 network: do not emit changed properties when bus connection is not ready
Prompted by #19212.
2021-04-08 14:48:46 +02:00
Yu Watanabe
ecb4b08c2e test: move check of nat table existence
As test_v4() with iptables backend will be called after nftables tests.

Follow-up for afbcd905526111e3a1bd55b0d6d5ee4413734735.
2021-04-08 14:39:53 +02:00
Zbigniew Jędrzejewski-Szmek
2fe2941646
Merge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
udev: fix several issues around hotplug slot detection
2021-04-08 14:37:02 +02:00
Luca Boccassi
a0cc411724 in-addr-util: suppress LGTM warning about htobe32
We are not calling it directly, it's coming from a standard library
macro, so just suppress it.
2021-04-08 13:08:38 +01:00
Luca Boccassi
82cdb75b8d errno-util: suppress LGTM warning about strerror 2021-04-08 13:08:38 +01:00
Luca Boccassi
a9a49d2fea scsi_id: modernize and use extract_many_words instead of strsep
Also use standard error loggin/return pattern.

Only cursory tested, by checking that with a simple config file
the array is the same before/after. Not tested with actual scsi
rules and devices, due to missing hardware.
2021-04-08 13:07:31 +01:00
Luca Boccassi
b01339f74f test-extract-word: add a couple more corner cases 2021-04-08 13:07:31 +01:00
Luca Boccassi
dfc5c4f26d timedated: use format_timestamp instead of ctime
Some static analyzers (lgtm) warn against using non-re-entrant functions,
even though at the moment this code is not multi-threaded, just switch to
format_timestamp.
2021-04-08 13:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
68c98a411d meson: re-enable -Wmaybe-uninitialized on -O[02] with recent gcc versions
The warning was disabled in 8794164fed5f0142c34358613f92f4f761af4edd to avoid
false positives. But it is useful in finding errors, even if it sometimes
results in untrue warnings (c.f. 77fac974fe, da46a1bc3c).

After #19168, #19169, and #19175, there are no warnings with
-Dbuildtype=debug-optimized/-O2 and gcc-11.0.1-0.3.fc34.x86_64. Warnings
are reenabled for -O[23]

-O0 is good for development, and -O2 is the default optimization level for
Fedora package builds. -Os, -O3, -O1, and -Og still generate some warnings. In
fact, with -Os the number of warnings seems completely hopeless. Dozens and
dozens.
2021-04-08 13:12:56 +02:00
Zbigniew Jędrzejewski-Szmek
98d81cf974 home: use goto to make it clear that variables are initialized
gcc-11.0.1-0.3.fc34.x86_64 with -Og was complaining that 'r' might be
unitialized. It cannot, but let's rework the code to use a goto instead of
conditionalizing on 'call' being unset, which I think is clearer and less error
prone. This silences the warning.
2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
3b9e6fb490 basic/strbuf: use _cleanup_ 2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
a03e335b86 timedatectl: rework handling of conditions in print_status_info()
gcc-11.0.1-0.3.fc34.x86_64 was complaining that n might be unset with
--optimization=1. It was wrong, but let's rework the code to make it
obvious that it is always set.
2021-04-08 13:00:50 +02:00
Zbigniew Jędrzejewski-Szmek
b065dfc8ed TEST-33-CLEAN-UNIT: fix broken test exposed by condition check fix 2021-04-08 11:46:07 +02:00
Zbigniew Jędrzejewski-Szmek
4e324ce42c TEST-22-TMPFILES: fix broken test exposed by condition check fix 2021-04-08 11:46:07 +02:00
Zbigniew Jędrzejewski-Szmek
ffa328f060 tests: make inverted tests actually count
"! test ..." does not cause the script to fail, even with set -e.
IIUC, bash treats this command as part of an expression line, as it
would if 'test ... && ...' was used. Failing expression lines do not
terminate the script.

This fixes the obvious cases by changing '! test' → 'test !'.
Then the inversion happens internally in test and bash will propagate
the failure.
2021-04-08 11:45:59 +02:00
Zbigniew Jędrzejewski-Szmek
1672be8602 TEST-22-TMPFILES: add reproducer for bug with X 2021-04-08 11:01:29 +02:00
Zbigniew Jędrzejewski-Szmek
3dd61ee5be man: fix quickhelp listing in tmpfiles.d(5)
Unlike many other small/big letter combos, this one has the recursive
version attached to the lowercase letter.
2021-04-08 11:01:29 +02:00
Zbigniew Jędrzejewski-Szmek
875e7b25d8 tmpfiles: rework condition check
(!a && b) || (a && c) is replaced by (a ? c : b).

path_startswith() != NULL is need to avoid type warning.
2021-04-08 11:01:29 +02:00
Masahiro Matsuya
bec890e3cd tmpfiles: use a entry in hashmap as ItemArray in read_config_file()
[zjs: squash commits and use size_t as appropriate.

Bug seems to have been introduced in 811a15877825da9e53f9a2a8603da34589af6bbb.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1944468.]
2021-04-08 11:01:13 +02:00
Zbigniew Jędrzejewski-Szmek
71d1e58309 core: fix memleak of ipc_namespace_path
Fixup for a70581ffb5c13c91c76ff73ba6f5f3ff59c5a915.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32991
2021-04-07 22:12:50 +01:00
Luca Boccassi
7f8225d21b
Merge pull request #19231 from bluca/coredump_decode
coredump: follow-ups for #19135
2021-04-07 22:06:26 +01:00
Yu Watanabe
cb8c948738 udev: use snprintf_ok() 2021-04-08 01:38:47 +09:00
Yu Watanabe
5a6e56ec17 udev: fix potential infinite loop 2021-04-08 01:38:47 +09:00
Yu Watanabe
19ed9a114c udev: make dev_pci_slot() return earlier when PCI bridge is found 2021-04-08 01:38:47 +09:00
Yu Watanabe
c304cb0146 udev: use uint32_t for hotplug_slot
This also makes function id is parsed as uint64_t. Kernel internally
uses uint32_t for function id (see the definition of 'struct zpci_dev),
but it maybe extended in the future.
2021-04-08 01:38:43 +09:00
Yu Watanabe
fa28023c0f udev: split out logic of parsing s390 PCI slots
This also adds several debugging logs.
2021-04-08 01:35:43 +09:00
Yu Watanabe
70c35e4bfd udev: it is not necessary that the path is readable 2021-04-08 01:35:43 +09:00
Yu Watanabe
b08c3fbe0e udev: add missing initialization to fix freeing invalid address 2021-04-08 01:35:43 +09:00
Lennart Poettering
7211773a55 mkosi: work-around to make systemd build in Fedora images that lack populated /etc
On Fedora /usr/bin/ld is a symlink managed via the "alternatives"
system. This unfortunately means the binary is not usable in
environments where /var or /etc are unpopulated. Let's address this by
redirecting "ld" to "ld.bfd" manually if such an environment is
detected, via $PATH.

This is useful for building systemd in mkosi with UsrOnly=1 set.
2021-04-07 17:45:28 +02:00
Zbigniew Jędrzejewski-Szmek
46cbdcd9fe shared/format-table: use goto to make code flow clear
gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0" with --optimization=1 was
not able to figure out that all cases are covered because r is either set in
the switch or type < _TABLE_DATA_TYPE_MAX.

But for a human reader this might also not be obvious: the cases are not in
exactly the same order as enum definitions, and it's a long list. By using the
goto, there should be no doubt, and we avoid checking the condition a second
time.
2021-04-07 17:05:35 +02:00
Zbigniew Jędrzejewski-Szmek
4a3ad75efa shared/format-table: rework loop
Not a big difference, but I think it's a bit nicer this way.
2021-04-07 17:05:35 +02:00
Lennart Poettering
d997861ea7 proc-cmdline: allow backslash escapes when parsing /proc/cmdline
So far when parsing /proc/cmdline we'd consider backslashes as
mechanisms for escaping whitepace or quotes. This changes things so that
they are retained as they are instead. The kernel itself doesn't allow such
escaping, and hence we shouldn't do so either (see lib/cmdline.c in the
kernel sources; it does support "" quotes btw).

This fix is useful to allow specifying backslash escapes in the "root="
cmdline option to be passed through to systemd-fstab-generator. Example:

    root=/dev/disk/by-partlabel/Root\x20Partition

Previously we'd eat up the "\" so that we'd then look for a device
/dev/disk/by-partlabel/Rootx20Partition which never shows up.
2021-04-07 16:19:35 +02:00
Zbigniew Jędrzejewski-Szmek
f1e7cbaef7 sd-bus: make sd_bus_error_set() more like sd_bus_error_setfv()
In b9c19bc384fd41c173a8e453bd157544400af059, I added an assert to _setfv() and
_setf(), but I forgot to do the same in _set(). Let's do this for completeness.

While at it, restructure _set() to use the same style as _setfv().
2021-04-07 16:04:52 +02:00
Zbigniew Jędrzejewski-Szmek
1b09b81cf4 tree-wide: sd_bus_error_setf → set_bus_error_set
strdup() is more efficient than asprintf().
2021-04-07 16:04:52 +02:00
Zbigniew Jędrzejewski-Szmek
7756528e9b tree-wide: use the same comment for work-around initializations
This should make it easier to remove those warnings when the compiler
gets smarter. Not sure if I got them all...

Double space before the comment start to make it easier to separate from the
preceding line.
2021-04-07 16:04:22 +02:00
Luca Boccassi
81e01cf809 coredump: update and shorten package metadata keys
Follow-up for a7ea0a460bb3
2021-04-07 14:04:04 +01:00
Luca Boccassi
289784a798 coredump: use path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
727e63e33e basic: add path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
b7ddd44497 coredumpctl: fetch JSON object by key instead of iterating
Follow-up for d1b5a0c691
2021-04-07 14:03:49 +01:00
Luca Boccassi
1f2abb791e coredump: fetch JSON object by key instead of iterating
Follow-up for c546154a4448ddf9
2021-04-07 14:03:48 +01:00
Luca Boccassi
671769c932 coredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_
Follow-up for c546154a4448ddf9
2021-04-07 14:02:38 +01:00
Luca Boccassi
f216e74841 coredump: use JSON helpers instead of creating objects manually
Follow-up for 95f71807733
2021-04-07 14:02:38 +01:00
Luca Boccassi
9b7205f5dd coredump: fix style nits
Follow-up for 95f71807733
2021-04-07 14:02:38 +01:00
Luca Boccassi
26c22c84e0 coredump: use set_put_strdup()
Follow-up for 95f71807733
2021-04-07 14:02:38 +01:00
Luca Boccassi
2c173dbf1b coredump: fix typo
Follow-up for 95f71807733
2021-04-07 14:02:38 +01:00
Zbigniew Jędrzejewski-Szmek
462035d599 sd-device: small modernization 2021-04-07 14:36:37 +02:00
Zbigniew Jędrzejewski-Szmek
9b4aba104e shared/base-filesystem: modernization 2021-04-07 14:36:25 +02:00
Morten Linderud
29d898cc7b man/systemd-cryptenroll: Fix sd-boot manvolnum from 8 to 7
Off-by-one error in the documentation index. The volume number for
systemd-boot/sd-boot is 7.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-04-07 13:57:33 +02:00
Luca Boccassi
65d09d575c Bump test-random-util timeout
It is using log_trace, which we enabled in the CI, so now it's
slower and it is timing out. Bump the timeout from 30s to 120s.
2021-04-07 09:32:42 +02:00
Zbigniew Jędrzejewski-Szmek
3e3ab11b9e
Merge pull request #19135 from bluca/coredump_decode
coredump: parse build-id and .note.package
2021-04-07 07:41:16 +02:00
Takashi Sakamoto
dece0357e1 hwdb: add database entries for node with single unit for multiple functions
Avid Adrenarine and Mojo has configuration ROM in which single unit exists
in root directory, however the unit has both video and audio functions.

For the case, it's better to distinguish from the case of composite node.
This commit adds database entries for them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
12dd2404be hwdb: add database entries for node with multiple units
In IEEE 1394 bus, one node can include multiple units, which represent
certain functions such as video and audio. Although it's possible to
distinguish each unit, Linux FireWire character device corresponding to
the node can not have multiple group owners, therefore it's forced to
select one of the units as representative for function.

This commit adds database entries for units belongs to the same node.
The entries are aligned to inverse order of corresponding unit order
in configuration ROM to select the first unit as the representative.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
8b4b76dc50 hwdb: add database entry for node with single unit with video function
Cool Stream shipped iSweet. This model has single unit for video function.

This commit adds database entry for it as sample of node with single unit
for video.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
0c20543835 hwdb: add database entries for TC Electronic PowerCore FireWire series
TC Electronic had PowerCore platform for products of digital audio signal
processing. This platform consists of NXP PowerQUICC II Processor with PCI
interface (XPC8245, MPC8245), Xilinx Spartan-II FPGA (XC2S50), and some
NXP 24-Bit Audio Digital Signal Processor (DSP56367). The products for
IEEE 1394 bus has additional TI OHCI 1.1, 1394a link layer controller
(TSB43AB23).

The content of configuration ROM has layout of standard of 1394 Trading
Association.

This commit adds database entries for the models. At present, no driver is
developed, thus this is just for convenience to developers.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
1d2ee96292 hwdb: add database entries for Focusrite Liquid Mix series
Sintefex Audio Lda. designed Liquid Mix as OEM of Focusrite Audio
Engineering, Ltd. The models serve digital signal processing service via
asynchronous transaction in IEEE 1394 bus.

The content of configuration ROM is not standard of 1394 Trading
Association.

This commit adds an rule entry for the models. At present, no driver is
developed, thus this is just for convenience to developers.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
41f2d0d393 hwdb: add database entries for Yamaha mLAN 3rd generation
TC Applied Technologies designed DiceII ASIC to adapt to two protocols.
One of the protocol is mLAN defined by Yamaha Corporation, and another
is own protocol. The DiceII ASIC adapted to mLAN protocol was used some
products by Yamaha and its child company, Steinberg.

The content of configuration ROM for the models has completely different
layout from the one defined by 1394 Trading Association.

This commit adds an udev rule for the models. At present, no driver is
developed, thus this is just for convenience to developers.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
a90a6a9ae9 hwdb: add database entries for Yamaha mLAN 2nd generation
Yamaha Corporation designed mLAN protocol based on IEEE 1394
specification. Yamaha developed specific ICs for the purpose (mLAN-NC1
and mLAN-PH2), and shipped some products with them, as well as OEM.

The content of configuration ROM is completely different from standard
layout defined by 1394 Trading Association.

This commit adds database entries for the models. At present, two vendors
are known for models with mLAN IC. At present, no driver is developed
for the models, thus this is just for convenience to developers.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
51e9242b9b hwdb: add database entries for RME Fireface series
RME GmbH shipped Fireface series. The configuration ROM in the models of
series has some quirks and against standard of 1394 Trading Association.

This commit adds database entries for the models. ALSA fireface driver
supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
650b8967a5 hwdb: add database entries for MOTU FireWire series
Mark of the unicorn (MOTU) shipped FireWire series. The configuration ROM
in the models of series has some quirks and against standard of 1394
Trading Association.

This commit adds database entries for the models. ALSA firewire-motu driver
supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
c489e7f9d3 hwdb: add database entries for Tascam FireWire series
TEAC Corporation shipped FireWire series in its TASCAM brand. The
configuration ROM in the models of series has some quirks and against
standard of 1394 Trading Association.

This commit adds database entries for the models. ALSA firewire-tascam
driver supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
4aaa093b5f hwdb: add database entries for models of Digidesign Digi 00x family
Avid Audio shipped Digi 00x family in its Digidesign brand. The
configuration ROM in the models of family has some quirks and against
standard of 1394 Trading Association.

This commit adds database entries for the model. ALSA firewire-digi00x
driver supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
effbb4024b hwdb: add database entries for models based on DICE ASICs specialized by Solid State Logic
Solid State Logic, Ltd. shipped some models based on DICE ASICs. The
content of configuration ROM has a quirk that the value of category
field is unique (0x51 or 0x52).

This commit adds database entries for the models. ALSA dice driver supports
them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
49ed0aad52 hwdb: add database entries for models based on DICE ASICs specialized by Harman Music Group
Harman International Industries, Inc. shipped some models based on DICE
ASICs in its Lexicon brand. The content of configuration ROM has a quirk
that the value of category field is unique (0x20).

This commit adds database entries for the models. ALSA dice driver supports
them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
6f44dddbe2 hwdb: add database entries for models based on DICE ASICs specialized by Loud Technologies
LOUD Audio, LLC (formerly known as LOUD Technologies, Inc.) shipped some
models based on DICE ASICs in its Mackie brand. The content of
configuration ROM has a quirk that the value of category field is unique
(0x10).

This commit adds database entries for the models. ALSA dice driver supports
them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
ff1cb7b939 hwdb: add database entries for models based on DICE ASICs specialized to Weiss Engineering
Weiss Engineering Ltd. shipped some models based on DICE ASICs. The
content of configuration ROM has a quirk that the value of category
field is unique (0x00).

This commit adds database entries for the models. ALSA dice driver supports
them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
a774b5099b hwdb: add database entries for models based on DICE ASICs specialized to M-Audio
M-Audio shipped some models based on DICE ASICs. The content of
configuration ROM has a quirk that the value of version field in unit
directory is different from the one in TCAT specification (0x000001).

This commit adds database entries for the models. ALSA dice driver supports
them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
c0d8b61f93 hwdb: add database entries for models based on DICE ASICs with TCAT specification
TC Applied Technologies designed the series of ASIC for audio and music
data transmission in several types of communication bus. It's named as
Digital Interface Communication Engine (DICE). Four ASICs are known in
the series for IEEE 1394 bus; Dice II, TCD2210 (Dice Jr.), TCD2220 (Dice
Mini), and TCD3070 (DiceIII).

The content of configuration ROM in products based on DICE ASICs is
known against specification defined by 1394 Trading Association.

This commit adds database entries for models without any customization by
vendors. In TCAT specification, The value of GUID field is split to four
parts; 24-bit OUI, 8-bit category, 10-bit product ID, and 22-bit serial
number in the order. In the specification, the value of category field is
fixed to 0x04. The root directory includes leaf entries for vendor and
model names. Although the specifier_id field in unit directory differs
depending on vendors, the version field in unit directory is fixed to
0x000001. ALSA dice driver supports them, but expects userspace
application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
38338b302c hwdb: add database entries for models with OXFW970/971 ASICs
Once Oxford Semiconductor designed FW970 and FW971 ASICs as Multi-Channel
Isochronous Streaming FireWire Audio Controller. Some vendors used them
in their products for audio and music units.

The content of configuration ROM has standard layout of 1394 Trading
Association with an additional Dependent Information directory.

This commit adds database entries for the known models. ALSA oxfw
driver supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
0db0564e95 hwdb: add database entries for models with Fireworks board module
Echo Audio Corporation designed Fireworks board module. The module is used
by several vendors for models.

The content of configuration ROM in the models s some quirks and against
standard of 1394 Trading Association.

This commit adds database entries for the model. ALSA fireworks driver
supports them but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
1b6d9a05b1 hwdb: add database entries for models with ASICs in BeBoB solution
ArchWave AG, formerly known as BridgeCo. AG, designed DM1000, DM1100, and
DM1500 ASICs for BridgeCo. Enhancement BreakOut Box (BeBoB) solution.
They were used for many models shipped by many vendors.

The content of configuration ROM has standard layout of 1394 Trading
Association with an additional Dependent Information directory.

This commit adds database entries for the known models. ALSA bebob
driver supports them, but expects userspace application to control them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
5e939304f5 hwdb: allow parser to expect usage of slash sign in value of property
Although in IEEE 1394 unit function list I have a plan to use slash sign
in name of property, current implementation of parser doesn't allow it.
When parsing current entries in database excluded from parser testing, we
can find usage of slash sign in name of property.

This commit adds slash sign in allow list of the parser for my
convenience.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
7713f3fc6a hwdb: add parser grammar for IEEE 1394 unit function list
In added IEEE 1394 unit function list, I use custom key to detect unit
entries in node context. Although the list is not widely used in the most
of systemd users, I would like to add parser grammar for testing, by
borrowing a bit time in builders.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Takashi Sakamoto
f125f8b1ba hwdb: add hardware database for unit of IEEE 1394
Current udev rules configures group owner of firewire character device
to video group, corresponding to nodes in IEEE 1394 in below cases:

1.the node with any unit for any minor version of IIDC version 1
  specification defined by 1394 Trading Association
2.the node with any unit for specification defined by Point Grey Research
3.the node with any unit for AV/C device v1.0 defined by 1394 Trading
  Association
4.the node with any unit for vendor-unique protocol defined by 1394
  Trading Association

Nevertheless, case 3 and 4 can cover the node with any unit for audio
function as well. In the cases, it's convenient to assign audio group.

Additionally, some nodes are known to have layout different from
the specification defined by 1394 Trading Association. In the case,
it's required to add rules specific to them.

Furthermore, some nodes have no fields for vendor name and model name in
configuration ROM. In the case, it's required to add entries to hardware
database for users convenience.

For the above reasons, this commit adds rules to use information in
hardware database for known units in IEEE 1394. One database entry
corresponds to one unit. Two types of key are used to match the unit;
customized key from node context, kernel modalias of unit context.
The entry has the type of function, at least. Supplementally, it has
vendor and model names.

For your information, below statements with Python pyparsing module are
expected to parse all of the custom key and module alias in the list:

```
subsystem_prefix = pp.Literal('ieee1394:').suppress()
hex_to_int = lambda a: int(a[0], 16)

node_prefix = pp.Literal('node:').suppress()
prefixed_lower_hex = pp.Combine(pp.Literal('0x') + pp.Word(pp.srange('[a-z0-9]'), exact=6)).setParseAction(hex_to_int)
ven_in_node = pp.dictOf(pp.Literal('ven'), prefixed_lower_hex)
mo_in_node = pp.dictOf(pp.Literal('mo'), prefixed_lower_hex)
unit_in_node = pp.Group(prefixed_lower_hex + pp.Literal(':').suppress() + prefixed_lower_hex)
units_in_node = pp.Group(pp.Literal('units') + pp.ZeroOrMore(pp.Literal('*')).suppress() + unit_in_node + pp.ZeroOrMore(pp.Literal('*')).suppress())
node_parser = subsystem_prefix + node_prefix + ven_in_node + pp.Optional(mo_in_node) + units_in_node

higher_hex = pp.Word(pp.srange('[A-Z0-9]'), exact=8).setParseAction(hex_to_int)
ven_in_unit = pp.dictOf(pp.Literal('ven'), higher_hex)
mo_literal_in_unit = pp.dictOf(pp.Literal('mo'), higher_hex)
mo_in_unit = pp.dictOf(pp.Literal('mo'), higher_hex ^ pp.Literal('*'))
sp_in_unit = pp.dictOf(pp.Literal('sp'), higher_hex)
ver_in_unit = pp.dictOf(pp.Literal('ver'), higher_hex)
unit_parser = subsystem_prefix + ven_in_unit + mo_in_unit + sp_in_unit + ver_in_unit

key_parser = node_parser ^ unit_parser
```

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-04-07 11:49:22 +09:00
Luca Boccassi
a7ea0a460b Add markdown doc about coredump package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
d1b5a0c691 coredumpctl: parse and print package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
c546154a44 coredump: parse and append package metadata to journal message
Append 'package' and 'packageVersion' to the journal as discrete fields
COREDUMP_PKGMETA_PACKAGE and COREDUMP_PKGMETA_PACKAGEVERSION respectively,
and the full json blurb as COREDUMP_PKGMETA_JSON.
2021-04-06 23:12:51 +01:00
Luca Boccassi
95f7180773 coredump: parse .note.package ELF section
Parse the .note.package ELF section for each ELF object
contained in a core file, if present.
2021-04-06 22:53:54 +01:00
Luca Boccassi
965e095546 coredump: parse build-id out of core file
Parse the build-id of each ELF object contained in the core file
using the elfutils' libdwfl interface.
Add it to the journal.
2021-04-06 22:52:48 +01:00
Luca Boccassi
ee579e6454
Merge pull request #19215 from braewoods/main
hwdb: 60-keyboard:: Add quirks for 2 new HP laptops
2021-04-06 18:52:11 +01:00
Lennart Poettering
1b30720c1b tpm2-util: properly load tpm2 libraries befre unsealing
We forgot a call to dlopen_tpm2() in the unseal codepaths. As long as
automatic TPM2 device discovery was used that didn't matter, since in
that codepaths we'd have another call dlopen_tpm2(). But with an
explicitly configured TPM2 device things should work too, hence add the
missing call.

Fixes: #19206
2021-04-06 18:43:24 +02:00
Lennart Poettering
ff2cf6f8fe recovery-key: add some extra asserts
Let's ensure our key sizes calculations are correct.

This doesn't actually change anything, just adds more safety checks.
Inspired by #19203, but not a fix.
2021-04-06 18:42:30 +02:00
KoyamaSohei
da846b3031 resolve: copy rd flag from the query to response 2021-04-06 17:00:29 +02:00
Sibo Dong
f34173a048 bash-completion: localize words and cword variables
The words and cword variables are not localized in all Bash completion
scripts that call _init_completion.

cur, prev, words, and cword (and split if using the -s flag) are all
variables that should be localized in Bash completion scripts before
calling _init_completion (even if they don't otherwise appear in the
calling script). This is done for cur and prev, but not for words and
cword. Letting words and cword remain unlocalized may clobber variables
the user is using for other purposes, which is bad.

This issue can be resolved by declaring words and cword as local
variables.

Resolves #19188.
2021-04-06 16:15:13 +02:00
Luca Boccassi
7c20dd4b6e sysusers/firstboot: temporarily disable LoadCredential
Single-param LoadCredential= in units causes systemd v247/v248 to
assert when parsing. Disable it for now, until the fix is merged
in the stable trees, released and available (eg: in Debian
for the CI)

See: https://github.com/systemd/systemd/issues/19178
2021-04-06 12:02:42 +02:00
Lennart Poettering
f3e58b55de update 2021-04-06 11:48:37 +02:00
James Buren
5f6e4dc4f4 hwdb: 60-keyboard:: Add HP ProBook 455 G5 hotkey quirks
This enables all of the known hotkeys that were not working out of the
box on my test unit.
2021-04-06 02:18:26 -05:00
James Buren
98fa828f60 hwdb: 60-keyboard:: Add HP mt44 Mobile Thin Client hotkey quirks
This enables all of the known hotkeys that were not working out of the
box on my test unit.
2021-04-06 01:32:37 -05:00
Gibeom Gwon
fd11201b93 qrcode-util: set case-sensitive for generating QR codes
Until now, string treated case-insensitive, always converted to
uppercase. This can cause confusion such as user enter uppercased
recovery key.
2021-04-06 08:08:01 +02:00
Anita Zhang
afbcd90552 test-firewall-util: skip if iptables nat table does not exist 2021-04-06 08:01:27 +02:00
Zbigniew Jędrzejewski-Szmek
9d5ae3a121
Merge pull request #19126 from anitazha/oomdimprovements
systemd-oomd post-test week improvements
2021-04-06 07:59:59 +02:00
Frantisek Sumsal
34fde9f898 test: check if the unit file fuzzer corpora is up to date
This follows a similar pattern we already have in place for
networkd-related directives.
2021-04-05 14:41:05 +01:00
Anita Zhang
685b0985f0 oomd: threshold swap kill candidates to usages of more than 5%
In some instances, particularly with swap on zram, swap used will be high
while there is still a lot of memory available. FB OOMD handles this by
thresholding kills to X% of total swap usage. Let's do the same thing here.

Anecdotally with these thresholds and my laptop which is exclusively swap
on zram I can sit at 0K / 4G swap free with most of memory free and
systemd-oomd doesn't kill anything.

Partially addresses aggressive kill behavior from
https://bugzilla.redhat.com/show_bug.cgi?id=1941170
2021-04-05 02:04:49 -07:00
Anita Zhang
cb13961ada oomd: don't get pressure candidates on every interval
Only start collecting candidates for a memory pressure kill when we're
hitting the limit (but before the duration hitting that limit is
exceeded). This brings CPU util from ~1% to 0.3%.

Addresses CPU util from
https://bugzilla.redhat.com/show_bug.cgi?id=1941340
and
https://bugzilla.redhat.com/show_bug.cgi?id=1944646
2021-04-05 02:01:32 -07:00
Frantisek Sumsal
080a602771 fuzzer: add a test case for #19178 2021-04-03 10:38:06 +01:00
Luca Boccassi
1270e56526
Merge pull request #19179 from anitazha/buildandtest
test-oomd-util: fix running in mkosi
2021-04-02 17:56:13 +01:00
Viktor Mihajlovski
a496a238e8 udev: fix slot based network names on s390
The s390 PCI driver assigns the hotplug slot name from the
function_id attribute of the PCI device using a 8 char hexadecimal
format to match the underlying firmware/hypervisor notation.

Further, there's always a one-to-one mapping between a PCI
function and a hotplug slot, as individual functions can
hot plugged even for multi-function devices.

As the generic matching code will always try to parse the slot
name in /sys/bus/pci/slots as a positive decimal number, either
a wrong value might be produced for ID_NET_NAME_SLOT if
the slot name consists of decimal numbers only, or none at all
if a character in the range from 'a' to 'f' is encountered.

Additionally, the generic code assumes that two interfaces
share a hotplug slot, if they differ only in the function part
of the PCI address. E.g., for an interface with the PCI address
dddd:bb:aa.f, it will match the device to the first slot with
an address dddd:bb:aa. As more than one slot may have this address
for the s390 PCI driver, the wrong slot may be selected.

To resolve this we're adding a new naming schema version with the
flag NAMING_SLOT_FUNCTION_ID, which enables the correct matching
of hotplug slots if the device has an attribute named function_id.
The ID_NET_NAME_SLOT property will only be produced if there's
a file /sys/bus/pci/slots/<slotname> where <slotname> matches
the value of /sys/bus/pci/devices/.../function_id in 8 char
hex notation.

Fixes #19016
See also #19078
2021-04-02 18:08:23 +02:00
Zbigniew Jędrzejewski-Szmek
bd6ea22920
Merge pull request #18717 from yuwata/sd-device-monitor-introduce-more-filters
sd-device-monitor: introduce two new filters and use them in dissect-image.c
2021-04-02 15:53:16 +02:00
Carlo Teubner
6d3831cee5 docs: use current spelling "macOS" not "OS X" etc. 2021-04-02 10:53:26 +01:00
Yu Watanabe
0a8f9bc6bb dissect-image: move parent device check into device_is_partition()
Checking parent for enumerated devices is mostly redundant. Just for
safety.
2021-04-02 15:10:09 +09:00
Yu Watanabe
11368b694e dissect-image: also check devtype in device_is_partition()
This should be mostly redundant. Just for safety.
2021-04-02 15:10:09 +09:00
Yu Watanabe
210e1cd6e6 dissect-image: filter out enumerated or triggered devices without "partition" sysattr
This also adds more filters for device enumerator and monitor.
These newly added filters should be mostly redundant. But this hides
spurious error in sd_device_get_sysattr_value(). See,
https://github.com/systemd/systemd/pull/18684#discussion_r579700977
2021-04-02 15:10:09 +09:00
Yu Watanabe
def366933c test: add tests for filters of sd-device-monitor 2021-04-02 15:10:09 +09:00
Yu Watanabe
b8a0edbb2a sd-device-monitor: introduce sd_device_monitor_filter_add_match_parent() 2021-04-02 15:10:09 +09:00
Yu Watanabe
bcfe746ba7 sd-device-enumerator: also move match_parent() to device-util.[ch] 2021-04-02 15:10:09 +09:00
Yu Watanabe
d9b030b673 sd-device-monitor: introduce sd_device_monitor_filter_add_match_sysattr() 2021-04-02 15:10:09 +09:00
Yu Watanabe
ac790e8bfc sd-device-enumerator: move match_sysattr() to device-util.[ch]
It will be used by sd-device-monitor in later commits.
2021-04-02 15:10:07 +09:00
Yu Watanabe
112e6dd106 sd-device-monitor: split passes_filter() into two parts 2021-04-02 15:09:03 +09:00
Anita Zhang
080ca0d830 test-oomd-util: fix running in mkosi
When this test is run in mkosi, the previously tested cgroup that we write
xattrs into and the root cgroup are the same.

Since the root cgroup is a live cgroup anyways (vs. the test cgroups which are
remade each time) let's generate the expected preference values from reading
the xattrs instead of assuming it will be NONE.
2021-04-01 21:23:24 -07:00
Anita Zhang
a858355e4a oomd: force DefaultMemoryPressureDurationSec= to be greater than or equal 1 sec 2021-04-01 19:53:42 -07:00
Anita Zhang
14140b3544 oomd: delete unused variables 2021-04-01 19:53:13 -07:00
Anita Zhang
69c8f0255a oomd: rename last_hit_mem_pressure_limit -> mem_pressure_limit_hit_start
Since this is only changed the first time the limit is hit (and remains
set as long as the pressure remains over), I changed the name to better
reflect that.

Keeps consistent with "last_had_mem_reclaim" which is actually updated
every time there is reclaim activity.
2021-04-01 19:52:49 -07:00
Anita Zhang
df637ede7b oomd: rework memory reclaim detection logic
systemd-oomd only monitors and kills within a selected cgroup subtree
For memory pressure kills, this means it's unnecessary to get the
pgscan rate across all the monitored memory pressure cgroups.
The increase will show up whether we do a total sum or not, but since
we only care about the increase in the subtree we're about to target
for a kill, we can simplify the code a bit by not doing this total sum.
2021-04-01 19:51:54 -07:00
Anita Zhang
37d8020ccc oomd: refactor pgscan_rate calculation into helper 2021-04-01 19:45:24 -07:00
Anita Zhang
81d66fab34 oomd: split swap and mem pressure event timers
One thing that came out of the test week is that systoomd needs to poll
more frequently so as not to race with the kernel oom killer in
situations where memory is eaten quickly. Memory pressure counters are
lagging so it isn't worthwhile to change the current read rate; however swap
is not lagging and can be checked more frequently.

So let's split these into 2 different timer events. As a result, swap
now also doesn't have to be subject to the post-action (post-kill) delay
that we need for memory pressure events.

Addresses some of slowness to kill discussed in
https://bugzilla.redhat.com/show_bug.cgi?id=1941340
2021-04-01 19:44:14 -07:00
Anita Zhang
ea460d7964 meson: link with libm for math functions
Fixes this error I got building on F33:
  /usr/bin/ld: test-random-util.p/src_test_test-random-util.c.o: undefined
  reference to symbol 'sqrt@@GLIBC_2.2.5'
  /usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing
  from command line
2021-04-01 18:45:48 -07:00
Joerg Behrmann
8ab34a49db systemd-notify: Fix return value of --booted 2021-04-01 20:42:22 +01:00
Luca Boccassi
28a9744673
Merge pull request #19175 from keszybz/maybe-unitialized-warning-2
Third batch of fixes and suppressions for maybe-unitialized warnings
2021-04-01 19:45:08 +01:00
Luca Boccassi
677ba9d062 resolved: use _cleanup_(gcry_md_closep) in one more place
Documentation says gcry_md_close will ignore a NULL input so should be safe:

https://gnupg.org/documentation/manuals/gcrypt/Working-with-hash-algorithms.html

Makes Coverity happy, follow-up for 248b1e0aa4

CID #1451555
2021-04-01 15:00:51 +01:00
Zbigniew Jędrzejewski-Szmek
0f4b6e59bd libudev: fix return of udev_monitor_filter_add_match_subsystem_devtype()
Follow-up for 7117842657c0fc5a3446b6fe158615279cf2d650.

sd_device_monitor_filter_add_match_subsystem_devtype() now returns 1 to signify
that something was done, and 0 to signify that nothing was done, but
udev_monitor_filter_add_match_subsystem_devtype() needs to return 0 as documented.

udev_monitor_filter_add_match_tag() is adjusted to match.

This makes gdm start successfully here again.
Before, it would just not boot, with nothing very obvious in the logs:
gdm[1756]: Gdm: GdmDisplay: Session never registered, failing

Replaces #19171.
2021-04-01 14:59:58 +01:00
Zbigniew Jędrzejewski-Szmek
9e53c10a0f Flagsify EscapeStyle and make ESCAPE_BACKSLASH_ONELINE implicit
I want to tweak behaviour further, and that'll be easier when "style"
is converted to a bitfield.

Some callers used ESCAPE_BACKSLASH_ONELINE, and others not. But the
ones that didn't, simply didn't care, because the argument was assumed to
be one-line anyway (e.g. a service name). In environment-generator, this
could make a difference. But I think it's better to escape the newlines
there too. So newlines are now always escaped, to simplify the code and
the test matrix.
2021-04-01 12:46:24 +02:00
Zbigniew Jędrzejewski-Szmek
679b0b0a21 test-process-util: getpid_cached() → 0
This has the same effect and is less verbose.
2021-04-01 12:46:24 +02:00
Zbigniew Jędrzejewski-Szmek
e7d48709ed resolved: avoid passing unitialized variable
The issue was introduced in the refactoring in 775ae35403f8f3c01b7ac13387fe8aac1759993f.
We would pass an initialized value to a helper function. We would only *use*
it if it was initialized. But the mere passing of an unitialized variable is
UB, so let's not do that. This silences a gcc warning.
2021-04-01 12:02:25 +02:00
Zbigniew Jędrzejewski-Szmek
aff81b1851 various: silence gcc warnings
AFAICT, gcc is just being stupid in all those cases.
2021-04-01 12:02:25 +02:00
Zbigniew Jędrzejewski-Szmek
1f8fb21c42 shared/dissect-image: silence gcc warning 2021-04-01 12:02:25 +02:00
Zbigniew Jędrzejewski-Szmek
04ab97a829 sd-netlink: drop unnecessary forward declaration 2021-04-01 12:02:25 +02:00
Zbigniew Jędrzejewski-Szmek
c03916164d backlight: refactor get_max_brightness() to appease gcc
The old code was just fine, but gcc doesn't understand that max_brightness is
initialized. Let's rework it a bit to move some logic to the main function. Now
get_max_brightness() just retrieves and parses the attribute, and the main
function decides what to do with it.
2021-04-01 12:01:58 +02:00
Zbigniew Jędrzejewski-Szmek
0246f42980 test-device-util: let's verify that we return proper error from log_device_* 2021-04-01 11:44:42 +02:00
Zbigniew Jędrzejewski-Szmek
023e75df4c sd-device: header needs an include because it uses sd_device type 2021-04-01 11:30:25 +02:00
Luca Boccassi
4cf1b41568
Merge pull request #19168 from keszybz/nss-resolve-unfoobar
Fix nss-resolve reverse alias lookups
2021-04-01 10:07:46 +01:00
Luca Boccassi
bd506dfb5e
Merge pull request #19169 from keszybz/reenable-maybe-unitialized-warning
Fix a bunch of maybe-unitialized warnings but don't enable the warning yet
2021-04-01 09:36:46 +01:00
Deepak Rawat
1d8a16f1f4 logind: Rename kexec reboot flag
Also change error message to be more meanigful. No change in
functionality.

Fixes: 0d96caa5c0
2021-03-31 21:43:45 +02:00
Zbigniew Jędrzejewski-Szmek
1dbd0bdb3a basic/env-util: silence two gcc warnings 2021-03-31 18:24:54 +02:00
Zbigniew Jędrzejewski-Szmek
c26f7dd9f0 cryptsetup: silence gcc maybe-unused warning
Simplify one debug stmt while at it.
2021-03-31 18:24:54 +02:00
Zbigniew Jędrzejewski-Szmek
703e2870b1 systemctl: silence gcc maybe-unused warning 2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
1c93632ead shared/pretty-print: silence gcc warning
gcc was very unhappy for some reason:

[988/1664] Compiling C object systemd-oomd.p/src_oom_oomd.c.o
In file included from ../src/basic/path-util.h:10,
                 from ../src/shared/pretty-print.c:14,
                 from ../src/oom/oomd.c:15:
../src/shared/pretty-print.c: In function ‘conf_files_cat’:
../src/basic/strv.h:123:32: warning: ‘prefixes’ may be used uninitialized [-Wmaybe-uninitialized]
  123 |         for ((s) = (l); (s) && *(s); (s)++)
      |                                ^
In file included from ../src/oom/oomd.c:15:
../src/shared/pretty-print.c:283:16: note: ‘prefixes’ was declared here
  283 |         char **prefixes, **prefix;
      |                ^~~~~~~~
../src/shared/pretty-print.c:305:12: warning: ‘is_collection’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  305 |         if (!is_collection) {
      |            ^
../src/shared/pretty-print.c:301:13: warning: ‘extension’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  301 |         r = conf_files_list_strv(&files, extension, root, 0, (const char* const*) dirs);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Maybe this is caused by the statis char** variables?
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
1a2948fece core: silence gcc warning 2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
487c123a32 shared/bus-message-util: silence gcc warning
[1/429] Compiling C object src/shared/libsystemd-shared-248.a.p/bus-message-util.c.o
../src/shared/bus-message-util.c: In function ‘bus_message_read_dns_servers’:
../src/shared/bus-message-util.c:165:21: warning: ‘family’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  165 |                 r = in_addr_full_new(family, &a, port, 0, server_name, dns + n);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/bus-message-util.c:165:21: warning: ‘port’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/shared/bus-message-util.c:165:21: warning: ‘server_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]

The warning would be there despite all the asserts in bus_error_setfv() and
sd_bus_error_set(). So let's add an explicit assert.
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
9fd8d678ba shared/conf-parser: fix unitialized variable
Introduced in 4f9ff96a55187927a4164a19df580329f4c6522b.
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
0a94e77ed4 test-capability: silence gcc warning
[2/3] Compiling C object test-capability.p/src_test_test-capability.c.o
../src/test/test-capability.c: In function ‘main’:
../src/test/test-capability.c:270:12: warning: ‘run_ambient’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  270 |         if (run_ambient)
      |            ^

gcc-11.0.1-0.3.fc34.x86_64
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
bc20c31bbc basic/cgroup-util: silence gcc warning about unitialized variable 2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
bfd9bfccce sd-event: silence gcc's maybe-unitialized warning
[91/180] Compiling C object libsystemd.a.p/src_libsystemd_sd-event_sd-event.c.o
In file included from ../src/basic/macro.h:12,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/libsystemd/sd-event/sd-event.c:11:
../src/libsystemd/sd-event/sd-event.c: In function ‘sd_event_wait’:
../src/fundamental/macro-fundamental.h:86:63: warning: ‘child_min_priority’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   86 |                 UNIQ_T(A, aq) < UNIQ_T(B, bq) ? UNIQ_T(A, aq) : UNIQ_T(B, bq); \
      |                                                               ^
../src/libsystemd/sd-event/sd-event.c:3983:45: note: ‘child_min_priority’ was declared here
 3983 |                 int64_t epoll_min_priority, child_min_priority;
      |                                             ^~~~~~~~~~~~~~~~~~

Alternative to #19159.
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
4990d4b8ff varlink: use two local flag variables to silence gcc warning
[59/655] Compiling C object src/shared/libsystemd-shared-248.a.p/varlink.c.o
../src/shared/varlink.c: In function ‘varlink_write’:
../src/shared/varlink.c:459:12: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  459 |         if (n < 0) {
      |            ^
../src/shared/varlink.c: In function ‘varlink_process’:
../src/shared/varlink.c:541:12: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  541 |         if (n < 0) {
      |            ^
../src/shared/varlink.c:486:17: note: ‘n’ was declared here
  486 |         ssize_t n;
      |                 ^
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
af46237ea1 man: split the description of sd_bus_error_set()
It was one giant all of text in pseudo-random order. Let's split it into
paragraphs talk about one subject each.

And unfortunately, the description of what happens when the error is not
set was not correct. In general, various functions treat 0/NULL as
not-an-error, and return 0.
2021-03-31 18:24:53 +02:00
Zbigniew Jędrzejewski-Szmek
b9c19bc384 sd-bus: add asserts showing that sd_bus_error_setf() returns negative
(when name is specified).
2021-03-31 18:24:44 +02:00
Zbigniew Jędrzejewski-Szmek
c7e964c944 sd-bus: add assert to tell the compiler that the error code is positive
I was hoping it would help with the following gcc warning:
[35/657] Compiling C object src/shared/libsystemd-shared-248.a.p/bus-message-util.c.o
../src/shared/bus-message-util.c: In function ‘bus_message_read_dns_servers’:
../src/shared/bus-message-util.c:165:21: warning: ‘family’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  165 |                 r = in_addr_full_new(family, &a, port, 0, server_name, dns + n);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/bus-message-util.c:165:21: warning: ‘port’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/shared/bus-message-util.c:165:21: warning: ‘server_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]

It actually doesn't, but the compiler has a point here: the code is specified
in sd_bus_error_map[], and it has no way of knowning that we want it to be a
positive value.

I think this should be an assert, because if this assumption fails, a
programming error has occured, something that'd want to catch.
2021-03-31 18:22:53 +02:00
Zbigniew Jędrzejewski-Szmek
55e2cfc938 basic/fileio: silence gcc's maybe-unitialized warning
[11/657] Compiling C object src/basic/libbasic.a.p/fileio.c.o
../src/basic/fileio.c: In function ‘write_string_stream_ts’:
../src/basic/fileio.c:167:21: warning: ‘fd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  167 |                 if (futimens(fd, twice) < 0)
      |                     ^~~~~~~~~~~~~~~~~~~
2021-03-31 18:22:53 +02:00
Zbigniew Jędrzejewski-Szmek
befab2c40c basic/socket-util: add hint to silence gcc's maybe-unitialized warning
[59/1551] Compiling C object src/basic/libbasic.a.p/socket-util.c.o
../src/basic/socket-util.c: In function ‘socket_get_mtu’:
../src/basic/socket-util.c:1393:16: warning: ‘mtu’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1393 |         *ret = (size_t) mtu;
      |                ^~~~~~~~~~~~
2021-03-31 18:22:53 +02:00
Zbigniew Jędrzejewski-Szmek
adf6d848df resolved: drop unnecessary {} 2021-03-31 18:22:53 +02:00
Zbigniew Jędrzejewski-Szmek
75d2f0a0c4 nss-resolve: define variables in the body
Same motivation as in the parent commit: let's define variables later, ideally
right when they are first initialized, so it's easier to figure out that they
are properly initialized.

error_id and r_tuple* were previously initialized, but I don't see why they
would need to be.

No functional change intended.
2021-03-31 17:19:03 +02:00
Zbigniew Jędrzejewski-Szmek
77fac974fe nss-resolve: fix parsing of io.systemd.Resolve.ResolveAddress reply
Since the switch to varlink in 0c73f4f075a2d23f7cabe708b589f19f4bbbec37, the
code wasn't functional. The JSON_VARIANT_UNSIGNED/JSON_VARIANT_STRING mismatch
meant that we'd reject any reply. Once past that, the code would use
unitialized 'c' and 'n' variables, so it's lucky we never got that far ;)

With -Wmaybe-unitialized, gcc would warn.

I think that declaring the huge list of local variables with very short names
at the top of the function was making it harder to understand what is going on
in the function. So let's rename the variables a bit, and initialize them upon
declaration if possible.

$ build/test-nss-hosts resolve 1.1.1.1 1.0.0.1 10.38.5.41
======== resolve ========
_nss_resolve_gethostbyaddr2_r("1.1.1.1") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error) ttl=0
        "one.one.one.one"
        AF_INET 1.1.1.1

_nss_resolve_gethostbyaddr_r("1.1.1.1") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error)
        "one.one.one.one"
        AF_INET 1.1.1.1

_nss_resolve_gethostbyaddr2_r("1.0.0.1") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error) ttl=0
        "one.one.one.one"
        AF_INET 1.0.0.1

_nss_resolve_gethostbyaddr_r("1.0.0.1") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error)
        "one.one.one.one"
        AF_INET 1.0.0.1

_nss_resolve_gethostbyaddr2_r("10.38.5.41") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error) ttl=0
        "squid.redhat.com"
        alias "squid.corp.redhat.com"
        alias "squid2.corp.redhat.com"
        alias "squid3.corp.redhat.com"
        alias "squid4.corp.redhat.com"
        alias "squid5.corp.redhat.com"
        AF_INET 10.38.5.41

_nss_resolve_gethostbyaddr_r("10.38.5.41") → status=NSS_STATUS_SUCCESS
                   errno=999/--- h_errno=0/Resolver Error 0 (no error)
        "squid.redhat.com"
        alias "squid.corp.redhat.com"
        alias "squid2.corp.redhat.com"
        alias "squid3.corp.redhat.com"
        alias "squid4.corp.redhat.com"
        alias "squid5.corp.redhat.com"
        AF_INET 10.38.5.41

(I have 10.38.5.41 squid.redhat.com squid.corp.redhat.com squid2.corp.redhat.com squid3.corp.redhat.com squid4.corp.redhat.com squid5.corp.redhat.com
in /etc/hosts for testing.)
2021-03-31 16:28:14 +02:00
Sergey Bugaev
84b0ff0e32 resolved: reply using unicast mDNS when appropriate
Fixes https://github.com/systemd/systemd/issues/18434
2021-03-31 12:54:08 +03:00
Sergey Bugaev
82d3957646 resolved: fix mistaking QU bit for cache-flush bit
RFC 6762 defines the top bit in RRs to mean cache flush (section 10.2),
and the top bit in questions to mean that a unicast reply is wanted
(section 5.4).

dns_packet_read_key() is used for parsing both questions and RRs.
When called from dns_packet_extract_question(), the top bit being set
should not result in the packet being rejected as invalid.

Fixes https://github.com/systemd/systemd/issues/17973
2021-03-31 12:54:08 +03:00
Sergey Bugaev
ab715ddbaf resolved: add flags to DnsQuestion items
This adds DnsQuestionItem, which is to DnsQuestion what DnsAnswerItem is to
DnsAnswer.

No functional change.
2021-03-31 12:54:05 +03:00
Luca Boccassi
907952bbc9 portabled: add --extension parameter for layered images support
Add an --extension parameter to portablectl, and new DBUS methods
to attach/detach/reattach/inspect.
Allows to append separate images on top of the root directory (os-release
will be searched in there) and mount the images using an overlay-like
setup (unit files will be searched in there) using the new ExtensionImages
service option.
2021-03-31 09:56:44 +01:00
Luca Boccassi
248b1e0aa4 gcrypt: do not ignore return values
Check the return code from gcrypt's functions. In some
cases just log, as it shoulnd't really happen.

Fixes various Coverity issues:

CID #1444702
CID #1444704
CID #1444706
CID #1444711
CID #1444712
CID #1444713
2021-03-31 10:51:35 +02:00
Zbigniew Jędrzejewski-Szmek
a59eb7d78f rpm: when disabling a unit, do not complain if systemd is not running
$ sudo dnf remove --installroot=/var/tmp/img1 systemd-networkd
...
  Running scriptlet: systemd-networkd-248~rc4-4.fc32.x86_64      1/1
Removed /etc/systemd/system/multi-user.target.wants/systemd-networkd.service.
Removed /etc/systemd/system/sockets.target.wants/systemd-networkd.socket.
Removed /etc/systemd/system/dbus-org.freedesktop.network1.service.
Removed /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

(Another option would be make --now do nothing if systemd is not running.
But I think that's not too good. 'disable --now' doing nothing would be OK,
since if systemd is not running, the service is not running either, so we are
in the desired state. But that argument doesn't work for 'enable --now'. And
accepting 'disable --now' but not 'enable --now' seems overly complex. So I
think it is better to make the scriptlet handle this case explicitly.)

Also, let's reindent the file to 4 spaces. Very deeply nested scriptlets are
harder to read, and the triggers file is indented to 4 spaces already.
2021-03-31 10:50:07 +02:00
Jan Janssen
a83ddc08d6 resolved.conf: Add hostnames for default DNS servers 2021-03-31 10:49:36 +02:00
Deepak Rawat
0d96caa5c0 logind: Add new flag for kexec reboot
Add new flag to allow kexec reboot if kernel is already loaded.
2021-03-31 10:48:48 +02:00
Zbigniew Jędrzejewski-Szmek
a93af34a40
Merge pull request #19109 from poettering/resolved-transaction-log-tweaks
resolved: minor tweaks to transaction logic and logging
2021-03-31 10:47:12 +02:00
Lennart Poettering
9a515f0a55 shared: add new IMAGE_VERSION=/IMAGE_ID= field to /etc/os-release
This specifes two new optional fields for /etc/os-release:
IMAGE_VERSION= and IMAGE_ID= that are supposed to identify the image of
the current booted system by name and version.

This is inspired by the versioning stuff in
https://github.com/systemd/mkosi/pull/683.

In environments where pre-built images are installed and updated as a
whole the existing os-release version/distro identifier are not
sufficient to describe the system's version, as they describe only the
distro an image is built from, but not the image itself, even if that
image is deployed many times on many systems, and even if that image
contains more resources than just the RPMs/DEBs.

In particular, "mkosi" is a tool for building disk images based on
distro RPMs with additional resources dropped in. The combination of all
of these together with their versions should also carry an identifier
and version, and that's what IMAGE_VERSION= and IMAGE_ID= is supposed to
be.
2021-03-31 10:46:22 +02:00
Zbigniew Jędrzejewski-Szmek
e872679629
Merge pull request #19064 from yuwata/resolve-fix-cache-19049
resolve: several trivial cleanups
2021-03-31 10:42:21 +02:00
gaoyi
f257a8fc13 udevd: don't kill worker in manager_kill_workers when it's running
If worker is running, kill worker may lead uevent unprocessed.
2021-03-31 10:41:44 +02:00
Zbigniew Jędrzejewski-Szmek
a2dc3adef2
Merge pull request #18990 from yuwata/network-dhcpv6-use-domains
network: also introduce UseDomains= for [DHCPv6] section
2021-03-31 10:38:37 +02:00
Lennart Poettering
16ede1d75a
Merge pull request #19101 from poettering/mount-util-fixes
Make recursive bind remounting handle failures gracefully
2021-03-31 10:37:49 +02:00
Lennart Poettering
27ec815eb4 dissect: make the --image= switch of our various tools honour Verity data
This adds simple Verity support to
mount_image_privately_interactively(): we dicover the verity metadata
and use it.
2021-03-31 10:36:14 +02:00
Zbigniew Jędrzejewski-Szmek
224e6c844d
Merge pull request #18989 from yuwata/ordered-set-put-strdup
ordered-set: make ordered_set_put_strdup() allocate OrderedSet object
2021-03-31 10:36:03 +02:00
Lennart Poettering
6020d00d7e repart: make sure CopyFiles= works with a / suffixed path
If we define a partition with CopyFiles=/efi/ this should just work.
However it previously didn't because basename() would return the
trailing slash.

Let's fix this by moving things to path_extract_{directory|filename}()
2021-03-31 10:35:45 +02:00
Lennart Poettering
e0b4bc239f machine-id-setup: support --image= mode 2021-03-31 10:35:31 +02:00
Lennart Poettering
f9d8325e69
Merge pull request #18971 from poettering/sysusers-creds
let's read LoadCredentials=/SetCredentials= style cred in sysusers/firstboot and when asking for passwords
2021-03-31 10:35:17 +02:00
Zbigniew Jędrzejewski-Szmek
4c31bfdf55
Merge pull request #18982 from keszybz/test-nss-users
Add a new test for user/group resolution in nss modules
2021-03-31 10:32:09 +02:00
Zbigniew Jędrzejewski-Szmek
b880ac2c15
Merge pull request #18958 from poettering/dissect-no-root
dissect-image: support images without rootfs but with /usr partition + support simple partition versioning via strverscmp() on part label
2021-03-31 10:31:32 +02:00
Luca Boccassi
834bab01f9 compress: support streaming lz4 without full input mmap
The advantage of stream compression is keeping a low memory profile,
but the lz4 stream compressor usage mmaps the whole file in memory.

Change it to read bits by bits, like the other stream compression
helpers.
2021-03-31 10:29:36 +02:00
Zbigniew Jędrzejewski-Szmek
bcceabcfc2
Merge pull request #18886 from anitazha/shutdownconsole
logging shutdown to /dev/console
2021-03-31 10:28:26 +02:00
Zbigniew Jędrzejewski-Szmek
87f9300d71
Merge pull request #18850 from yuwata/sd-device-monitor-cleanups
sd-device-monitor: trivial cleanups
2021-03-31 10:27:06 +02:00
Henri Chain
cb0e818f7c Introduce ExitType 2021-03-31 10:26:07 +02:00
Zbigniew Jędrzejewski-Szmek
82a335db83
Merge pull request #18777 from yuwata/network-set-ifname-to-engines
network: set ifname to dhcp4 client or friends
2021-03-31 10:25:23 +02:00
Lennart Poettering
938bdfc0fa
Merge pull request #19157 from keszybz/read-medium-sized-virtual-file
basic/fileio: fix reading of not-too-small virtual files
2021-03-30 22:59:02 +02:00
Lennart Poettering
9ca34cf5a4 NEWS: prep release date 2021-03-30 22:00:11 +02:00
Zbigniew Jędrzejewski-Szmek
bca895c4f4 test-fileio: test for read_full_virtual_file()
It was already called through other places, but indirectly.
Let's add some direct invocations.
2021-03-30 21:58:59 +02:00
Zbigniew Jędrzejewski-Szmek
2ac67221bb basic/fileio: fix reading of not-too-small virtual files
This code is trying to do two things: when reading a file with working
st.st_size, detect when the file size changes between the fstat() and our
allocation of the buffer based on the returned size, and the subsequent read().
When reading a file without st.st_size, read up to READ_FULL_BYTES_MAX.

But this second scenario was partially broken: we'd start with size = 4095, and
double the size up to three times, i.e. up to 32767. But we want to read up to
READ_FULL_BYTES_MAX.

So let's listentangle the two cases a bit: if a file returns non-zero st._size,
proceed as before. But if we don't know the size, let's immediately allocate
the buffer of maximum size of READ_FULL_BYTES_MAX. I think that allocating 4MB
and 1MB is going to take pretty much the same time as long as the memory is not
written to, so by allocating 1MB, 2MB, and 4MB, we wouldn't really be saving
anything internally, but wasting time on repeated reads, if the file is long
enough.

Also, don't do the seek if we know we're going to return an error immediately
after.

This should fix reading of any files in /proc, which all have size == 0. In
particular, various files read by coredump might be larger than 32767.

What about /sys? The file there return a fake value, usually 4096. So we'll
allocate a small buffer and read that.
2021-03-30 21:56:22 +02:00
Luca Boccassi
ae63987fac
Merge pull request #19149 from anitazha/oomdlogging
oomd: make it more clear when a kill happens
2021-03-30 19:01:01 +01:00
Luca Boccassi
c71bb61e8d
Merge pull request #19155 from keszybz/hwdb-contrib-v248
hwdb update + contrib list
2021-03-30 18:13:16 +01:00
Zbigniew Jędrzejewski-Szmek
f94a80ab59 oomd: fix iteration over candidates to kill 2021-03-30 14:45:22 +02:00
Anita Zhang
37a7e15968 oomd: make it more clear when a kill happens
Improve the logging to only print if systemd-oomd killed something. And
also print which cgroup was targeted.
Demote general swap above/pressure above messages to debug.

[zjs: fix some issuelets found in review]
2021-03-30 14:44:09 +02:00
Lennart Poettering
414f59dad7
Merge pull request #19131 from keszybz/resolvectl-warn-less
Suppress warnings in resolvectl about --type=
2021-03-30 13:29:55 +02:00
Zbigniew Jędrzejewski-Szmek
7960ba96d1 selinux: do not crash if policy becomes unavailable after reload
https://bugzilla.redhat.com/show_bug.cgi?id=1944171
This was in F33, systemd-246.13, but the logic in the code didn't change.

Thread 1 (Thread 0x7fb5f0341b80 (LWP 1974)):
№0  selabel_lookup_common (rec=0x0, translating=0, key=0x55f616ac4750 "/run/user/1000/systemd/units/invocation:systemd-tmpfiles-clean.service", type=40960) at label.c:167

'rec' is the handle that we passed.

№1  0x00007fb5f13ae87f in selabel_lookup_raw (rec=<optimized out>, con=con@entry=0x7fffef307380, key=key@entry=0x55f616ac4750 "/run/user/1000/systemd/units/invocation:systemd-tmpfiles-clean.service", type=type@entry=40960) at label.c:256
        lr = <optimized out>

'rec' is passed through as is to selabel_lookup_common().

№2  0x00007fb5f1561b2d in selinux_create_file_prepare_abspath (abspath=0x55f616ac4750 "/run/user/1000/systemd/units/invocation:systemd-tmpfiles-clean.service", mode=40960) at ../src/basic/selinux-util.c:368
        filecon = 0x0
        r = <optimized out>
        __PRETTY_FUNCTION__ = "selinux_create_file_prepare_abspath"
        __func__ = "selinux_create_file_prepare_abspath"

№3  0x00007fb5f1561ec3 in mac_selinux_create_file_prepare (path=<optimized out>, mode=40960) at ../src/basic/selinux-util.c:431
        r = 0
        abspath = 0x55f616ac4750 "/run/user/1000/systemd/units/invocation:systemd-tmpfiles-clean.service"
        __PRETTY_FUNCTION__ = "mac_selinux_create_file_prepare"

We checked label_hnd != NULL, but then we apparently called
avc_netlink_check_nb(), which reset label_hnd. Yay for global state!

№4  0x00007fb5f1549950 in symlink_atomic_label (from=0x55f6169d8b50 "69a8dcf7a7ac46b29306f2fddbed3edc", to=0x55f616ab8380 "/run/user/1000/systemd/units/invocation:systemd-tmpfiles-clean.service") at ../src/basic/label.c:55
        r = <optimized out>
        __PRETTY_FUNCTION__ = "symlink_atomic_label"

In the logs:

Mar 29 14:48:44 fedorapad.home systemd[1974]: selinux: avc:  received policyload notice (seqno=2)
Mar 29 14:48:44 fedorapad.home systemd[1974]: Failed to initialize SELinux labeling handle: No such file or directory
Mar 29 14:48:44 fedorapad.home systemd[1974]: selinux: avc:  received policyload notice (seqno=3)
Mar 29 14:48:44 fedorapad.home systemd[1974]: selinux: avc:  received setenforce notice (enforcing=0)
2021-03-30 13:24:12 +02:00
Zbigniew Jędrzejewski-Szmek
f8a6e1e523 hwdb: update fingerprint autosuspend rules 2021-03-30 13:17:59 +02:00
Zbigniew Jędrzejewski-Szmek
a22c7690d4 hwdb: update for v248
As usual, it seems to be additions and updates, no major removals.
2021-03-30 13:17:59 +02:00
Zbigniew Jędrzejewski-Szmek
8ce2255178 NEWS: update contributor list for v248 final 2021-03-30 13:17:59 +02:00
Zbigniew Jędrzejewski-Szmek
b242d2dec9 git-contrib: use non-breaking spaces in names
Some people have initials or abbreviated parts in the name and looks strange
when a line break occurs in the middle. Let's keep each name in one line.
2021-03-30 13:17:59 +02:00
Zbigniew Jędrzejewski-Szmek
75e53df7e3 mailmap: two more names 2021-03-30 13:17:58 +02:00
Luca Boccassi
063a43a1a7 Revert "fix wrong statement JOURNAL_FILE_FORMAT.md doc"
This reverts commit 119063d2b149667a91e0e08e4bdf82a0eb6a7efd.
2021-03-30 10:26:54 +02:00
Yangyang Shen
119063d2b1 fix wrong statement JOURNAL_FILE_FORMAT.md doc 2021-03-29 19:11:27 +02:00
Christian Hesse
46cfe8f50d units: make locale directory writable for systemd-localed
With 8f20232fcb52dbe6255f3df6101fc057af90bcfa systemd-localed supports
generating locales when required. This fails if the locale directory is
read-only, so make it writable.

Closes #19138
2021-03-29 12:33:36 +02:00
Fangrui Song
945317a4b6 sd-bus: set retain attribute on BUS_ERROR_MAP_ELF_REGISTER
LLD 13 and GNU ld 2.37 support -z start-stop-gc which allows garbage
collection of C identifier name sections despite the __start_/__stop_
references.  Simply set the retain attribute so that GCC 11 (if
configure-time binutils is 2.36 or newer)/Clang 13 will set the
SHF_GNU_RETAIN section attribute to prevent garbage collection.

Without the patch, there are linker errors like the following with -z
start-stop-gc.

```
ld: error: undefined symbol: __start_SYSTEMD_BUS_ERROR_MAP
>>> referenced by bus-error.c:93 (../src/libsystemd/sd-bus/bus-error.c:93)
>>>               sd-bus_bus-error.c.o:(bus_error_name_to_errno) in archive src/libsystemd/libsystemd_static.a
```
2021-03-29 12:31:42 +02:00
Zbigniew Jędrzejewski-Szmek
8a773a30ba
Merge pull request #19116 from keszybz/readvirtualfile-opt
Optimize read_full_virtual_file() and another coverity issue
2021-03-29 10:51:32 +02:00
Zbigniew Jędrzejewski-Szmek
200b4f3d80 resolvectl: suppress warning about --type for names with a dot
People don't generally type the trailing dot by mistake, so let's treat this as
indication that they want to resolve this particular hostname.
2021-03-26 21:24:36 +01:00
Zbigniew Jędrzejewski-Szmek
a81c7ac8d4
Merge pull request #19129 from keszybz/test-random-range
Test random_u64_range()
2021-03-26 20:22:29 +01:00
Luca Boccassi
a9dd1010f0 test-dhcp6-client: add one more assert on memory mapping
Same as 7489d0640a4864d4b47fd8fda77f8eb7cf2e3fe8, one more case
that was missed.

Coverity CID #1394277
2021-03-26 20:17:35 +01:00
Zbigniew Jędrzejewski-Szmek
008adf875e
Merge pull request #19125 from keszybz/cat-config
config files: recommend systemd-analyze cat-config
2021-03-26 20:16:09 +01:00
Lennart Poettering
9ddf099f30 resolved: tweak how we signal authoritative answers
let's make sure we set the "aa" bit in the stub only if we answer with
fully authoritative data. For this ensure:

1. Either all data is synthetic, including all CNAME/DNAME redirects

2. Or all data comes from the local trust anchor or the local zones
   (i.e. not the network or the cache)

Follow-up for 4ad017cda57b04b9d65e7da962806cfcc50b5f0c
2021-03-26 18:21:41 +01:00
Zbigniew Jędrzejewski-Szmek
bc52deda4b tests: drop calls to unsetenv SYSTEMD_MEMPOOL
Coverity was complaining that we don't check the return value, which we stopped
doing in 772e0a76f34914f6f81205e912e4744c6b23f704.

But it seems that we don't want those calls at all. The test was originally
added with the call in a6ee01caf3409ba9820e8824b9262fbac31a9f77, but I don't
see why we should override this. If the user wants to execute the test with
mempool disabled, we shouldn't ignore that.

Coverity CID#1444464, CID#1444466.
2021-03-26 15:54:58 +01:00
Zbigniew Jędrzejewski-Szmek
f1a8a66c35 basic/fileio: use malloc_usable_size() to use all allocated memory 2021-03-26 15:54:56 +01:00
Zbigniew Jędrzejewski-Szmek
a9899ff358 basic/fileio: optimize buffer sizes in read_full_virtual_file()
We'd proceed rather inefficiently: the initial buffer size was LINE_MAX/2,
i.e. only 1k. We can read 4k at the same cost.

Also, we'd try to allocate 1025, 2049, 4097 bytes, i.e. always one higher than
the power-of-two size. Effectively the allocation would be bigger, and we'd
waste the additional space. So let's allocate aligned to the power-of-two size.
size=4095, 8191, 16383, so we allocate 4k, 8k, 16k.
2021-03-26 15:53:50 +01:00
Zbigniew Jędrzejewski-Szmek
ca79564309 basic/fileio: simplify calculation of buffer size in read_full_virtual_file()
We'd first assign a value up to SSIZE_MAX, and then immediately check if we
have a value bigger than READ_FULL_BYTES_MAX. This wasn't exactly wrong, but a
bit roundabout. Let's immediately assign the value from the appropriate range
or error out.

Coverity CID#1450973.
2021-03-26 15:46:44 +01:00
David Tardon
cb6c4f37dc use the right member to define property 2021-03-26 14:44:01 +01:00
Zbigniew Jędrzejewski-Szmek
f2a8b8decf test-random-util: add stochastic test for random_u64_range() 2021-03-26 14:38:44 +01:00
Zbigniew Jędrzejewski-Szmek
93457c0c7a test-random-util: modernization 2021-03-26 14:28:24 +01:00
Zbigniew Jędrzejewski-Szmek
058946d1f9 resolvectl: do not warn about single hostnames for names we synthesize
https://github.com/systemd/systemd/pull/17535#discussion_r534005801
2021-03-26 14:19:05 +01:00
Zbigniew Jędrzejewski-Szmek
75c9d6b5cf resolved: split out function to determine the local llmnr hostname 2021-03-26 14:18:51 +01:00
Zbigniew Jędrzejewski-Szmek
20e994b392 resolvectl: reword note about "raw record types"
As noted in https://github.com/systemd/systemd/pull/17535#discussion_r534129256,
"raw" is misleading in this context. Let's use a more descriptive term.
2021-03-26 14:18:17 +01:00
Zbigniew Jędrzejewski-Szmek
e355fb6fb1 basic/log: fix log_trace()
log_trace() was always on. It's supposed to be opt-in.
2021-03-26 13:08:24 +01:00
Lennart Poettering
9f17a03ae8 update TODO 2021-03-26 12:22:17 +01:00
Lennart Poettering
8806bb4bc7 ask-password: when querying for a password, try to read from credential store first
This adds generic support for the SetCredential=/LoadCredential= logic
to our password querying infrastructure: if a password is requested by a
program that has a credential store configured via
$CREDENTIALS_DIRECTORY we'll look in it for a password.

The "systemd-ask-password" tool is updated with an option to specify the
credential to look for.
2021-03-26 12:21:56 +01:00
Lennart Poettering
f6ab6199a2 man: document in nspawn docs how to make use of the new firstboot/sysusers features 2021-03-26 12:21:37 +01:00
Lennart Poettering
416f7b3a11 firstboot: allow provisioning of firstboot params via creds too 2021-03-26 12:21:18 +01:00
Lennart Poettering
f8fd093001 firstboot: slightly reorder variable declaration
Let's put the locale fields which we process together next to each
other.
2021-03-26 12:21:14 +01:00
Lennart Poettering
361662f434 units: make sure to query console settings before we apply them 2021-03-26 12:21:11 +01:00
Lennart Poettering
99e9f896fb sysusers: read passwords from the credentials logic
Let's make use of our own credentials infrastructure in our tools: let's
hook up systemd-sysusers with the credentials logic, so that the root
password can be provisioned this way. This is really useful when working
with stateless systems, in particular nspawn's "--volatile=yes" switch,
as this works now:

 # systemd-nspawn -i foo.raw --volatile=yes --set-credential=passwd.plaintext-password:foo

For the first time we have a nice, non-interactive way to provision the
root password for a fully stateless system from the container manager.
Yay!
2021-03-26 12:20:52 +01:00
Lennart Poettering
fc682be261 core: when inheriting credentials from manager to service, make missing creds graceful
Let's be a bit less strict when setting up credentials: if the service
manager didn't receieve a cred, and we shall propagate it down via
LoadCredentials= don't fail. Fail on all other errors though, as before,
and on explicitly listed paths.
2021-03-26 12:20:48 +01:00
Lennart Poettering
8a29862e32 core: allow omitting second part of LoadCredentials= argument
This allows "LoadCredentials=foo" to be used as shortcut for
"LoadCredentials=foo:foo", i.e. it's a very short way to inherit a
credential under its original name from the service manager into a
service.
2021-03-26 12:20:29 +01:00
Lennart Poettering
786d19fd1b util: add creds-util.[ch] with helpers for dealing with credentials 2021-03-26 12:19:31 +01:00
Lennart Poettering
67d22a3665 test: add explicit test for bind_remount_one_with_mountinfo() 2021-03-26 11:51:26 +01:00
Lennart Poettering
10cdbb8372 test: add test for bind_remount_recursive() 2021-03-26 11:51:26 +01:00
Lennart Poettering
0338df47cf mount-util: generate failure if bind_remount_one_with_mountinfo() is called on non-existing path 2021-03-26 11:51:26 +01:00
Lennart Poettering
b23c6a6411 mount-util: handle remount failures gracefully if flags already match
In bind_remount_one_with_mountinfo() let's handle mount failures
gracefully if the flags already match anyway. This isn't perfect, since
it mixes up superblock and mount point flags, but it's close enough.
2021-03-26 11:51:26 +01:00
Lennart Poettering
2c5ff8ea76 mount-util: fold what we need from get_mount_flags() bind_remount_one_with_mountinfo()
And get rid of get_mount_flags() altogether.

(This drops the statvfs() fallback that get_mount_flags() did. That
fallback was incomplete however, and mostly hid errors. Our primary
avenue to get mount flags is /proc/self/mountinfo and we should trust
it, and fix bugs we might encounter with it, but not tape over it.
Dropping the fallback is relevant in particular as it actually returned
mount flags for any path, not just mount points, which was very icky.)
2021-03-26 11:51:26 +01:00
Lennart Poettering
ba8dced2a6 mount-util: store mount flags in "todo" list in + handle submounts gracefully
This replaces the "todo" set with a "todo" hash map that stores the
mount flags we found. This makes an explicit call to get_mount_flags()
unncessary, since we have the flags handy right-away, and lowers our
work from O(n^2) to O(n). Nice!

The "done" set is also improved slightly: we'll use more modern ways to
allocate it, via set_ensure_consume(), and freeing-via-hash_ops.

Finally, failures on submount remounts are now handled gracefully,
there are just too many reasons why they might fail, given NFS, autofs,
FUSE which weird access controls, where even root might lack the privs
to do something.

Fixes: #16156
2021-03-26 11:51:26 +01:00
Lennart Poettering
4b6ef52756 mount-util: extend comment a bit, mention that we aren't atomic in behaviour 2021-03-26 11:39:37 +01:00
Lennart Poettering
5c5753b9ea mount-util: shortcut things after generating top-level bind mount
Instead of marking the bind mount read-only right-away, let's just
restart the loop, so that we'll pick it up like any other mount and then
remount like that.
2021-03-26 11:39:37 +01:00
Lennart Poettering
d6bfab118d mount-util: reorder a few things
Let's always query one property, check it, and then query the next,
preferring "cheap" ones over "slow" ones (i.e. cheap are the ones we can
check directly, and slow are the ones we need to check with some loop of
some kind).
2021-03-26 11:39:37 +01:00
Lennart Poettering
c6111b85f7 path: drop simplification of path in bind_remount_recursive_with_mountinfo()
We only use path-aware comparisons and hashops, hence no need to
simplify, we can use the path as it is.
2021-03-26 11:39:37 +01:00
Lennart Poettering
670e8efd60 mount-until: make sure we'll exit bind_remount_recursive_with_mountinfo() loop eventually
Just some robustness given that /proc/self/mountinfo was previously
broken in the kernel.
2021-03-26 11:39:37 +01:00
Lennart Poettering
9d0619dee7 mountpoint-util: rebreak some comments 2021-03-26 11:39:37 +01:00
Lennart Poettering
b898474fec mountpoint-util: a symlink is never a mount point
The various flavours of stat() basically tell us for free if something
is a symlink. If it is, then it's definitely not a mount point. Use
that.

All other inode types can be mount point, just symlinks cannot.
2021-03-26 11:39:37 +01:00
Lennart Poettering
981318d2b5 test-namespace: drop spurious double new line 2021-03-26 11:39:37 +01:00
Lennart Poettering
6d660692f2 resolved: use sd_event_add_time_relative() where appropriate 2021-03-26 11:38:04 +01:00
Lennart Poettering
213cb4f7e4 resolved: reset initial_jitter_elapsed properly
This fixes resetting of initial_jitter_elapsed: the first time the timer
hits after initial_jitter_scheduled is set we need to mark things as
elapsed.

(Also improve log messages around this while we are at it)
2021-03-26 11:38:01 +01:00
Lennart Poettering
2f9c3b2ab4 resolved: mention transaction ID in jitter log message 2021-03-26 11:37:57 +01:00
Lennart Poettering
9ee18bf473 resolved: use random_u64_range() for randomizing initial transaction jitter 2021-03-26 11:37:54 +01:00
Lennart Poettering
ca55fb8840 resolved: don't mention confusing server switch on server-less protocols 2021-03-26 11:37:49 +01:00
Zbigniew Jędrzejewski-Szmek
d83e90c73c Add READMEs in all .d directories 2021-03-26 09:35:07 +01:00
Zbigniew Jędrzejewski-Szmek
3b0754b16c config files: recommend systemd-analyze cat-config
This adds the same line to most of our .conf files.

Not for systemd/user.conf though, since we can't correctly display it right
now:
$ systemd-analyze cat-config --user systemd/user.conf
Option --user is not supported for cat-config right now.

For sysusers.d, tmpfiles.d, rules.d, etc, there is no single file. Maybe
we should short READMEs in /usr/lib/sysusers.d, /usr/lib/tmpfiles.d, etc.?

Inspired by #19118.
2021-03-26 08:45:04 +01:00
Zbigniew Jędrzejewski-Szmek
b240c08d09 docs: link to stable releases in the bug template
Also, ask people to use a recent stable release and provide useful version information.
Inspired by #19118.
2021-03-25 20:38:45 +00:00
Zbigniew Jędrzejewski-Szmek
7eafbd4270
Merge pull request #19112 from poettering/more-stub-fixes
resolved: two more tweaks to the stub
2021-03-25 21:31:27 +01:00
Luca Boccassi
6f4c93259e
Merge pull request #19117 from bluca/coverity
Two small coverity issues
2021-03-25 19:33:58 +00:00
Lennart Poettering
915ba31cfd resolved: rework CNAME logic a bit more
When following CNAME/DNAME redirects in the stub we currently first
iterate through the packet and pick up what we can use (in
dns_stub_collect_answer_by_question() and friends), following all
CNAMEs/DNAMEs, and would then issue dns_query_process_cname() to move
the DnsQuery object forward too, where we'd then possibly restart
the query and pick things up again, as above.

There's one thought error in this though: dns_query_process_cname()
tries to be smart and will internally follow not just a single
CNAME/DNAME redirect, but a chain of them if they are contained inside
the same packet until we reach the point where the answer is not
included in the packet anymore, where we'd restart the query. This was
great as long as we only focussed on the D-Bus and Varlink resolver
APIs, since there the CNAME/DNAME chain in the middle doesn't actually
matter, we just return information about the final name of the RR and
its content, and aren't interested in the chain to it. For the DNS stub
this is different however: there we need to place the full CNAME/DNAME
chain (and all the appropriate metadata RRs) in the stub reply.

Hence rework this so that we build on the fact that the previous commit
split dns_query_process_cname() in two:

1. dns_query_process_cname_one() will do exactly one CNAME/DNAME
   redirect step. This will be called by the stub, so that we can pick
   up matching RRs for every single step along the way.

2. dns_query_process_cname_many() will follow a chain as long as that's
   possible within the same packet. It's thus pretty much identical to
   the old dns_query_process_cname() call. This is what we now use in
   the D-Bus and Varlink APIs. dns_query_process_cname_many() is
   basically just a loop around dns_query_process_cname_one().

Any logic to follow and pick up RRs manually in the stub along the
CNAME/DNAME path is now dropped (i.e.
dns_stub_collect_answer_by_question() becomes trivially simple again),
we solely rely on dns_query_process_cname_one() to follow CNAME/DNAME
now: each step followed by a full call of dns_stub_assign_sections() to
copy out the RRs that matter.

Net result: things are a bit simpler again, as the only place we follow
CNAME/DNAME redirects is DnsQuery again, and stub answers are always
complete: they contain all CNAME/DNAME RRs on the way including all
their metadata we might pick up in the other sections.
2021-03-25 13:12:19 +01:00
Lennart Poettering
1db8e6d1db resolved: split dns_query_process_cname() into two separate functions
This does some refactoring: the dns_query_process_cname() function
becomes two: dns_query_process_cname_one() and
dns_query_process_cname_many(). The former will process exactly one
CNAME chain element, the latter will follow a chain for as long as
possible within the current packet.

dns_query_process_cname_many() is mostly identical to the old
dns_query_process_cname(), and all existing code is moved over to using
that.

This is mostly preparation for the next commit, where we make direct use
of dns_query_process_cname_one().

This also renames the DNS_QUERY_RESTARTED return value to
DNS_QUERY_CNAME. That's because in the dns_query_process_cname_many()
case as before if we return this we restarted the query in case we
reached the end of the chain without a conclusive answer, as before. But
in dns_query_process_cname_one() we'll only go one step anyway, and
leave restarting if needed to the caller. Hence DNS_QUERY_RESTARTED is a
bit of a misnomer in that case.

This also gets rid of the weird tail recursion in
dns_query_process_cname() and replaces it with an explicit loop in
dns_query_process_cname_many(). The old recursion wasn't a security
issue since we put a limit on the number of CNAMEs we follow anyway, but
it's still icky to scale stack use by that.
2021-03-25 13:12:19 +01:00
Luca Boccassi
7489d0640a test-dhcp6-client: add one more assert on memory mapping
Static analyzers need a hint that optval is not pointing
off the end of the msg_advertise array, since pos can go
up to the full length of it. The array is manually
constructed so we know this won't happen, but adding one
more assert should be enough to avoid false positives.

Coverity CID #1394277
2021-03-25 12:02:43 +00:00
Luca Boccassi
c0ef415862 test-firewall-util: add more asserts on allocated variables
Makes things nicer for readers, and hopefully gives static analyzers
a hint on the origin/cleanup of the ctx pointer.
Coverity CID #1451399
2021-03-25 10:49:06 +00:00
Lennart Poettering
d451f0e84b resolved: tweak sections we add answer RRs to
Previously we'd stick all answer sections RRs we acquired into
the authoritative section if we didn't find them directly answering our
question. Let's put them into additional instead. The authoritative
section should hence only include what comes from the upstream
authoritative section, and nothing else.
2021-03-25 11:42:39 +01:00
Lennart Poettering
8640566ac4 resolved: pass mDNS reply packets to each transaction exactly once
Previously we'd iterate through the RRs of an mDNS reply and then find
exactly one matching transaction on our scope for it, and pass it as
reply to that. If multiple RRs of the same packet match we'd pas the
packet multiple times to the transaction even.

This all doesn't really work anymore since there can be multiple open
transactions for the same key (with different flags), and it's kinda
ugly anywy. Hence let's turn this around: let's iterate through the
transactions and check if any of the included RRs match it, and if so
pass the packet to that transaction exactly once.

This speeds up mDNS a bit, since previously we'd oftentimes fail to find
all suitable transactions for an mDNS reply (because there can be
multiple transactions for the same RR key with different flags, and we
checked exactly one flag combination). Which would then mean the
transaction would time out, and be retried – at which point the cache
would be populated and thus it would still succeed, but only after this
timeout. With this fix this is corrected: every transaction that matches
will get the reply, instantly as we get it.
2021-03-25 11:37:30 +01:00
Lennart Poettering
9b564bbca5 resolved: upgrade log level to LOG_NOTICE if we switch to fallback server (or back)
This is inspired by a recent thread on fedora-devel: it's noteworthy
when we switch to the fallback servers, since it might (or might not)
indicate some configuration problem.

Fixes: #18788
2021-03-25 10:43:23 +01:00
simmon
390e67305d po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-03-25 10:42:02 +01:00
Lennart Poettering
729c5deb2e resolved: don't suppress OPT if we have no OPT
This is inspired by #18917. It suppresses a misleading log message about
suppressing OPT where we might not actually have OPT.
2021-03-25 11:38:53 +09:00
Luca Boccassi
a2c69debd9
Merge pull request #19076 from yuwata/firewall-util-modernizations
firewall-util: modernize code and improve test
2021-03-24 23:19:59 +00:00
David Tardon
d2f4a9488c local-addresses: fix use of uninitialized value
This can happen if ifi fails to be read from the netlink message and the
error is ENODATA.

Fixes the following valgrind message when running netstat:

==164141== Conditional jump or move depends on uninitialised value(s)
==164141==    at 0x524AE60: address_compare (local-addresses.c:29)
==164141==    by 0x48BCC78: msort_with_tmp.part.0 (msort.c:105)
==164141==    by 0x48BC9E4: msort_with_tmp (msort.c:45)
==164141==    by 0x48BC9E4: msort_with_tmp.part.0 (msort.c:53)
==164141==    by 0x48BCF85: msort_with_tmp (msort.c:45)
==164141==    by 0x48BCF85: qsort_r (msort.c:297)
==164141==    by 0x52500FC: UnknownInlinedFun (sort-util.h:47)
==164141==    by 0x52500FC: local_gateways.constprop.0 (local-addresses.c:310)
==164141==    by 0x5251C05: _nss_myhostname_gethostbyaddr2_r (nss-myhostname.c:456)
==164141==    by 0x5252006: _nss_myhostname_gethostbyaddr_r (nss-myhostname.c:500)
==164141==    by 0x498E7FE: gethostbyaddr_r@@GLIBC_2.2.5 (getXXbyYY_r.c:274)
==164141==    by 0x498E560: gethostbyaddr (getXXbyYY.c:135)
==164141==    by 0x121353: INET_rresolve.constprop.0 (inet.c:212)
==164141==    by 0x1135B9: INET_sprint (inet.c:261)
==164141==    by 0x121BFC: addr_do_one.constprop.0.isra.0 (netstat.c:1156)
2021-03-24 18:14:45 +01:00
Yu Watanabe
b5d2f4e757 test-firewall-util: use assert_se() at most places
Otherwise, we cannot notice any failures...
2021-03-25 01:05:54 +09:00
Pjotr Vertaalt
91a96a564f po: Translated using Weblate (Dutch)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Pjotr Vertaalt <pjotrvertaalt@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/nl/
Translation: systemd/main
2021-03-24 18:26:52 +09:00
Anita Zhang
7b7a060e83 process-util: dont allocate max length to read /proc/PID/cmdline
Alternative title: Replace get_process_cmdline()'s fopen()/fread() with
read_full_virtual_file().

When RLIMIT_STACK is set to infinity:infinity, _SC_ARG_MAX will
return 4611686018427387903 (depending on the system, but definitely
something larger than most systems have). It's impractical to allocate this
in one go when most cmdlines are much shorter than that.

Instead use read_full_virtual_file() which seems to increase the buffer
depending on the size of the contents.
2021-03-24 16:46:45 +09:00
Lincoln Ramsay
7325a2b2d1
pid1: do not use generated strings as format strings (#19098)
The generated string may include %, which will confuse both the
xprintf call, and the VA_FORMAT_ADVANCE macro.

Pass the generated string as an argument to a "%s" format string
instead.
2021-03-24 16:37:25 +09:00
hide
6b1ed5e7e6
network: fix ipv6 tunnel encapsulation limit (#19087)
The encapsulation limit of IPv6 tunnel can not be set to 4, which is the default value of the encapsulation limit.
2021-03-24 01:05:25 +09:00
Lennart Poettering
f19384b43f repart: remove spurious empty double newlines 2021-03-23 15:52:59 +00:00
Lennart Poettering
86b8610794 blockdev-util: actually specify an access mode on open()
Linux is pretty lenient here, but we should specify the access mode.
2021-03-23 16:37:05 +01:00
Lennart Poettering
49bd547b38 update TODO 2021-03-23 14:43:07 +01:00
Zbigniew Jędrzejewski-Szmek
f0cb09bb0f test-nss-hosts: make buffer size configurable too and document it 2021-03-23 14:14:08 +01:00
Zbigniew Jędrzejewski-Szmek
e2aa384bcd test-nss-hosts: use _cleanup_, fix return value, assert on allocations 2021-03-23 14:14:08 +01:00
Zbigniew Jędrzejewski-Szmek
f0d1266821 test-nss-users: add new nss test that resolves users and groups
Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1929936.
This is similar to test-nss-hosts, but does users, groups, uid, gids.

Functions tested are:
_nss_*_getpwnam_r
_nss_*_getgrnam_r
_nss_*_getpwgid_r
_nss_*_getgrgid_r

Other entry points should be tested too, but it's not relevant to the bug
I was investigating, so I'm leaving that for later ;)
2021-03-23 14:14:08 +01:00
Yu Watanabe
9fffe0a912 resolve: dns_answer_contains() does not return negative errno 2021-03-23 21:30:23 +09:00
Yu Watanabe
06939d3b0c resolve: use dns_answer_size() and dns_answer_isempty() 2021-03-23 21:30:23 +09:00
Yu Watanabe
ae526a5ea5 resolve: rename function argument in prototype to match its declaration 2021-03-23 21:30:23 +09:00
Yu Watanabe
160f3145db resolve: drop doubled white space 2021-03-23 21:30:23 +09:00
Yu Watanabe
8e95506a22 resolve: drop meaningless bitfield specifier
This also rearrange the members to remove holes in the struct.
2021-03-23 21:30:23 +09:00
Pjotr Vertaalt
798c65cf1f po: Added translation using Weblate (Dutch)
Co-authored-by: Pjotr Vertaalt <pjotrvertaalt@gmail.com>
2021-03-23 11:06:02 +01:00
David Tardon
f055cf7786 man: document differences in clean exit status for Type=oneshot
See commit 1f0958f640b87175cd547c1e69084cfe54a22e9d .
2021-03-23 09:33:23 +01:00
Christian Hesse
3babb81625 man: rate limited services can be restartet from timer or socket
If rate limiting kicks in for Restart= logic it is still possible for a
timer or socket to restart the service.
2021-03-23 09:16:30 +01:00
Zbigniew Jędrzejewski-Szmek
39f756d3ae sd-event: disable epoll_pwait2 for now
This reverts the gist of commit 798445ab84cff51bde7fcf936f0fb19c37cf858c.

Unfortunately the new syscall causes test-event to hang. 32 bit architectures
seem affected: i686 and arm32 in fedora koji. 32 bit build of test-event hangs
reliably under valgrind:

$ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig meson build-32 -Dc_args=-m32 -Dc_link_args=-m32 -Dcpp_args=-m32 -Dcpp_link_args=-m32 && ninja -C build-32 test-event && valgrind build/test-event

If I set epoll_pwait2_absent=true, so the new function is never called, then
the issue does not reproduce. It seems to be strictly tied to the syscall.

On amd64, the syscall is not used, at least with the kernel that Fedora
provides. The kernel patch 58169a52ebc9a733aeb5bea857bc5daa71a301bb says:

  For timespec, only support this new interface on 2038 aware platforms
  that define __kernel_timespec_t. So no CONFIG_COMPAT_32BIT_TIME.

And Fedora sets CONFIG_COMPAT_32BIT_TIME=y. I expect most other distros will too.

On amd64: epoll_wait_usec: epoll_pwait2: ret=-1 / errno=38
On i686 (same kernel): epoll_wait_usec: epoll_pwait2: ret=2 / errno=0

Is this some kind of emulation? Anyway, it seems that this is what is going wrong.

So let's disable the syscall until it becomes more widely available and the
kinks have been ironed out.

Fixes test-event issue in #19052.
2021-03-23 09:10:29 +01:00
Zbigniew Jędrzejewski-Szmek
ca83c7f88c
Merge pull request #19075 from keszybz/calendarspec-loop
Fix infinite loop in calendarspec calculation when timezone has negative DST save value
2021-03-23 09:06:16 +01:00
Yu Watanabe
0c4363a005 firewall-util: refuse IPv6 firewall rules when kernel does not support IPv6 2021-03-23 15:17:44 +09:00
Yu Watanabe
175bc86315 firewall-util: gracefully handle -EOVERFLOW returned from older kernel 2021-03-23 15:17:44 +09:00
Yu Watanabe
5ee7c719e1 firewall-util: do not use goto for retrying 2021-03-23 15:17:44 +09:00
Yu Watanabe
84af90ba5d firewall-util: add missing return value check 2021-03-23 15:17:44 +09:00
Yu Watanabe
dfb433f2a7 firewall-util: probe firewall backend in fw_ctx_new()
FirewallContext is used by networkd and nspawn. Both allocates the
context when it is really necessary. Hence, it is not necessary to delay
probing backend.

Moreover, if iptables backend is not enabled on build, and nftables is
not supported by kernel, previously `fw_nftables_init()` is called
everytime when we try to configure masquerade or dnat. It causes
significant performance loss.

Fixes test-firewall-util issue in #19052.
2021-03-23 15:17:34 +09:00
Yu Watanabe
4fb8a48ff0 network: allocate FirewallContext lazily 2021-03-23 14:41:13 +09:00
Yu Watanabe
da00b84087 firewall-util: logs which backend will be used
This also modernizes code a bit.
2021-03-23 14:40:50 +09:00
Zbigniew Jędrzejewski-Szmek
129cb6e249 shared/calendarspec: when mktime() moves us backwards, jump forward
When trying to calculate the next firing of 'Sun *-*-* 01:00:00', we'd fall
into an infinite loop, because mktime() moves us "backwards":

Before this patch:
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
...

We rely on mktime() normalizing the time. The man page does not say that it'll
move the time forward, but our algorithm relies on this. So let's catch this
case explicitly.

With this patch:
$ TZ=Europe/Dublin faketime 2021-03-21 build/systemd-analyze calendar --iterations=5 'Sun *-*-* 01:00:00'
Normalized form: Sun *-*-* 01:00:00
    Next elapse: Sun 2021-03-21 01:00:00 GMT
       (in UTC): Sun 2021-03-21 01:00:00 UTC
       From now: 59min left
       Iter. #2: Sun 2021-04-04 01:00:00 IST
       (in UTC): Sun 2021-04-04 00:00:00 UTC
       From now: 1 weeks 6 days left           <---- note the 2 week jump here
       Iter. #3: Sun 2021-04-11 01:00:00 IST
       (in UTC): Sun 2021-04-11 00:00:00 UTC
       From now: 2 weeks 6 days left
       Iter. #4: Sun 2021-04-18 01:00:00 IST
       (in UTC): Sun 2021-04-18 00:00:00 UTC
       From now: 3 weeks 6 days left
       Iter. #5: Sun 2021-04-25 01:00:00 IST
       (in UTC): Sun 2021-04-25 00:00:00 UTC
       From now: 1 months 4 days left

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1941335.
2021-03-23 00:35:02 +01:00
Luca Boccassi
e6fda8f675
Merge pull request #19079 from poettering/resolved-ipv6-cache-fix
fix CNAME/DNAME following in combined A/AAAA replies
2021-03-22 23:20:11 +00:00
Luca Boccassi
d4bb2b0b4e
Merge pull request #19081 from keszybz/three-comment-updates
Three comment updates
2021-03-22 22:36:01 +00:00
Zbigniew Jędrzejewski-Szmek
ccd593a61c man: say that .device units need udev
This was implied by the need to tag them with "systemd", but let's make this
obvious, since it's rather easy to trip over this as a user.

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1941458.
2021-03-22 21:48:45 +01:00
Zbigniew Jędrzejewski-Szmek
d229704743 Reword and reindent comment
Follow-up for 0e557eef37.
2021-03-22 21:48:17 +01:00
Zbigniew Jędrzejewski-Szmek
de0b89913c Partially revert "correct incorrect command in NEWS (#19048)"
This reverts commit 6d18c13e79a0b3374599a3416a644a7837d5a1e6.

The syntax like "0666" is very unclear. It only makes sense for some subset of
people who do C programming. Let's use the much more sensible modern python
syntax instead.
2021-03-22 21:33:03 +01:00
Zbigniew Jędrzejewski-Szmek
965984240e
Merge pull request #19058 from bugaevc/log-open-protect-errno
Save errno over log_open() calls
2021-03-22 21:28:28 +01:00
Yu Watanabe
c23bb96b38 shell-completion: systemd-run: add missing options
Closes #19044.
2021-03-22 21:20:17 +01:00
Lennart Poettering
24063ba16a update TODO 2021-03-22 21:17:58 +01:00
Zbigniew Jędrzejewski-Szmek
47b0b65766 test-calendarspec: do not convert timezone "" to ":"
I *think* it doesn't actually make any difference, because ":" will be ignored.
437f48a471f51ac9dd2697ee3b848a71b4f101df added prefixing with ":", but didn't
take into account the fact that we also use "" with a different meaning than
NULL here. But let's restore the original behaviour of specifying the empty
string.
2021-03-22 20:08:16 +01:00
Zbigniew Jędrzejewski-Szmek
f035bb1b7a test-calendarspec: print offending line in output
The output is rather long at this makes it easier to jump to the right place.
Also use normal output routines and set_unset_env() to make things more
compact.
2021-03-22 20:08:16 +01:00
Zbigniew Jędrzejewski-Szmek
462f15d92d shared/calendarspec: constify parameter and simplify assignments to variable
The scope of start & stop is narrowed down, and they are assigned only once.
No functional change, but I think the code is easier to read this way.
Also add a comment to make the code easier to read.
2021-03-22 20:08:16 +01:00
Lennart Poettering
7e7b0e2198 update TODO 2021-03-22 19:07:34 +01:00
Lennart Poettering
1a71fe4ee5 resolved: don't accept responses to query unless they completely answer our questions
When we checking if the responses we collected for a DnsQuery are
sufficient to complete it we previously only check if one of the
collected response RRs matches at least one of the question RR keys.

This changes the logic to require that there must be at least one
response RR matched *each* of the question RR keys before considering
the answer complete.

Otherwise we might end up accepting an A reply as complete answer for an
A/AAAA query and vice versa, but we want to make sure we wait until we
get a reply on both types before returning this to the user in all
cases.

This has been broken for basically forever, but didn't surface until
b1eea703e01da1e280e179fb119449436a0c9b8e since until then we'd basically
ignore the auxiliary RRs included in CNAME/DNAME replies. Once that
commit was made we'd start using the auxiliary RRs included in
CNAME/DNAME replies but those typically included only A or only AAAA
which we then took for complete.

Fixe: #19049
2021-03-22 18:40:06 +01:00
Lennart Poettering
4cba52cc7a resolved: propagate correct error variable 2021-03-22 18:27:36 +01:00
Sergey Bugaev
fbdacd7268 homework: use FORK_CLOSE_ALL_FDS in a few more places
And make sure to reopen the log appropriately.
2021-03-22 19:34:07 +03:00
Sergey Bugaev
7e0ed2e9a2 tree-wide: reopen log after fork when needed
This follows up on 0b1f3c768ce1bd1490a5e53f539976dcef8ca765, adding more places
where we should reopen the log after forking with FORK_CLOSE_ALL_FDS.

When immediately calling exec in the child, prefer to explicitly reopen the log
after exec fails. In other cases, just use FORK_REOPEN_LOG.
2021-03-22 19:34:07 +03:00
Sergey Bugaev
0e557eef37 log: protect errno in log_open()
Commit 0b1f3c768ce1bd1490a5e53f539976dcef8ca765 has introduced log_open()
calls after exec fails post-fork. However, the log_open() call itself could
change the value of errno, which, for me, manifested in:

$ coredumpctl gdb
...
Failed to invoke gdb: Success

Fix this by using PROTECT_ERRNO in log_open().
2021-03-22 19:34:03 +03:00
Yu Watanabe
dcb6061e1c meson: fix warning about comparison between different types
Follow-up for e39288193fcdf3a36dbc49b78e6c9bf86a764e31.
2021-03-22 14:40:46 +01:00
Zbigniew Jędrzejewski-Szmek
169615c9a8 shared/calendarspec: abort calculation after 1000 iterations
We have a bug where we seem to enter an infinite loop when running in the
Europe/Dublin timezone. The timezone is "special" because it has negative SAVE
values. The handling of this should obviously be fixed, but let's use a
belt-and-suspenders approach, and gracefully fail if we fail to find an answer
within a specific number of attempts. The code in this function is rather
complex, and it's hard to rule out another bug in the future.
2021-03-22 13:44:57 +01:00
Antonio Terceiro
17e9000164 logs-show: add missing newline in warning message 2021-03-21 17:52:07 +00:00
Yu Watanabe
fcc3c20ca3 meson: fix build error of test-dnssec-complex
Fixes #19065.
2021-03-21 13:18:44 +01:00
tpgxyz
e39288193f systemd-boot: LLVM/lld does not support PE/COFF relocations. Bail out with an error message 2021-03-19 19:42:47 +00:00
Lennart Poettering
c68fc3514d blockdev-util: fix access to possibly invalidated dirent struct
Let's copy out the string we need from the dirent, there's no reason to
believe the dirent struct might live for longer than one loop iteration.
2021-03-19 18:13:17 +01:00
Lennart Poettering
f9b3afae96 repart: make sure to grow partition table after growing backing loopback file
This fixes the --size= switch, i.e. where we grow a disk image: after
growing it we need to expand the partition table so that its idea of the
the medium size matches the new reality. Otherwise our disk size
calculations in the subsequent steps might still use the original
ungrown size.

(This used to work, I guess this was borked when libfdisk learnt the
concept of "minimized" partition tables)
2021-03-19 18:11:26 +01:00
Michael Gisbers
6d18c13e79
correct incorrect command in NEWS (#19048)
* for /dev/vsock a file permission of 0o666 was mentioned but 0666 is probably better understood, so let's use that
* correct non existing command 'ip dev'
2021-03-19 11:38:53 +01:00
Sam Lunt
6f50c94dfd Wrong index in error message 2021-03-19 09:53:25 +00:00
Yu Watanabe
5cdb3f70eb udev: do not try to assign invalid ifname
Fixes #19038.
2021-03-19 09:52:21 +00:00
Lennart Poettering
7f966edbda homepage: fix year in footer to 2021
(And while we are at it, let's fix the "Sources" link in the footer to point to the right git repo subdir)
2021-03-18 23:31:55 +01:00
Luca Boccassi
dc4c1d4434
Merge pull request #19030 from dtardon/rhel9-covscan
a bunch of small fixes and clenups based on initial RHEL-9 covscan run
2021-03-18 16:28:46 +00:00
Luca Boccassi
12854a6ed5
Merge pull request #19036 from mrc0mmand/cocci-fixes
tree-wide: coccinelle fixes
2021-03-18 14:26:04 +00:00
David Tardon
eba1eb9066 resolved-dns-rr: drop unneeded braces 2021-03-18 13:19:13 +01:00
David Tardon
037e5b1547 resolved-dns-rr: use already existing variable 2021-03-18 13:19:13 +01:00
David Tardon
516a00e9cf resolved-dns-rr: avoid unnecessary reassignment 2021-03-18 13:19:00 +01:00
David Tardon
bc83340176 resolved-dns-rr: don't leak s if base64_append fails 2021-03-18 13:13:04 +01:00
Frantisek Sumsal
ca21d59a3f coccinelle: filter out a couple of 'false-positive' transformations
* flag-set.cocci: perform the transformation only if the second
    argument is a constant
  * sd-journal/lookup3.c: skip the cocci completely for this file, since
    it's not "ours"
  * strjoina.cocci: skip the transformation on the "test_strjoina" test,
    since it intentionally tests the "incorrect" expression we're trying to
    transform (the same thing was already done in strjoin.cocci)
2021-03-18 11:59:53 +01:00
Frantisek Sumsal
57ac6959f5 tree-wide: coccinelle fixes
Another batch of fixes (mostly) generated by Coccinelle.
2021-03-18 11:59:31 +01:00
Ulrich Ölmann
2c0c1b095c shutdown: fix typo 2021-03-18 09:43:08 +00:00
David Tardon
8f3e1b9d01 systemctl-edit: don't leak the old value of contents 2021-03-18 09:41:49 +01:00
David Tardon
c4a2d475f1 journal-upload: use _cleanup_ for curl_slist 2021-03-18 09:41:49 +01:00
David Tardon
3851069709 journal-upload: make the curl_slist cleanup actually work
If h is NULL, it is pointless to call curl_slist_free_all() on it...
2021-03-18 09:41:49 +01:00
David Tardon
a6f575a1e8 journal-upload: cleanup CURL* on error 2021-03-18 09:41:49 +01:00
David Tardon
c60d95ca4f journal-gatewayd: use automatic cleanup 2021-03-18 09:41:46 +01:00
Lennart Poettering
22bf8ff8e0
Merge pull request #19011 from anitazha/pgscanrate
oomd: update pressure based kills to use pgscan rate
2021-03-17 23:26:49 +01:00
Lennart Poettering
52b501c976
Merge pull request #19034 from poettering/read-virtual-file-fix
read_virtual_file() tweaks
2021-03-17 22:45:16 +01:00
Anita Zhang
77b04c0a6c oomd: clean up error handling
- Log debug if we're going to ignore an error
- Add %m if we use log_*_errno()
- log_oom() when checking ENOMEM
2021-03-17 13:07:11 -07:00
Lennart Poettering
b7beefbdde
Merge pull request #19031 from poettering/hwdb-248
prepare 248-rc4
2021-03-17 21:03:02 +01:00
Luca Boccassi
18da936481 resolved: simplify min_ttl check
rr is asserted upon a few lines above, no need to check for null.
Coverity-found issue, CID 1450844

  CID 1450844:  Null pointer dereferences  (REVERSE_INULL)
  Null-checking "rr" suggests that it may be null, but it has already
    been dereferenced on all paths leading to the check.
2021-03-17 18:56:33 +00:00
Lennart Poettering
c5384931b7 fileio: add missing overflow checks to read_full_virtual_file()
given the source is trusted this is probably not a biggie, but let's
better be safe than sorry.
2021-03-17 18:48:01 +01:00
Lennart Poettering
b235b03138 fileio: don't use realloc() in read_full_virtual_file()
We aren't interested in the data previousl read, hence free() followed
by malloc() is typically better since it means libc doesn't have to
restore the contained data needlessly.
2021-03-17 18:47:56 +01:00
Lennart Poettering
be81e45c74 systemctl: pecify read_full_file() size argument as NULL
If it is specified as NULL read_full_file() assumes the caller wants a C
string, and it looks for embedded NUL bytes to ensure that works. Given
we don#t actually use the size argument here, let's drop it.

(in one case the size argument is used, but not for actually processing
the full returned data, but just as a shortcut to compare things with
the original string. Let's drop use of that there, too given the risk of
embedded NUL bytes in the data read.)
2021-03-17 18:44:51 +01:00
Lennart Poettering
627055ce9a tree-wide: use read_full_virtual_file() where appropriate
Wherever we read virtual files we better should use
read_full_virtual_file(), to make sure we get a consistent response
given how weird the kernel's handling with partial read on such file
systems is.
2021-03-17 18:43:42 +01:00
Anita Zhang
bb08124092 oomctl: show last_pgscan 2021-03-17 10:17:05 -07:00
Anita Zhang
88e47952af oomd: sort by pgscan rate not pgscan
For pressure based killing we want to target who has the highest
increase in pgscan from the previous interval (vs. the previous logic
which used raw pgscan). This will prevent biasing towards long running
cgroups as mentioned in #19007.
2021-03-17 10:17:03 -07:00
Lennart Poettering
04820600e7 update TODO 2021-03-17 18:13:51 +01:00
Lennart Poettering
d94d261c56 update NEWS for rc4 2021-03-17 16:53:18 +01:00
Lennart Poettering
1ab4edae12 tools: exclude Weblate bot from "ninja git-contrib"
Bots are not people, no reason to say thanks to them and list them as
authors or contributors.
2021-03-17 16:53:14 +01:00
Lennart Poettering
264f1e5c3d mailmap: merge Weblate bot commiter into one 2021-03-17 16:53:10 +01:00
Lennart Poettering
cd10a4f5ec meson.build: bump version of libudev
It didn't receive new API calls, bit it was changed, hence bump the
version accordingly.
2021-03-17 16:53:01 +01:00
Lennart Poettering
4b7a051d92 hwdb: ninja update-hwdb 2021-03-17 16:52:57 +01:00
Lennart Poettering
6dca7954e3 hwdb: ninja update-hwdb-autosuspend 2021-03-17 16:52:33 +01:00
Luca Boccassi
acaf21e24d doc/RELEASE.md: document hwdb update step 2021-03-17 16:42:38 +01:00
igo95862
ca1eacd8e0 man: Specify that only d-bus methods can be answered async
Not properties.
2021-03-17 16:15:56 +01:00
Dan Sanders
5e23c2f42f hwdb: unifying receiver match keys for Logitech MX Ergo 2021-03-17 15:44:37 +01:00
Mike Gilbert
2156061fb3 cg_unified_cached: return ENOMEDIUM if we cannot find a known hierarchy
When the test suite is being run in a foreign environment,
/sys/fs/cgroup might not be set up in a way that we recognize.
Returning ENOMEDIUM causes the tests to be skipped in this case.

Bug: https://bugs.gentoo.org/771819
2021-03-17 15:42:22 +01:00
Anita Zhang
91cbb4bdd6 oomd: update memory pressure candidates every interval 2021-03-16 23:54:14 -07:00
Anita Zhang
b037a6da31 oomd: new helper oomd_update_cgroup_contexts_between_hashmaps 2021-03-16 18:10:57 -07:00
Yu Watanabe
fa92d38428 dhcp6: fix wrong length for IA_PD dhcp6 option
Fixes an issue introduced by 73b49d433c2c8e6304c8b82538bd4231d070fce4.

When PrefixDelegationHint= is not set, dhcp6_option_append_pd() sets
wrong length for IA_PD option, as `r` is `-EINVAL`.

Fixes #19021.
2021-03-16 21:29:49 +01:00
Lennart Poettering
69bedd07c3
Merge pull request #19009 from poettering/one-more-cname-fix
resolved: more CNAME redirect fixes
2021-03-16 21:29:06 +01:00
Lennart Poettering
1a2c2e1222
Merge pull request #19022 from poettering/journal-dont-lose-facility
journald: don't lose facility of log streams on journald restart
2021-03-16 21:28:21 +01:00
Lennart Poettering
d977ef2542 journald: restore syslog priority *with* facility bits for stream connections when restarting journald
Fixes: #19019
2021-03-16 16:09:47 +01:00
Lennart Poettering
d267ac6e64 journald: use log_warning_errno() where appropriate 2021-03-16 16:07:42 +01:00
Lennart Poettering
e6ba912a1a update TODO 2021-03-16 14:58:00 +01:00
Lennart Poettering
df27f1dbca doc: mention that choosing root/usr partitions by strverscmp() on the partition label is OK 2021-03-16 14:57:56 +01:00
Lennart Poettering
1474d7ac2d dissect: show partition label in table
We nowadays pick up the partition label while dissecting, let's show it
if we have it.
2021-03-16 14:57:53 +01:00
Lennart Poettering
166ff7316e dissect: don't insist on a root/usr partition when just inspecting
Let's relax rules here a bit, taking benefit of the fact that
DISSECT_IMAGE_REQUIRE_ROOT + DISSECT_IMAGE_GENERIC_ROOT are now separate
flags.
2021-03-16 14:57:49 +01:00
Lennart Poettering
9cb1709b72 execute: drop DissectImageFlags parameter from namespace_setup()
The function already has a ridiculous amount of paramaters, let's drop
one that is either not used at all or has a constant value and let's
pick it internally.
2021-03-16 14:57:45 +01:00
Lennart Poettering
4b5de5dd6c dissect-image: split DISSECT_IMAGE_REQUIRE_ROOT in two
Previously, the flag did two things at once: enable support for using
generic partitions as root fs if there were only one/allow use of
partition-table-less images as root fs. And secondly, insist that there
was a rootfs, and fail if not. Let's split these two in two separate
options so that they can be used independently of each other.

There are cases where one wants to use one without the other (i.e. when
inspecting things with systemd-dissect tool it should be OK to do so
even if image has no root fs), and it's cleaner anyway.
2021-03-16 14:57:40 +01:00
Lennart Poettering
2679f40735 dissect-image: extend comment on returned errors a bit 2021-03-16 14:57:36 +01:00
Lennart Poettering
08fe0a5386 dissect-image: do an strverscmp() on the partition label of root/usr if multiple exist
Let's add a very simple mechanism for doing A/B updating of disk images:
for root + /usr and their verity partitions let's ue strverscmp() on the
label to determine which one to use when dissecting a disk image. That
way, if the root partition label contains a string such as "foo-0.15"
and another one "foo-0.16", the latter wins.

For other partition types let's stick to the logic of "first partition
found" win, as before. Versioning makes sense for partitions that
typically and primarily may carry software packages, but the other
partition types usuall don't.
2021-03-16 14:57:31 +01:00
Lennart Poettering
d04faa4e19 tree-wide: make use of DISSECT_IMAGE_USR_NO_ROOT in various tools
Let's make use of the new dissection in all tools where this makes
sense, which are all tools that dissect images, except for those which
inherently operate on state/configuraiton and thus where an image
without state nor configuration is useless (e.g.
systemd-tmpfiles/systemd-firstboot/… --image= switch).
2021-03-16 14:57:27 +01:00
Lennart Poettering
7cf660302f dissect-image: support images without rootfs but with /usr/
Let's add support for images that include an /usr/ file system but no
root fs. Mount a tmpfs as root for images like this, all controlled by a
new flag DISSECT_IMAGE_USR_NO_ROOT.

This is useful for entirely stateless images, that come up pristine on
every single boot.
2021-03-16 14:56:48 +01:00
Yu Watanabe
efd3be9de1 sd-event: re-check new epoll events when a child event is queued
Previously, when a process outputs something and exit just after
epoll_wait() but before process_child(), then the IO event is ignored
even if the IO event has higher priority. See #18190.

This can be solved by checking epoll event again after process_child().

However, there exists a possibility that another process outputs and
exits just after process_child() but before the second epoll_wait().
When the IO event has lower priority than the child event, still IO
event is processed.

So, this makes new epoll events and child events are checked in a loop
until no new event is detected. To prevent an infinite loop, the number
of maximum trial is set to 10.

Fixes #18190.
2021-03-16 13:35:20 +01:00
Franck Bui
e62636741c meson.build: make xinitrcdir configurable
SUSE uses a different xinitrcdir ("/usr/etc/X11/xinit/xinitrc.d").
2021-03-16 13:27:09 +01:00
simmon
4dbcd443d4 po: Translated using Weblate (Korean)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-03-16 16:14:30 +09:00
Lennart Poettering
b1eea703e0 resolved: don't flush answer RRs on CNAME redirect too early
When doing a CNAME/DNAME redirect let's first check if the answer we
already have fully answers the redirected question already. If so, let's
use that. If not, let's properly restart things.

This simply removes one call to dns_answer_reset() that was placed too
early: instead of resetting when we detect a CNAME/DNAME redirect, do so
only after checking if the answer we already have doesn't match the
reply, and then decide to *actually* follow it. Or in other words: rely
on the dns_answer_reset() call in dns_query_go() which we'll call to
actually begin with the redirected question.

This fixes an optimization path which was broken back in 7820b320eaa608748f66f8105621640cf80e483a.

(This doesn't really matter as much as one might think, since our cache
stepped in anyway and answered the questions before going back to the
network. However, this adds noise if RRs with very short TTLs are cached
– which some CDNs do – and is of course relavant when people turn off
the local cache.)
2021-03-15 23:55:07 +01:00
Lennart Poettering
a7c0291c10 resolved: match CNAME replies to right question
Previously by mistake we'd always match every single reply we get in a
CNAME chain to the original question from the stub client. That's
broken, we need to test it against the CNAME query we are currently
looking at.

The effect of this incorrect matching was that we'd assign the RRs to
the wrong section since we'd assume they'd be auxiliary answers instead
of primary answers.

Fixes: #18972
2021-03-15 23:54:53 +01:00
Lennart Poettering
1414b67e0d resolved: add helper for dumping DnsQuestion, similar to what we have for DnsAnswer 2021-03-15 23:41:25 +01:00
Lennart Poettering
567aa5c87b resolved: show TTLs in answer dump 2021-03-15 23:41:25 +01:00
Lennart Poettering
c4d98c3acc resolved: use DNS_ANSWER_MASK_SECTIONS where appropriate 2021-03-15 23:41:25 +01:00
Lennart Poettering
a1acc6e332 resolved: let's tweak how we calculate TTL left
When responding from DNS cache, let's slightly tweak how the TTL is
lowered: as before let's round down when converting from our internal µs
to the external seconds. (This is preferable, since records should
better be cached too short instead of too long.) Let's avoid rounding
down to zero though, since that has special semantics in many cases (in
particular mDNS). Let's just use 1s in that case.
2021-03-15 23:41:25 +01:00
Lennart Poettering
b974211acb resolved: take shortest TTL of all of RRs in answer as cache lifetime
We nowadays cache full answer RRset combinations instead of just the
exact matching rrset. This means we should not cache RRs that are not
immediate answers to our question for longer then their own RRs. Or in
other words: let's determine the shortest TTL of all RRs in the whole
answer, and use that as cache lifetime.
2021-03-15 22:57:40 +01:00
Lennart Poettering
f6d80c361d resolved: drop unnecessary local variable 2021-03-15 21:21:43 +01:00
Lennart Poettering
b12058e8f9 resolved: fix indentation 2021-03-15 21:21:42 +01:00
Lennart Poettering
77db3caee3 resolved: use dns_answer_isempty() where appropriate 2021-03-15 21:21:42 +01:00
Lennart Poettering
3b7006cb44 resolved: rebreak a few comments 2021-03-15 21:21:42 +01:00
Lennart Poettering
1499a0a99a resolved: add new helper dns_answer_min_ttl() 2021-03-15 21:21:37 +01:00
Luca Boccassi
301e7cd047 man: specify that ProtectProc= does not work with root/cap_sys_ptrace
When using hidepid=invisible on procfs, the kernel will check if the
gid of the process trying to access /proc is the same as the gid of
the process that mounted the /proc instance, or if it has the ptrace
capability:

https://github.com/torvalds/linux/blob/v5.10/fs/proc/base.c#L723
https://github.com/torvalds/linux/blob/v5.10/fs/proc/root.c#L155

Given we set up the /proc instance as root for system services,
The same restriction applies to CAP_SYS_PTRACE, if a process runs with
it then hidepid=invisible has no effect.

ProtectProc effectively can only be used with User= or DynamicUser=yes,
without CAP_SYS_PTRACE.
Update the documentation to explicitly state these limitations.

Fixes #18997
2021-03-15 16:53:16 +00:00
Yu Watanabe
b63dae3168 man: DNS/NTP servers received from DHCP server are concatenated with the statically configured ones
Prompted by #9473.
2021-03-15 14:48:47 +00:00
Luca Boccassi
65d325edb8
Merge pull request #18984 from poettering/event-test-timeout
sd-event: add test for timeout parameter of sd_event_wait()
2021-03-15 14:31:48 +00:00
Yu Watanabe
6e4571f0c2 network: use string_hash_ops_free 2021-03-14 00:39:10 +09:00
Yu Watanabe
cf45350745 ordered-set: make ordered_set_put_strdup() allocate OrderedSet object
For consistency with set_put_strdup().
2021-03-14 00:39:05 +09:00
Yu Watanabe
f225a338c3 network: also introduce UseDomains= for [DHCPv6] section
When we split [DHCP] section into [DHCPv4] and [DHCPv6], UseDomains=
setting was forgot to be introduced in [DHCPv6] section.
2021-03-14 00:28:19 +09:00
Yu Watanabe
5b7f0aaf69 network: use userdata instead data in conf parsers
These takes no offset, so should not change any behavior.
2021-03-14 00:24:48 +09:00
Daan De Meyer
95ba433a5f boot: Move console declarations to missing_efi.h
These were added to eficonex.h in gnu-efi 3.0.13. Let's move them
to missing_efi.h behind an appropriate guard to fix the build with
recent versions of gnu-efi.
2021-03-13 13:13:54 +00:00
Yu Watanabe
925bd4c24e fstab-util: fix typo in comment 2021-03-13 12:26:10 +01:00
Kevin Backhouse
37ca78a35c ask-password-api: fix error handling on invalid unicode character
The integer overflow happens when utf8_encoded_valid_unichar() returns an error
code. The error code is a negative number: -22. This overflows when it is
assigned to `z` (type `size_t`). This can cause an infinite loop if the value
of `q` is 22 or larger.

To reproduce the bug, you need to run `systemd-ask-password` and enter an
invalid unicode character, followed by a backspace character.

GHSL-2021-052
2021-03-12 18:25:58 +01:00
Lennart Poettering
7cb45dbfa3 sd-event: fix error handling
Noticed by @keszybz, see #18973
2021-03-12 17:56:56 +01:00
Lennart Poettering
c14e57ba6b sd-event: add a simple test for checking the timeout parameter of sd_event_wait()
Related to: #18973
2021-03-12 17:56:33 +01:00
Luca Boccassi
495787b56c
Merge pull request #18978 from keszybz/man-rc.local
Suggest network-online.target for rc.local
2021-03-12 14:54:12 +00:00
Zbigniew Jędrzejewski-Szmek
3f9721fef0 Rename test-nss to test-nss-hosts 2021-03-12 14:37:36 +01:00
Yu Watanabe
c99c197d07
Merge pull request #18979 from keszybz/man-page-links
Man page links
2021-03-12 19:45:17 +09:00
Zbigniew Jędrzejewski-Szmek
eb0845dfb8 man: mention network-online.target in discussion of rc.local
Replacement for #18853.
2021-03-12 11:22:58 +01:00
Zbigniew Jędrzejewski-Szmek
ba3dc45126 man: fix html links to two external man pages 2021-03-12 10:58:16 +01:00
Zbigniew Jędrzejewski-Szmek
21bee820ab man: sd_bus_message_reply()→sd_bus_message_send()
Fixup for 6c41cf445912c12e14b1e94414a0fce1fa060ac2.
2021-03-12 10:58:16 +01:00
Zbigniew Jędrzejewski-Szmek
45b218b058 man: also refname rc-local.service to the generator man page
This makes it easier to find for users.
2021-03-12 09:04:59 +01:00
ulf-f
2d8ce4c701 Update resolvectl.xml
fixed typo of filename
2021-03-11 19:24:53 +01:00
Frantisek Sumsal
cb72605436 Revert "sd-event: re-check new epoll events when a child event is queued"
This reverts commit 84e998c112ff18bba786660bd6c1f96f62a77ffe.

Temporarily revert this commit, since it breaks CI.
2021-03-11 18:57:43 +01:00
Lennart Poettering
d55d61823f
Merge pull request #18922 from yuwata/sd-event-fix-issue-18190
sd-event: re-check new epoll events when a child event is queued
2021-03-11 16:36:38 +01:00
Yu Watanabe
84e998c112 sd-event: re-check new epoll events when a child event is queued
Previously, when a process outputs something and exit just after
epoll_wait() but before process_child(), then the IO event is ignored
even if the IO event has higher priority. See #18190.

This can be solved by checking epoll event again after process_child().

However, there exists a possibility that another process outputs and
exits just after process_child() but before the second epoll_wait().
When the IO event has lower priority than the child event, still IO
event is processed.

So, this makes new epoll events and child events are checked in a loop
until no new event is detected. To prevent an infinite loop, the number
of maximum trial is set to 10.

Fixes #18190.
2021-03-11 23:09:04 +09:00
Yu Watanabe
7fe11e84c2 test: add log messages 2021-03-11 23:09:04 +09:00
Zbigniew Jędrzejewski-Szmek
e3c82b1b1a NEWS: update contributors list for v248-rc3 2021-03-11 15:07:26 +01:00
Zbigniew Jędrzejewski-Szmek
47d1cae6cf
Merge pull request #18915 from keszybz/reexec-bug
Fix crash during daemon-reexec with systemd-oomd running
2021-03-11 14:46:16 +01:00
Zbigniew Jędrzejewski-Szmek
eb406c4e19
Merge pull request #18955 from keszybz/fstab-escaping
Fix handling of escaped characters in fstab
2021-03-11 14:45:11 +01:00
Zbigniew Jędrzejewski-Szmek
e4645ca599 basic/group-util: optimize alloca use
Follow-up for 0fa7b50053.
2021-03-11 14:43:16 +01:00
Zbigniew Jędrzejewski-Szmek
bcef0f33cc docs: more markup 2021-03-11 14:43:16 +01:00
Frantisek Sumsal
3a1bc3fcc0 repart: fix the loop dev support check
Since f17bdf8264e231fa31c769bff2475ef698487d0b the test-repart was
effectively disabled, since `/dev/loop-control` is a character special
file, whereas `-f` works only on regular files. Even though we could use
`-c` to check specifically for character special files, let's use `-e`
just in case.
2021-03-11 14:42:33 +01:00
Zbigniew Jędrzejewski-Szmek
ceffd6a961
Merge pull request #18962 from poettering/dissect-fixes
three image dissection fixes
2021-03-11 14:42:17 +01:00
Michal Sekletar
43b4e3058c install: refactor find_symlinks() and don't search for symlinks recursively
After all we are only interested in symlinks either in top-level config
directory or in .wants and .requires sub-directories.

As a bonus this should speed up ListUnitFiles() roughly 3-4x on systems
with a lot of units that use drop-ins (e.g. SSH jump hosts with a lot of
user session scopes).
2021-03-11 13:12:37 +01:00
Lennart Poettering
170c659338 man: shorten list of partition types a bit
Tables with only one column aren't really tables, they are lists. And if
each cell only consists of a single word, they are probably better
written in a single line. Hence, shorten the man page a bit, and list
boot loader spec partition types in a simple sentence.

Also, drop "root-secondary" from the list. When dissecting images we'll
upgrade "root-secondary" to "root" if we mount it, and do so only if
"root" doesn't exist. Hence never mention "root-secondary" as we never
will mount a partition under that id.
2021-03-11 12:04:13 +01:00
Lennart Poettering
38db55ab0c dissect: fix trivial typo 2021-03-11 11:49:19 +01:00
Lennart Poettering
334eb5b099 dissect-image: fix volatile images
This makes sure nspawn's --volatile=yes switch works again: there we
have a read-only image that is overmounted by a tmpfs (with the
exception of /usr). This we need to mkdir all mount points even though
the image is read-only.

Hence, let's drop the optimizatio of avoiding mkdir() on images that are
read-only, it's wrong and misleading here, since the image itself might
be read-only but our mounts are not.
2021-03-11 11:48:31 +01:00
Lennart Poettering
9842905ede dissect-image: clean up meaning of DISSECT_IMAGE_MKDIR
Previously handling of DISSECT_IMAGE_MKDIR was pretty weird and broken:
it would control both if we create the top-level mount point when
mounting an image, and the inner mount points for images that consist of
multiple file systems. However, the latter is redundant, since
1f0f82f1311e4c52152b8e2b6f266258709c137d does this too, a few lines
further up – unconditionally!

Hence, let's make the meaning of DISSECT_IMAGE_MKDIR more strict: it
shall be only about the top-level mount point, not about the inner ones
(where we'll continue to create what is missing alwayway). Having a
separate flag for the top-level mount point is relevant, since the mount
point dir created by it will remain on the host fs – unlike the
directories we create inside the image, which will stay within the
image.

This slightly change of meaning is actually inline with what the flag is
actually used for and documented in systemd-dissect.
2021-03-11 11:48:31 +01:00
Zbigniew Jędrzejewski-Szmek
d6cef552dc fstab-generator: get rid of fstab_extract_values()
This was a parallel implementation of option parsing that didn't
support escaping of separators. Let's port this over to the common code.

Fixes #18952.
2021-03-11 11:25:15 +01:00
Zbigniew Jędrzejewski-Szmek
ff0c31bc27 shared/fstab-util: teach fstab_filter_options() a mode where all values are returned
Apart from tests, the new argument isn't used anywhere, so there should be no
functional change. Note that the two arms of the big conditional are switched, so the
diff is artificially inflated. The actual code change is rather small. I dropped the
path which extracts ret_value manually, because it wasn't supporting unescaping of the
escape character properly.
2021-03-11 11:25:15 +01:00
Zbigniew Jędrzejewski-Szmek
0264b404b9 shared/fstab-util: pass through the escape character
… when not used to escape the separator (,) or the escape character (\).
This mostly restores behaviour from before 0645b83a40d1c782f173c4d8440ab2fc82a75006,
but still allows "," to be escaped.

Partially fixes #18952.
2021-03-11 11:25:06 +01:00
Zbigniew Jędrzejewski-Szmek
3141089f53 basic/extract-word: rename flag
The flag enables "relaxed mode" for all kinds of unescaping, not just c-unescaping.
2021-03-11 09:21:07 +01:00
Zbigniew Jędrzejewski-Szmek
76c4e48ee6 basic/extract-word: allow escape character to be escaped
With EXTRACT_UNESCAPE_SEPARATORS, backslash is used to escape the separator.
But it wasn't possible to insert the backslash itself. Let's allow this and
add test.
2021-03-11 09:21:07 +01:00
Zbigniew Jędrzejewski-Szmek
8723c716c7 basic/extract_word: try to explain what the various options do
A test for stripping of escaped backslashes without any flags was explicitly
added back in 4034a06ddb82ec9868cd52496fef2f5faa25575f. So it seems to be on
purpose, though I would say that this is at least surprising and hence deserves
a comment.

In test-extract-word, add tests for standalone EXTRACT_UNESCAPE_SEPARATORS.
Only behaviour combined with EXTRACT_CUNESCAPE was tested.
2021-03-11 09:21:04 +01:00
Zbigniew Jędrzejewski-Szmek
5fa2da1251 shared/fstab-util: immediately drop empty options again
In the conversion from strv_split() to strv_split_full() done in
7bb553bb98a57b4e03804f8192bdc5a534325582, EXTRACT_DONT_COALESCE_SEPARATORS was
added. I think this was just by mistake… We never look for "empty options", so
whether we immediately ignore the extra separator or store the empty string in
strv, should make no difference.
2021-03-11 09:19:54 +01:00
Zbigniew Jędrzejewski-Szmek
924f650305 generators: warn but ignore failure to write timeouts
When we failed to split the options (because of disallowed quoting syntax, which
might be a bug in its own), we would silently fail. Instead, let's emit a warning.
Since we ignore the value if we cannot parse it anyway, let's ignore this error
too.
2021-03-11 09:19:00 +01:00
Lennart Poettering
48f813c4aa coredumpctl: fflush() stdout before invoking gdb
Fixes: #18936
2021-03-11 08:55:20 +01:00
Zbigniew Jędrzejewski-Szmek
c9c4899f44 udev: add default group for sgx enclave access
Closes #18669.

This creates a "well known" for sgx_enclave ownership. By doing this here we
avoid the risk that various projects making use of the device will provide
similar-but-slightly-incompatible installation instructions, in particular
using different group names.

ACLs are actually a better approach to grant access to users, but not in all
cases, so we want to provide a standard group anyway.

Mode is 0o660, not 0o666 because this is very new code and distributions are
likely to not want to give full access to all users. This might change in the
future, but being conservative is a good default in the beginning.

Rules for /dev/sgx_provision will be provided by libsg-ae-pce:
https://github.com/intel/linux-sgx/issues/678.
2021-03-10 23:05:48 +01:00
Lennart Poettering
0361cee428 update TODO 2021-03-10 22:38:28 +01:00
Frantisek Sumsal
a174da59c2 coredump: omit coredump info when -q is used with the debug verb
Skip printing the coredump info table when using the `debug` verb in
combination with the `-q/--quiet` option. Useful when trying to gather
coredump info non-interactively via scripted gdb commands.

Fixes: systemd/systemd#18935
2021-03-10 17:35:21 +01:00
Zbigniew Jędrzejewski-Szmek
1677b88d01 fstab-generator: do not propagate error if we fail to canonicalize
r is used for the return value of the function, so we shouldn't
use it a non-fatal check.
2021-03-10 16:54:18 +01:00
Frantisek Sumsal
5acfe54e98 test: fix permissions of the ASan udev workaround
otherwise udev complains about the file being world-writable:
systemd-udevd[228]: Configuration file /etc/udev/rules.d/00-set-LD_PRELOAD.rules is marked world-writable. Please remove world writability permission bits. Proceeding anyway.

Fixes: systemd/systemd-centos-ci#354
2021-03-11 00:28:13 +09:00
Zbigniew Jędrzejewski-Szmek
451ba55fec Revert "udev: do not execute hwdb builtin import twice or thrice"
This reverts commit 876c75fe870846b09b54423a6b719d80bc879b27.

The patch seems to cause usb devices to get some attributes set from the parent
PCI device. 'hwdb' builtin has support for breaking iteration upwards on usb
devices. But when '--subsystem=foo' is specified, iteration is continued. I'm
sure it *could* be figured out, but it seems hard to get all the combinations
correct. So let's revert to functional status quo ante, even if does the lookup
more than once unnecessarily.

Fixes #18125.
2021-03-10 15:26:45 +01:00
Frantisek Sumsal
4b252eaa31 test: disable nss-systemd for TEST-22 under ASan
When running TEST-22 under ASan, there's a chain of events which causes
`stat` to output an extraneous ASan error message, causing following
fail:

```
+ test -d /tmp/d/1
++ stat -c %U:%G:%a /tmp/d/1
==82==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
+ test = daemon:daemon:755
.//usr/lib/systemd/tests/testdata/units/testsuite-22.02.sh: line 24: test: =: unary operator expected
```

This is caused by `stat` calling nss which in Arch's configuration calls
the nss-systemd module, that pulls in libasan which causes the $LD_PRELOAD
error message, since `stat` is an uninstrumented binary.

The $LD_PRELOAD variable is explicitly unset for all testsuite-* services
since it causes various issues when calling uninstrumented libraries, so
setting it globally is not an option. Another option would be to set
$LD_PRELOAD for each `stat` call, but that would unnecessarily clutter
the test code.
2021-03-10 11:59:43 +01:00
Zbigniew Jędrzejewski-Szmek
749c4c8ed1
Merge pull request #18553 from Werkov/cgroup-user-instance-controllers
Make (user) instance aware of delegated cgroup controllers
2021-03-10 09:41:40 +01:00
Zbigniew Jędrzejewski-Szmek
ffea01856f
Merge pull request #18942 from keszybz/sd-netlink-prettification
sd-nelink prettification
2021-03-10 09:18:06 +01:00
Lennart Poettering
e5f8ce13bb socket-util: refuse ifnames with embedded '%' as invalid
So Linux has this (insane — in my opinion) "feature" that if you name a
network interface "foo%d" then it will automatically look for the
interface starting with "foo…" with the lowest number that is not used
yet and allocates that.

We should never clash with this "magic" handling of ifnames, hence
refuse this, since otherwise we never know what the name is we end up
with.

We should probably switch things from a deny list to an allow list
sooner or later and be much stricter. Since the kernel directly enforces
only very few rules on the names, we'd need to do some research what is
safe and what is not first, though.
2021-03-10 11:11:52 +09:00
Lennart Poettering
bef1e1a066 update TODO 2021-03-09 23:20:53 +01:00
Zbigniew Jędrzejewski-Szmek
c7209bcfe1 sd-netlink: shorten things a bit 2021-03-09 17:26:24 +01:00
Zbigniew Jędrzejewski-Szmek
4fa024683c sd-netlink: use setsockopt_int() also for NETLINK_ADD/DROP_MEMBERSHIP
We use 'unsigned' as the type, but netlink(7) says the type is 'int'.
It doesn't really matter, since they are both the same size. Let's use
our helper to shorten the code a bit.
2021-03-09 17:26:24 +01:00
Zbigniew Jędrzejewski-Szmek
64a65bab59 sd-netlink: use structured initialization
The casts look somewhat ugly and type-unsafe, but they are equivalent
to what was there before (we initialized a variable from a void*).
2021-03-09 17:26:24 +01:00
Lennart Poettering
9813d8354c fs-util: port symlink_idempotent() to path_extract_directory() 2021-03-09 14:37:23 +00:00
Zbigniew Jędrzejewski-Szmek
9ca6d78061 logind: add …WithFlags methods to policy
Without this, privilege escalation through polkit does not work, because all
methods fail with permission errors.

Forgotten in 8885fed4e3a52cf1bf105e42043203c485ed9d92.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1933335.
2021-03-09 14:37:08 +00:00
simmon
e2dba58930 po: Translated using Weblate (Korean)
Currently translated at 87.3% (165 of 189 strings)

Co-authored-by: simmon <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main
2021-03-09 14:14:33 +01:00
Zbigniew Jędrzejewski-Szmek
a19c1a4baa oomd: "downgrade" level of message
PID1 already logs about the service being started, so this line isn't necessary
in normal use. Also, by the time it is emitted, the service has already
signalled readiness, so let's not say "starting" but "started".
2021-03-09 14:05:49 +01:00
Zbigniew Jędrzejewski-Szmek
39ad3f1c09 varlink: avoid using dangling ref in varlink_close_unref()
Fixes #18025, https://bugzilla.redhat.com/show_bug.cgi?id=1931034.

We drop the reference stored in Manager.managed_oom_varlink_request in two code paths:
vl_disconnect() which is installed as a disconnect callback, and in manager_varlink_done().
But we also make a disconnect from manager_varlink_done(). So we end up with the following
call stack:

(gdb) bt
 0  vl_disconnect (s=0x112c7b0, link=0xea0070, userdata=0xe9bcc0) at ../src/core/core-varlink.c:414
 1  0x00007f1366e9d5ac in varlink_detach_server (v=0xea0070) at ../src/shared/varlink.c:1210
 2  0x00007f1366e9d664 in varlink_close (v=0xea0070) at ../src/shared/varlink.c:1228
 3  0x00007f1366e9d6b5 in varlink_close_unref (v=0xea0070) at ../src/shared/varlink.c:1240
 4  0x0000000000524629 in manager_varlink_done (m=0xe9bcc0) at ../src/core/core-varlink.c:479
 5  0x000000000048ef7b in manager_free (m=0xe9bcc0) at ../src/core/manager.c:1357
 6  0x000000000042602c in main (argc=5, argv=0x7fff439c43d8) at ../src/core/main.c:2909

When we enter vl_disconnect(), m->managed_oom_varlink_request.n_ref==1.
When we exit from vl_discconect(), m->managed_oom_varlink_request==NULL. But
varlink_close_unref() has a copy of the pointer in *v. When we continue executing
varlink_close_unref(), this pointer is dangling, and the call to varlink_unref()
is done with an invalid pointer.
2021-03-09 14:05:49 +01:00
Zbigniew Jędrzejewski-Szmek
8b0f54c929 pid1: return varlink error on the right connection 2021-03-09 13:49:02 +01:00
Luca Boccassi
1d2e9c48e5
Merge pull request #18930 from anitazha/oomdfixleak
oomd: fix memory leak
2021-03-09 11:37:10 +00:00
Anita Zhang
50c0578b61 oomd: wrap paths in oomd_insert_cgroup_context with empty_to_root 2021-03-09 09:23:22 +01:00
Yu Watanabe
2eaed57bd4
Merge pull request #18932 from poettering/filename-max
Drop use of FILENAME_MAX
2021-03-09 14:15:49 +09:00
Zbigniew Jędrzejewski-Szmek
03a81441b1 timedated: fix skipping of comments in config file
Reading file '/usr/lib/systemd/ntp-units.d/80-systemd-timesync.list'
Failed to add NTP service "# This file is part of systemd.", ignoring: Invalid argument
Failed to add NTP service "# See systemd-timedated.service(8) for more information.", ignoring: Invalid argument

:(
2021-03-09 14:04:21 +09:00
Luca Boccassi
a2aa51b740
Merge pull request #18927 from poettering/dissect-alloca-fix
dissect-image: don't mix two forms of stack allocation in one line
2021-03-08 22:42:55 +00:00
Anita Zhang
45da27fa05 oomd: move TAKE_PTR to end of oomd_insert_cgroup_context()
Fixes #18926
2021-03-08 14:37:15 -08:00
Anita Zhang
399d80ba8c oomd: add unit test to repro #18926 2021-03-08 14:36:24 -08:00
Lennart Poettering
698660620d test: output FILENAME_MAX vs. PATH_MAX sizes
Also, make sure our assumption that FILENAME_MAX == PATH_MAX holds.
2021-03-08 22:52:04 +01:00
Lennart Poettering
445714569d mountpoint-util: replace our last use of FILENAME_MAX by PATH_MAX 2021-03-08 22:47:55 +01:00
Lennart Poettering
db22003233 fs-util: replace use of FILENAME_MAX by PATH_MAX in readlinkat_malloc()
While we are at it, let's also add an overflow check and do other
modernizations.
2021-03-08 22:47:51 +01:00
Lennart Poettering
932401fd61 docs: reference NAME_MAX where we talk about filenames 2021-03-08 22:47:48 +01:00
Lennart Poettering
b775b1828d docs: document not to use FILENAME_MAX in our codebase
It's a weird thing. Let's explain why.
2021-03-08 22:47:44 +01:00
Lennart Poettering
f470d234d3 efi-loader: make efi_loader_entry_name_valid() check a bit stricter
Previously we'd just check if the ID was no-empty an no longer than
FILENAME_MAX. The latter was probably a mistake, given the comment next
to it. Instead of fixing that to check for NAME_MAX let's instead  just
switch over to filename_is_valid() which odes a similar check, plus a
some minor additional checks. After all we do want that valid EFI boot
menu entry ids are usable as filenames.
2021-03-08 22:47:41 +01:00
Lennart Poettering
8ca94009f8 basic: tighten two filename length checks
This fixes two checks where we compare string sizes when validating with
FILENAME_MAX. In both cases the check apparently wants to check if the
name fits in a filename, but that's not actually what FILENAME_MAX can
be used for, as it — in contrast to what the name suggests — actually
encodes the maximum length of a path.

In both cases the stricter change doesn't actually change much, but the
use of FILENAME_MAX is still misleading and typically wrong.
2021-03-08 22:47:14 +01:00
Lennart Poettering
c27cb5113f format-table: simplify table_set_display_all() and keep it private 2021-03-08 21:33:35 +00:00
Luca Boccassi
ae43f2341c
Merge pull request #18918 from yuwata/man-no-new-priv-18914
man: update documents about NoNewPrivileges=
2021-03-08 20:57:32 +00:00
Lennart Poettering
794a579f29 dissect-image: don#t mix two forms of stack allocation in one expression
It's not necessarily safe to do this, hence don't.
2021-03-08 17:31:47 +01:00
Lennart Poettering
7533a33b0c dissect-image: remove unnecessary parens 2021-03-08 17:31:35 +01:00
Lennart Poettering
79d5f00ad1
Merge pull request #18925 from keszybz/hwdb-news-syscalls-update
Update of hwdb & news & syscalls for v248
2021-03-08 17:01:40 +01:00
Lennart Poettering
b9dec21409
Merge pull request #18921 from yuwata/seccomp-syscallfilter-18916
seccomp: fix issue in system call filter with errno
2021-03-08 17:01:23 +01:00
Lennart Poettering
00248fc4f7
Merge pull request #18924 from keszybz/homed-inotify-crash
Homed inotify crash
2021-03-08 15:12:30 +01:00
Frantisek Sumsal
c335b7c3f8 test: fix the last subtest of TEST-50-DISSECT under sanitizers
Follow-up to 9f6235e1b4490ce7abbd125ed975343de6bcb9cd.
2021-03-08 14:38:49 +01:00
Zbigniew Jędrzejewski-Szmek
a3fbf67180 hwdb: update for v248
Seems to be additions and corrections as usual.
Includes an update of the chromiumos autosuspend rules.
2021-03-08 14:27:48 +01:00
Zbigniew Jędrzejewski-Szmek
33e68cce51 NEWS: add items since -rc2 2021-03-08 14:27:48 +01:00
Yu Watanabe
0538d2a811 core/execute: sort conditions to make them match documentation 2021-03-08 21:42:06 +09:00
Yu Watanabe
266d0bb9e0 man: update document about NoNewPrivileges=
Fixes #18914.
2021-03-08 21:42:06 +09:00
Yu Watanabe
a62f651b32 test: add one more test for system call filter with errno 2021-03-08 21:28:42 +09:00
Yu Watanabe
68acc1afbe seccomp: do not ignore deny-listed syscalls with errno when list is allow-list
Previously, if the hashmap is allow-list and a new deny-listed syscall
is added, seccomp_parse_syscall_filter() simply drop the new syscall
from hashmap even if error number is specified.

This makes 'allow-list' hashmap store two types of entries:
- allow-listed syscalls, which are stored with negative value (-1).
- deny-listed syscalls, which are stored with specified errno.

Fixes #18916.
2021-03-08 21:28:42 +09:00
Yu Watanabe
9e29ee4072 seccomp: use FLAGS_SET() macro 2021-03-08 21:28:42 +09:00
Yu Watanabe
084a46d7c5 core,seccomp: refuse to specify errno for allow-listed syscalls 2021-03-08 21:28:38 +09:00
Yu Watanabe
696a13bab7 core: drop meaningless parse_syscall_and_errno() calls
parse_syscall_and_errno() does not check the validity of syscall name or
syscall group name, but it just split into syscall name and errno.
So, it is not necessary to call it for SystemCallLog=.
2021-03-08 21:26:13 +09:00
Yu Watanabe
1862b310c5 seccomp: fix comment and change variable name 2021-03-08 21:25:54 +09:00
Yu Watanabe
335171ca84 test: parse_syscall_and_errno() accepts zero errno 2021-03-08 21:22:24 +09:00
Yu Watanabe
17884f979a test: move test_parse_syscall_and_errno() to test-seccomp.c 2021-03-08 21:22:24 +09:00
Zbigniew Jędrzejewski-Szmek
1d73ffeae1 missing-syscalls: do not generate trailing empty line
The generated .h file was already like this, but what the generator generated
did not match. So we only need to update the generator.
2021-03-08 12:39:50 +01:00
Zbigniew Jędrzejewski-Szmek
36fd31f525 syscalls: update tables
bfin_spinlock and cache_sync are dropped from the table, but didn't have
numbers assigned.

mount_setattr was added in v5.11-rc4-35-g2a1867219c.
2021-03-08 12:31:46 +01:00
Zbigniew Jędrzejewski-Szmek
f76e564437 homed: unref the sd_event object after the sources
Shouldn't make any difference, but let's first flush any pending messages, then
unref the reference-counted stuff, and only at the end do the direct free calls.
2021-03-08 12:00:22 +01:00
Zbigniew Jędrzejewski-Szmek
cf5366387b homed: disable event sources before unreffing them
C.f. 9793530228.

We'd crash when trying to access an already-deallocated object:

Thread no. 1 (7 frames)
 #2 log_assert_failed_realm at ../src/basic/log.c:844
 #3 event_inotify_data_drop at ../src/libsystemd/sd-event/sd-event.c:3035
 #4 source_dispatch at ../src/libsystemd/sd-event/sd-event.c:3250
 #5 sd_event_dispatch at ../src/libsystemd/sd-event/sd-event.c:3631
 #6 sd_event_run at ../src/libsystemd/sd-event/sd-event.c:3689
 #7 sd_event_loop at ../src/libsystemd/sd-event/sd-event.c:3711
 #8 run at ../src/home/homed.c:47

The source in question is an inotify source, and the messages are:

systemd-homed[1340]: /home/ moved or renamed, recreating watch and rescanning.
systemd-homed[1340]: Assertion '*_head == _item' failed at src/libsystemd/sd-event/sd-event.c:3035, function event_inotify_data_drop(). Aborting.

on_home_inotify() got called, then manager_watch_home(), which unrefs the
existing inotify_event_source. I assume that the source gets dispatched again
because it was still in the pending queue.

I can't reproduce the issue (timing?), but this should
fix #17824, https://bugzilla.redhat.com/show_bug.cgi?id=1899264.
2021-03-08 11:59:09 +01:00
Zbigniew Jędrzejewski-Szmek
23d24b76f3 homed: wrap some very long lines 2021-03-08 11:53:22 +01:00
Perry Yuan
9e04eb0d5f hwdb: 60-keyboard:: Update Dell Privacy Micmute Hotkey Map
Dell new Privacy feature provide new hardware level privacy
protect for users
This patch remaps scancode 0x120001 to key code F20 micmute
The old matching string cannot cover some other Dell products
which have the privacy feature,expand the string to all the system
that can load the privacy driver,privacy driver already detect the
system if it can support this feature. So here we can safely just
map the micmute key to scancode 0x120001

Signed-off-by: Perry Yuan <perry_yuan@dell.com>
2021-03-08 10:10:32 +01:00
Zbigniew Jędrzejewski-Szmek
f4929468eb
Merge pull request #18908 from mrc0mmand/fix-packit
ci: correctly drop patches with non four digit indexes
2021-03-07 21:31:31 +01:00
Luca Boccassi
e08c40417e
Merge pull request #18911 from keszybz/coverity-inspired-fixes
Coverity inspired fixes
2021-03-07 15:12:08 +00:00
Zbigniew Jędrzejewski-Szmek
a96a2591a1
Merge pull request #18907 from mrc0mmand/test-dissect-sanitizers
test: fix TEST-50-DISSECT under sanitizers
2021-03-07 12:46:15 +01:00
Zbigniew Jędrzejewski-Szmek
b903f16c2d TEST-15-DROPINS: improve check
https://github.com/systemd/systemd/pull/18579#discussion_r588983813
2021-03-07 12:27:55 +01:00
Zbigniew Jędrzejewski-Szmek
6bc352af1f basic/namespae-util: avoid one allocation 2021-03-07 12:22:28 +01:00
Zbigniew Jędrzejewski-Szmek
9e8a392a9a basic/os-util: adjust indentation 2021-03-07 12:15:42 +01:00
Zbigniew Jędrzejewski-Szmek
60d9c4f3b9 journal-remote: check return value from MHD_add_response_header
Sadly, the API does not allow us to distinguish oom from invalid settings.
If the call fails, let's assume oom happened.

Coverity CID#1444714.
2021-03-07 12:08:06 +01:00
Zbigniew Jędrzejewski-Szmek
e3790c1480 core: fix netns/ipcns socket confusion
Fixup for a70581ffb5c13c91c76ff73ba6f5f3ff59c5a915. Coverity CID#1448383.
2021-03-07 11:56:13 +01:00
Frantisek Sumsal
faf00fd7e1 ci: revert back to --werror instead of -Dc_args=-Werror
-Dc_args=/-Dcpp_args= don't play well with the RPM hardening macros
using $CFLAGS/$CPPFLAGS, since they're mutually exclusive.
2021-03-07 11:07:50 +01:00
Anita Zhang
05e8862806
Merge pull request #18910 from yuwata/socket-util-initialize-variable
socket-util: initialize variable with cleanup attribute
2021-03-06 22:37:01 -08:00
Yu Watanabe
f96f5d54b8 socket-util: initialize variable with cleanup attribute
Follow-up for 83e03c4fc23dae0cbb3fd4e7c2f9ef533fc26160.

Fixes CID#1448460.
2021-03-07 10:32:36 +09:00
Frantisek Sumsal
8615b1f292 ci: correctly drop patches with non four digit indexes 2021-03-06 22:53:09 +01:00
Frantisek Sumsal
9f6235e1b4 test: fix TEST-50-DISSECT under sanitizers
This test would normally get stuck when trying to mount the verity image
due to:

systemd-udevd[299]: dm-0: '/usr/sbin/dmsetup udevflags 6293812'(err) '==371==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.'
systemd-udevd[299]: dm-0: Process '/usr/sbin/dmsetup udevflags 6293812' failed with exit code 1
...
systemd-udevd[299]: dm-0: '/usr/sbin/dmsetup udevcomplete 6293812'(err) '==372==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.'
systemd-udevd[299]: dm-0: Process '/usr/sbin/dmsetup udevcomplete 6293812' failed with exit code 1.
systemd-udevd[299]: dm-0: Command "/usr/sbin/dmsetup udevcomplete 6293812" returned 1 (error), ignoring.

so let's add a simple udev rule which sets $LD_PRELOAD for the block
subsystem.

Also, install the ASan library along with necessary dependencies into
the verity minimal image, to get rid of the annoying (yet harmless)
errors about missing library from $LD_LIBRARY.
2021-03-06 22:44:00 +01:00
Frantisek Sumsal
648fd18924 test: tidy up the ASan-related stuff 2021-03-06 22:43:58 +01:00
Yu Watanabe
edf1b5ec92
Merge pull request #18892 from poettering/cname-tweaks
resolved: properly handle stub replies for chains of multiple CNAMEs
2021-03-07 03:03:27 +09:00
Yu Watanabe
f91861e49f dissect: fix memleak
Fixes #18903.
2021-03-07 03:02:47 +09:00
Carlo Wood
57f69536a8
Manual page fixes (#18906) 2021-03-07 02:54:33 +09:00
Lennart Poettering
47f9f84ca9
Merge pull request #18891 from keszybz/size_t-cast-removal
size_t cast removal
2021-03-06 14:32:46 +01:00
Lennart Poettering
5d7da51ee1 resolved: when synthesizing stub replies from multiple upstream packet, let's avoid RR duplicates
If we synthesize a stub reply from multiple upstream packet (i.e. a
series of CNAME/DNAME redirects), it might happen that we add the same
RR to a different reply section at a different CNAME/DNAME redirect
chain element. Let's clean this up once we are about to send the reply
message to the client: let's remove sections from "lower-priority"
sections when they are already listed in a "higher-priority" section.
2021-03-06 14:04:21 +01:00
Lennart Poettering
b97fc57178 resolved: fully follow CNAMEs in the DNS stub after all
In 2f4d8e577ca7bc51fb054b8c2c8dd57c2e188a41 I argued that following
CNAMEs in the stub is not necessary anymore. However, I think it' better
to revert to the status quo ante and follow it after all, given it is
easy for us and makes sure our D-Bus/varlink replies are more similar to
our DNS stub replies that way, and we save clients potential roundtrips.

Hence, whenever we hit a CNAME/DNAME redirect, let's restart the query
like we do for the D-Bus/Varlink case, and collect replies as we go.
2021-03-06 14:04:21 +01:00
Lennart Poettering
39005e1870 resolved: split out helper that checks whether we shall reply with EDNS0 DO
Just some refactoring, no actual code changes.
2021-03-06 14:04:21 +01:00
Lennart Poettering
4838dc4f2b resolved: handle multiple CNAME redirects in a single reply from upstream
www.netflix.com responds with a chain of CNAMEs in the same packet.
Let's handle that properly (so far we only followed CNAMEs a single step
when in the same packet)

Fixes: #18819
2021-03-06 14:04:10 +01:00
Lennart Poettering
d29958261a resolved: tighten checks in dns_resource_record_get_cname_target()
Let's refuse to consider CNAME/DNAME replies matching for RR types where
that is not really conceptually allow (i.e. on CNAME/DNAME lookups
themselves).

(And add a similar check to dns_resource_key_match_cname_or_dname() too,
which implements a smilar match)
2021-03-06 13:33:50 +01:00
Lennart Poettering
e0ae456a55 dns-query: export CNAME_MAX, so that we can use it in other files, too
Let's rename it a bit, to be more explanatory while exporting it.

(And let's bump the CNAME limit to 16 — 8 just sounded so little)
2021-03-06 13:33:50 +01:00
Yu Watanabe
2541462f1b
Merge pull request #18890 from keszybz/fuzz-bus-match
Add fuzzers for bus match parsing code
2021-03-06 20:35:38 +09:00
Zbigniew Jędrzejewski-Szmek
7a39ec2e3e sd-bus: remove unnecessary variable
Also use structued initialization in one more place, use '\0' for NUL bytes,
and move variable to the right block (the code was OK, but it is strange to
have 'char *value' defined in a different scope then 'size_t value_allocated').
2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
48eb2af68a docs: document fuzzer variables 2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
c1c9510c9b fuzz-main: allow the number of runs to be overridden
This is useful when debugging.
2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
8df3f44c90 sd-bus: fix memleak in failure path in bus_match_parse() 2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
f92d8e4446 fuzz-bus-match: add example from bugzilla#1935084
The fuzzer seems to have no trouble with this sample. It seems that the
problem reported in the bug is not caused by the match parsing code. But
let's add the sample just in case.

https://bugzilla.redhat.com/show_bug.cgi?id=1935084
2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
84f11eda20 fuzz-bus-match: new fuzzer
This fuzzer is based on test-bus-match. Even the initial corpus is
derived entirely from it.

https://bugzilla.redhat.com/show_bug.cgi?id=1935084 shows an crash
in bus_match_parse(). I checked the coverage stats on oss-fuzz, and
sadly existing fuzzing did not cover this code at all.
2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
dd2e9b7658 test-bus-match: small modernization 2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
c25eb44aef sd-bus: avoid alloc and missing oom check in bus_match_dump() 2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
fc561c8eac sd-bus: let bus_match_dump() take an output file 2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
5963e6f43c sd-bus: fix memstream buffer extraction
I'm getting the following error under valgrind:

==305970== Invalid free() / delete / delete[] / realloc()
==305970==    at 0x483E9F1: free (vg_replace_malloc.c:538)
==305970==    by 0x4012CD: mfree (alloc-util.h:48)
==305970==    by 0x4012EF: freep (alloc-util.h:83)
==305970==    by 0x4017F4: LLVMFuzzerTestOneInput (fuzz-bus-match.c:58)
==305970==    by 0x401A58: main (fuzz-main.c:39)
==305970==  Address 0x59972f0 is 0 bytes inside a block of size 8,192 free'd
==305970==    at 0x483FCE4: realloc (vg_replace_malloc.c:834)
==305970==    by 0x4C986F7: _IO_mem_finish (in /usr/lib64/libc-2.33.so)
==305970==    by 0x4C8F5E0: fclose@@GLIBC_2.2.5 (in /usr/lib64/libc-2.33.so)
==305970==    by 0x49D2CDB: fclose_nointr (fd-util.c:108)
==305970==    by 0x49D2D3D: safe_fclose (fd-util.c:124)
==305970==    by 0x4A4BCCC: fclosep (fd-util.h:41)
==305970==    by 0x4A4E00F: bus_match_to_string (bus-match.c:859)
==305970==    by 0x4016C2: LLVMFuzzerTestOneInput (fuzz-bus-match.c:58)
==305970==    by 0x401A58: main (fuzz-main.c:39)
==305970==  Block was alloc'd at
==305970==    at 0x483FAE5: calloc (vg_replace_malloc.c:760)
==305970==    by 0x4C98787: open_memstream (in /usr/lib64/libc-2.33.so)
==305970==    by 0x49D56D6: open_memstream_unlocked (fileio.c:97)
==305970==    by 0x4A4DEC5: bus_match_to_string (bus-match.c:859)
==305970==    by 0x4016C2: LLVMFuzzerTestOneInput (fuzz-bus-match.c:58)
==305970==    by 0x401A58: main (fuzz-main.c:39)
==305970==

So the fclose() which is called from _cleanup_fclose_ clearly reallocates the
buffer (maybe to save memory?). open_memstream(3) says:

  The locations referred to by these pointers are updated each time the
  stream is flushed (fflush(3)) and  when the stream is closed (fclose(3)).

This seems to mean that we should close the stream first before grabbing the
buffer pointer.
2021-03-06 09:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
49ba1522fc fuzz-bus-message: move sources to src/libsystemd/
There's also fuzz-bus-label, but despite the name, it tests code that is in
src/shared/, so it shouldn't move.
2021-03-06 09:27:09 +01:00
Zbigniew Jędrzejewski-Szmek
4ff42f8327 bus/bus-match: use "ret_" prefix for output parameters 2021-03-06 09:26:57 +01:00
Zbigniew Jędrzejewski-Szmek
fd5b9b8473 bus/bus-match: inline iterator variable declarations 2021-03-06 09:24:47 +01:00
Yu Watanabe
f6b54e5280 format-table: fix potentail memleak and invalid-free 2021-03-06 09:23:38 +01:00
Yu Watanabe
5a12d1ca1a fstab-generator: fix typo 2021-03-06 08:52:43 +01:00
Michal Sekletar
996c83903d udev: run link_update() with increased retry count in second invocation
In PR #17431 we have introduced retry loop in link_update() in order to
maximize the chance that we end up with correct target when there are
multiple contenders for given symlink.

Number of iterations in retry loop is either 1 or
LINK_UPDATE_MAX_RETRIES, depending on the value of 'initialized' db
flag. When device appears for the first time we need to set the
flag before calling link_update() via update_devnode() for the second
time to make sure we run the second invocation with higher retry loop
counter.
2021-03-06 15:33:05 +09:00
Yu Watanabe
c2cbe05708
Merge pull request #18896 from poettering/no-localhost-ipv6
if ipv6 is turned off, don't synthesize localhost as ::1 ever
2021-03-06 11:28:38 +09:00
Frantisek Sumsal
3b5fc147d6 test: disable at_exit LSan check for dbus.service
When running integration tests under sanitizers D-Bus fails to
shutdown cleanly, causing unnecessary noise in the logs:

```
dbus-daemon[272]: ==272==LeakSanitizer has encountered a fatal error.
dbus-daemon[272]: ==272==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
dbus-daemon[272]: ==272==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
```

Since we're not "sanitizing" D-Bus anyway let's disable LSan's at_exit
check for the dbus.service to get rid of this error.
2021-03-06 11:27:04 +09:00
Luca Boccassi
4f67a5d923 dissect: avoid overflow access by NULLSTR_FOREACH
NULLSTR_FOREACH expects two terminating NULs, but the joined string
for extension-release.d only had the canonical one.
Use a placeholder when joining and fix it manually.
2021-03-06 11:26:41 +09:00
Lennart Poettering
07a7441a1c socket-util: refuse "all" and "default" as valid ifnames
Let's avoid collisions with special sysctls.
2021-03-06 11:26:18 +09:00
Luca Boccassi
5d5b6442a2
Merge pull request #18875 from keszybz/localed-error
localed: return error when setting a non-installed keymap
2021-03-05 22:50:41 +00:00
ChopperRob
39815435d0
Update 60-sensor.hwdb (#18884)
added support for the Lenovo IdeaPad D330-10IGM screen orientation
2021-03-06 06:11:26 +09:00
Lennart Poettering
747b596ff8 resolved: never return ::1 when localhost or local hostname is resolved while IPv6 is off in the kernel
Fixes: #18812
2021-03-05 20:51:43 +01:00
Lennart Poettering
83e03c4fc2 socket-util: add helper for checking if IPv6 is enabled 2021-03-05 20:51:43 +01:00
Lennart Poettering
571ec995fe socket-util: cache result of socket_ipv6_is_supported()
And while we are at it, log about unexpected errors.
2021-03-05 20:51:43 +01:00
Lennart Poettering
b0ffd2760c basic: move shared/sysctl-util.[ch] → basic/
This is self-contained ans allows us later to use the provided APIs from
other code in src/basic/
2021-03-05 20:41:07 +01:00
Lennart Poettering
4b30f2e135 sysctl-util: use read_full_virtual_file() for reading sysctls
Given these files are part of procfs, let's use the correct API calls
for reading them.

This changes one occasion of read_one_line_file() to
read_full_virtual_file(), which superficially is a different thing, but
shouldn't actually be a difference, since sysctls can't be longer than
4K anyway, and the piecemeal logic behind read_one_line_file() cannot
work with the special semantics of procfs anyway.
2021-03-05 20:38:51 +01:00
Zbigniew Jędrzejewski-Szmek
6f0647d503 Drop some (size_t) casts
Upcasts of the same type are automatic, so no need for an explicit cast.
2021-03-05 19:27:23 +01:00
Zbigniew Jędrzejewski-Szmek
fd4e991dfd Drop parens from around already-parenthesized defines 2021-03-05 19:27:23 +01:00
Zbigniew Jędrzejewski-Szmek
6d12f1b787 network-wait-online: use sd_event_add_time_relative() 2021-03-05 19:27:23 +01:00
Zbigniew Jędrzejewski-Szmek
63dc82d378
Merge pull request #18852 from yuwata/tree-wide-use-UINT64_MAX
tree-wide: use UINT64_MAX or friends
2021-03-05 17:51:34 +01:00
Frantisek Sumsal
3ee0cf339b
Merge pull request #18885 from yuwata/udev-fix-import-program-rhbz-1935062
udev: fix importing program result
2021-03-05 14:19:21 +01:00
Yu Watanabe
3509c7874b test: add test for IMPORT{program}= udev rule 2021-03-05 18:39:38 +09:00
Yu Watanabe
1ebcf47296 test: merge udev tests 2021-03-05 18:36:04 +09:00
Anita Zhang
016f36ae72 shutdown: log on container exit 2021-03-04 20:08:26 -08:00
Anita Zhang
f975f1cc74 shutdown: set always_reopen_console
Back in v232 systemd-shutdown would log to /dev/console. However after
the addition of always_reopen_console (v233) it would log to STDERR.
This caused some debugging issues as container systemd-shutdown logs
weren't being logged to console as the arg `--log-target=console` suggested.

Since it appears that always_reopen_console was intended for pid1, set
it in systemd-shutdown as well so logs will go to /dev/console.
2021-03-04 20:08:00 -08:00
Yu Watanabe
275334c562
Merge pull request #18873 from yuwata/use-config-parse-many-and-null-or-empty-path
tree-wide: use config_parse_many() and null_or_empty_path()
2021-03-05 11:34:54 +09:00
Yu Watanabe
986c0edfcb dhcp-server: also append specified additional options and vendor specific option on DHCP_OFFER
Fixes #15780.
2021-03-05 11:34:32 +09:00
Yu Watanabe
daceb818cf udev: also not unescape command result on debug log 2021-03-05 11:31:30 +09:00
Yu Watanabe
86c783d93d udev: do not unescape command result
This fixes a bug introduced by 28a5065149c31a8689738ddcd1100502371a7c34.

Fixes RHBZ#1935062 (https://bugzilla.redhat.com/show_bug.cgi?id=1935062).
2021-03-05 09:42:56 +09:00
Yu Watanabe
f385c44787 strv: introduce strv_split_newlines_full() 2021-03-05 09:29:57 +09:00
Alastair Pharo
329998b365
hwdb: add fuzz for Dell Latitude E7470 (#18876) 2021-03-05 10:10:54 +10:00
Yu Watanabe
0efaa4843e install: use null_or_empty_path() 2021-03-05 08:09:05 +09:00
Yu Watanabe
4e54a17dbb network: use null_or_empty_path()
This also drops unnecessary fseek().
2021-03-05 08:09:05 +09:00
Yu Watanabe
e8e2788dab udev/net: use null_or_empty_path() 2021-03-05 08:09:05 +09:00
Yu Watanabe
e406e8a29a udev/net: make .link files support drop-in config 2021-03-05 08:09:01 +09:00
Lennart Poettering
bb72c43485 copy: move sync_rights() to copy.c and rename copy_rights()
It's so similar to copy_access(), hence let's move it over and rename it
in similar style to the rest of the functions.

No change in behaviour, just moving things over.
2021-03-04 22:35:52 +00:00
Lennart Poettering
e1aec57dd1 copy: simplify error paths when creating temporary files 2021-03-05 07:12:51 +09:00
Yu Watanabe
4e5cbc4b17 efi: introduce UINT32_MAX and UINT64_MAX 2021-03-05 07:10:13 +09:00
Yu Watanabe
f5fbe71d95 tree-wide: use UINT64_MAX or friends 2021-03-05 07:10:13 +09:00
Yu Watanabe
ef1e0b9a46 table: drop last SIZE_MAX from table_set_sort() and table_set_display() 2021-03-05 07:10:13 +09:00
Yu Watanabe
496db33004 tree-wide: use usec_add() and usec_sub_unsigned() 2021-03-05 07:10:08 +09:00
Yu Watanabe
005c7b1d88 journal: make namespace invocation also support drop-in config 2021-03-05 06:57:14 +09:00
Yu Watanabe
30e2c8c7e8 sd-device-enumerator: add comments why trivial_hash_ops_free_free is used
Follow-up for a0887abbd8bd9f1a9a975af08e6b4a43960bb3e2.
2021-03-05 06:39:33 +09:00
Yu Watanabe
7117842657 sd-device-monitor: use hashmap_put_strdup_full() 2021-03-05 06:37:30 +09:00
Yu Watanabe
0fa28efea6 sd-device-monitor: use UINT64_C() macro 2021-03-05 06:35:24 +09:00
Yu Watanabe
79c397a12e sd-device-monitor: use assert() in non-public functions 2021-03-05 06:35:24 +09:00
Lennart Poettering
e6283cbf48 run: tweak algorithm for generating unit name from dbus unique name
This reverts behaviour of systemd-run's unit name generation to the
status quo ante of #18871: we chop off the ":1." prefix if we can.
However, to address the issue that the unique name can overrun we then
do what #18871 did as fallback: only chop off the ":" prefix.

This way we should have pretty names that look like they always looked
in the common case, but in the case of a unique name overrun we still
will have names that work.

Follow-up for #18871
2021-03-04 20:50:41 +00:00
Lennart Poettering
4d930e87ee rm-rf: fix up chmod in the _cleanup_ rm_rf() destructors
REMOVE_CHMOD is necessary to remove files/dirs that are owned by us but
have an access mode that would not allow us to remove them. In generic
destructor calls for use with `_cleanup_` that are "fire-and-forget"
style we should make use of that, to maximize the chance we can actually
remove the files/dirs.

(Also, add in REMOVE_MISSING_OK. Just because prettier, we ignore the
return codes anyway, but it' a bit nicer to ignore a bit fewer errors.)
2021-03-04 20:50:07 +00:00
Lennart Poettering
44a8ad7a24 man: document how to use --network-interface= during boot
Fixes: #18793
2021-03-04 18:55:36 +01:00
Lennart Poettering
a60d064748 fileio: minor read_full_stream_full() optimization
If we shall read as much of a file/stream as we can, then it makes sense
to use the full malloc()ed memory, not just the part we asked for.
2021-03-04 18:55:02 +01:00
Lennart Poettering
407234203b
Merge pull request #18615 from xry111/private-ipc-1
New directives PrivateIPC and IPCNamespacePath
2021-03-04 18:04:28 +01:00
caoxia
370d3c31b4 trans_time sec is int32,it will overflow if local system time is later than 2038. 2021-03-04 18:00:29 +01:00
Lennart Poettering
9706d27cbe
Merge pull request #18840 from yuwata/libudev-monitor-tiny-cleanup
io-util: introduce ppoll_usec()
2021-03-04 17:23:17 +01:00
Lennart Poettering
1b153a82f4 install: include OS headers before our own definition
Doesn't matter much, but matches more our usual coding style where our
definition are done after all headers provided by the OS are included.
2021-03-04 16:20:46 +01:00
Zbigniew Jędrzejewski-Szmek
b4e9c97477
Merge pull request #18773 from yuwata/network-move-several-functions
network: move several functions
2021-03-04 12:25:59 +01:00
Zbigniew Jędrzejewski-Szmek
73d0806abb shared/kbd-util: simplify suffix stripping
It only came to me now that this can be prettified.
2021-03-04 11:52:25 +01:00
Zbigniew Jędrzejewski-Szmek
9ef70c06c6 localed: refuse to set a keymap which is not installed
In https://bugzilla.redhat.com/show_bug.cgi?id=1933873 a keymap was set without
the package that provides it being installed (it2 is in kbd-legacy, which is
not installed by default). Setting a non-installed keymap is problematic,
because it results in nasty failures afterward (*). So let's to the same as
e.g. for locale data, and refuse a setting if the definition doesn't exists in
the filesystem.

The implementation using nftw() is not the most efficient, but I think it's OK
in this case. This is definitely not in any kind of hot path, and I prefer not
to duplicate the filename manipulation logic in a second function.

(*) If the keymap is not found, vconsole-setup.service will fail.
dracut-cmdline-ask.service has Requires=vconsole-setup.service, so it will also
fail, and this breaks boot. dracut-cmdline-ask.service having a hard dependency
is appropriate though: we sadly don't display what the keymap is, and with a wrong
keymap, any attempts to enter a password are likely to fail.
2021-03-04 11:44:20 +01:00
Zbigniew Jędrzejewski-Szmek
1d230090c3 shared/kbd-util: return error on resource errors
I guess we should still not fail on failure to access a directory and such.
2021-03-04 11:44:13 +01:00
Zbigniew Jędrzejewski-Szmek
3864b4b038 shared/kbd-util: fix return value confusion with nftw()
We would return a real error sometimes from the callback, and FTW_STOP other
times. Because of FTW_ACTIONRETVAL, everything except FTW_STOP would be
ignored. I don't think using FTW_ACTIONRETVAL is useful.

nftw() can only be used meaningfully with errno. Even if we return a proper
value ourselves from the callback, it will be propagated as a return value from
nftw(), but there is no way to distinguish this from a value generated by
nftw() itself, which is -1/-EPERM on error. So let's set errno ourselves so the
caller can at least look at that.

The code still ignores all errors.
2021-03-04 11:44:07 +01:00
Anita Zhang
01584bf9e4 run: update dbus unique names check
Some code in systemd-run checks that a bus's unique name must start with
`:1.`. However the dbus specification on unique connection names only specifies
that it must begin with a colon. And the freedesktop/dbus implementation allows
allows unique names to go up to `:INT_MAX.INT_MAX`. So update the
current check to only look for a colon at the beginning.
2021-03-04 09:52:13 +00:00
Zbigniew Jędrzejewski-Szmek
315edc2c11 Move basic/kbd-util to shared/
It is (or should be used) in localectl, localed, and a few other places,
no reason to keep it in basic/.
2021-03-04 09:39:29 +01:00
Zbigniew Jędrzejewski-Szmek
da46a1bc3c core: fix mtime calculation of dropin files
Nominally, the bug was in unit_load_dropin(), which just took the last mtime
instead of calculating the maximum. But instead of adding code to wrap the
loop, this patch goes in the other direction.

All (correct) callers of config_parse() followed a very similar pattern to
calculate the maximum mtime. So let's simplify things by making config_parse()
assume that mtime is initialized and update it to the maximum. This makes all
the callers that care about mtime simpler and also fixes the issue in
unit_load_dropin().

config_parse_many_nulstr() and config_parse_many() are different, because it
makes sense to call them just once, and current ret_mtime behaviour make sense.

Fixes #17730, https://bugzilla.redhat.com/show_bug.cgi?id=1933137.
2021-03-04 16:07:03 +09:00
Zbigniew Jędrzejewski-Szmek
0746159886 coredumpctl: show container hostame
Fixes #18321. I don't see any point in showing the hostname in
_HOSTNAME: it's either the same as COREDUMP_HOSTNAME or irrelevant.
2021-03-04 15:51:59 +09:00
Yu Watanabe
6ce8eda8a1
Merge pull request #18864 from poettering/fsync-tweaks
make sure fsync_directory_of_file() + fsync_full() work on more inode types reasonably
2021-03-04 14:51:10 +09:00
Lennart Poettering
1b55621dab rm-rf: fstatat() might fail if containing dir has limited access mode, patch that too 2021-03-04 14:50:50 +09:00
Lennart Poettering
1071c195f7 fs-util: when opening arbitrary inodes, better use O_NONBLOCK
In case this is a device node where opening might block.
2021-03-04 14:50:38 +09:00
Lennart Poettering
22a0a36efa gpt: generalize validator for GPT partition labels
This adds a proper validator function.

No change in behaviour, just some minor refactoring (this should be
useful elsewhere later on though)
2021-03-04 14:50:24 +09:00
Lennart Poettering
30cdcd628b fs-util: port open_parent() to path_extract_directory() 2021-03-03 22:00:24 +01:00
Hela Basa
79c25eaee4 po: Added translation using Weblate (Sinhala)
Co-authored-by: Hela Basa <r45xveza@pm.me>
2021-03-03 21:56:30 +01:00
Yu Watanabe
a7d757ec29 dhcp6: tighten T1 and T2 value check
Only when T1 and T2 are both 0, they are adjusted later based on
address or prefix T1 and T2. So the first check must be changed.
2021-03-04 05:51:56 +09:00
Yu Watanabe
353887831b libsystemd-network: make log_dhcp_client() or friends include interface name 2021-03-04 05:51:28 +09:00
Yu Watanabe
61a9fa8f0c libsystemd-network: introduce sd_xxx_{set,get}_ifname() 2021-03-04 05:24:54 +09:00
Yu Watanabe
d9e2af0ae8 tree-wide: use ppoll_usec() 2021-03-04 05:06:48 +09:00
Yu Watanabe
c4febde9d0 io-util: introduce ppoll_usec() helper function 2021-03-04 05:06:43 +09:00
Yu Watanabe
1d61d70abb libudev: shorten code a bit
fd_wait_for_event() or ppoll() does not return -EAGAIN.
2021-03-04 05:03:44 +09:00
Lennart Poettering
ed4a653c09 fs-util: handle gracefully if fsync_full() is called on block devices and such 2021-03-03 18:31:23 +01:00
Lennart Poettering
9041e36d07 fs-util: allow fsync_directory_of_file() on directories too
(in which case the parent dir is synced)
2021-03-03 18:31:20 +01:00
Xℹ Ruoyao
80271a446c
Remount /dev/mqueue in unshared mount namespace for PrivateIPC 2021-03-04 00:08:09 +08:00
Xℹ Ruoyao
a70581ffb5
New directives PrivateIPC and IPCNamespacePath 2021-03-04 00:04:36 +08:00
Xℹ Ruoyao
54c2459d56
Refactor network namespace specific functions in generic helpers 2021-03-04 00:04:36 +08:00
Xℹ Ruoyao
a959cd2812
fuzz: add NetworkNamespacePath= into directives.service 2021-03-04 00:04:35 +08:00
Vincent Pelletier
dbdcd51f78 rules: Move ID_SMARTCARD_READER definition to a <70 configuration.
70-uaccess.rules sets the uaccess tag on devices with ID_SMARTCARD_READER
set, but it is set in 99-systemd.rules .
Move this to a 60-*.rules which already matches USB CCID class, factorising
the matching, so 70-uaccess.rules sets up these devices as expected.
2021-03-03 15:18:55 +01:00
Yu Watanabe
66d2330265 network: do not remove LLDP state file on failure 2021-03-03 16:42:23 +09:00
Yu Watanabe
5288861bf6 network: use conservative_rename() at one more place 2021-03-03 16:34:51 +09:00
Yu Watanabe
a34e58d445 network: remove DHCP lease and LLDP state file on link_free() 2021-03-03 16:31:28 +09:00
Yu Watanabe
ab7153b3f4 dhcp: use unlink_and_freep() in dhcp_lease_save() 2021-03-03 16:26:32 +09:00
Yu Watanabe
3be9d62ad1 network: move manager_{rtnl,udev}_process_link() to networkd-link.[ch] 2021-03-03 16:12:33 +09:00
Yu Watanabe
24e3ed843f network: drop unnecessary {} 2021-03-03 16:12:33 +09:00
Yu Watanabe
44e1f7e3dc network: minor style fixes 2021-03-03 16:12:33 +09:00
Yu Watanabe
d23a66f274 network: use unlink_and_freep() cleanup functions
This also makes state files not removed on failure.
2021-03-03 16:11:45 +09:00
Yu Watanabe
3b5a4fc685 network: move state file related functions to networkd-state-file.[ch] 2021-03-03 16:07:45 +09:00
Lennart Poettering
725ad3b062 fstab-generator: add new root=tmpfs option
It's useful to be able to combine a regular /usr/ file system with a
tmpfs as root, for an OS that boots up in volatile mode on every single
boot.  Let's add explicit support for this via root=tmpfs.

Note the relationship to the existing systemd.volatile= option:

1. The kernel command line "root=/dev/… systemd.volatile=yes" will mount
   the specified root fs, and then hide everything at the top by
   overmounting it with a tmpfs, except for the /usr subtree.

2. The kernel command line "root=tmpfs mount.usr=/dev/…" otoh will mount
   a toot fs at the top (just like the case above), but will then mount
   the top-level dir of the fs specified in mount.usr= directly below
   it.

Or to say this differently: in the first case /usr/ from the physical
storage fs is going to become /usr/ of the hierarchy ultimately booted,
while in the second case / from the physical storage fs is going to
become /usr of the hierarchy booted.

Philosophically I figure systemd.volatile= is more an option for
"one-off" boots, while root=tmpfs is something to have as default mode
of operation for suitable images.

This is currently hard to test reasonably, since Dracut refuses to
accept root=tmpfs. This needs to be addressed separately though.
2021-03-03 12:16:32 +09:00
Lennart Poettering
ab05bee1dd time-util: simplify overflow check
And don't rely on 2s complement.
2021-03-03 12:16:21 +09:00
Luca Boccassi
294f1b40ab
Merge pull request #18834 from poettering/path-extract
Beef up path_extract_filename() a bit, and introduce path_extract_directory()
2021-03-02 19:22:53 +00:00
Lennart Poettering
312dff1760 util: add helpers for generating colored check mark glyphs from bools 2021-03-03 03:08:31 +09:00
Lennart Poettering
62a88d7a3e tmpfile: port tempfn_*() to path_extract_*() 2021-03-02 15:07:52 +01:00
Lennart Poettering
7fc607637f machinectl: make sure of path_extract_filename() returning O_DIRECTORY 2021-03-02 15:07:48 +01:00
Lennart Poettering
ee277c6bc7 path-util: return O_DIRECTORY from path_extract_filename() when path ends in slash
Let's fine-tune the path_extract_filename() interface: on succes return
O_DIRECTORY as indicator that the input path was slash-suffixed, and
regular 0 otherwise. This is useful since in many cases it is useful to
filter out paths that must refer to dirs early on.

I opted for O_DIRECTORY instead of the following other ideas:

1. return -EISDIR: I think the function should return an extracted
   filename even when referring to an obvious dir, so this is not an
   option.

2. S_ISDIR, this was a strong contender, but I think O_DIRECTORY is a
   tiny bit nicer since quite likely we will go on and open the thing,
   maybe with openat(), and hence it's quite nice to be able to OR in
   the return value into the flags argument of openat().

3. A new enum defined with two values "dont-know" and
   "definitely-directory". But I figured this was unnecessary, given we
   have other options too, that reuse existing definitions for very
   similar purposes.
2021-03-02 15:07:44 +01:00
Lennart Poettering
8dcb891c19 path-util: add path_extract_directory(), to match path_extract_filename()
These two together are a lot like dirname() + basename() but have the
benefit that they return clear errors when one passes a special case
path to them where the extraction doesn't make sense, i.e. "", "/",
"foo", "foo/" and so on.

Sooner or later we should probably port all our uses of
dirname()/basename() over to this, to catch these special cases more
safely.
2021-03-02 15:07:11 +01:00
Luca Boccassi
7e40042b55 man: document usage of SD_BUS_CREDS_AUGMENT 2021-03-02 12:18:53 +01:00
Lennart Poettering
0498d8d74a
Merge pull request #18841 from keszybz/a-bunch-of-man-page-updates
Two minor small man page updates
2021-03-02 11:03:44 +01:00
Tom Shield
e595edf1a3
udev: add i2c to 60-persistent-input.rules for by-path (#18808)
Add the i2c subsystem to those that create by-path links.
i2c devices may not have IDs so we can't rely on the by-id links
but they (or some of them) should at least have a path that we can use.
2021-03-02 19:56:06 +10:00
Martin Wilck
d8ce385fe3 sd-device: don't use BPF filtering for kernel monitors
BPF filtering accesses fields in the netlink header that are
only filled in by libudev, never by the kernel. Therefore adding
BPF filters for kernel monitors is pointless. Even false filtering
of kernel events might be possible; at least it's hard to prove that
it can't occur.
2021-03-02 18:38:36 +09:00
Yu Watanabe
7a7d2f16c2 tree-wide: fix typo 2021-03-02 09:48:20 +01:00
Zbigniew Jędrzejewski-Szmek
33360f35a1 man: reword sentence about lone coredumps
Let's make it clear that they are not as useful as the full thing.
2021-03-02 09:37:49 +01:00
Zbigniew Jędrzejewski-Szmek
c53e8b9de6 man: add note about "SIG" prefix 2021-03-02 09:35:22 +01:00
Yu Watanabe
dbc3cf009a
Merge pull request #18832 from keszybz/resolved-stop-sources
Always stop sd-event sources in resolved when unreffing them
2021-03-02 14:15:18 +09:00
Lennart Poettering
62e10065d0 fs-util: use ERRNO_IS_NOT_SUPPORTED() at two more places where we can't be sure of the backing implementation 2021-03-02 13:16:22 +09:00
Lennart Poettering
674b04ff1b btrfs-util: add helper that abstracts "might be btrfs subvol?" check
Let#s not hardcode inode nr 256 everywhere, but abstract this check
slightly.
2021-03-02 13:11:37 +09:00
Lennart Poettering
35f4b6d8ba test-signal-util: add test for signal_is_blocked() 2021-03-02 12:41:39 +09:00
Zbigniew Jędrzejewski-Szmek
9793530228 resolved: disable event sources before unreffing them
We generally operate on the assumption that a source is "gone" as soon
as we unref it. This is generally true because we have the only reference.
But if something else holds the reference, our unref doesn't really stop
the source and it could fire again.

In particular, on_query_timeout() is called with DnsQuery* as userdata, and
it calls dns_query_stop() which invalidates that pointer. If it was ever
called again, we'd be accessing already-freed memory.

I don't see what would hold the reference. sd-event takes a temporary reference,
but on the sd_event object, not on the individual sources. And our sources
are non-floating, so there is no reference from the sd_event object to the
sources.

For #18427.
2021-03-01 23:12:51 +01:00
Zbigniew Jędrzejewski-Szmek
f2ec080ef2 resolved: unref event object after the sources
It shouldn't matter because of all the refcounting, but it looks unclean.
2021-03-01 23:12:51 +01:00
Luca Boccassi
ebf7472569
Merge pull request #18831 from keszybz/a-bunch-of-man-page-updates
A bunch of man page updates
2021-03-01 22:11:44 +00:00
Zbigniew Jędrzejewski-Szmek
1447d87a47 man: document \u and \U, say that utf-8 is allowed 2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
07dc08c269 man: move two sysv-specific variables to docs
https://github.com/systemd/systemd/pull/18827#discussion_r584807684
2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
40019c32d7 man: clarify what is inside/outside the container in coredump info 2021-03-01 20:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
a1174b2260 man: update link to systemd-coredump-python
This got moved under the systemd umbrella a long time ago.
Github redirects from the old path, so the link worked, but it's
nicer to use the real location.
2021-03-01 20:53:57 +01:00
Michal Koutný
873446f2e4 Revert "Silence cgroups v1 read-only filesystem warning"
PID 1 will now check upfront which v1 controller hiearchies are
available and modifiable and therefore it will not attempt to touch
them. If we get an EROFS failure then, it points to another
inconsistency so we will report it again. The revert also simplifies the
code a bit.
2021-02-11 16:59:50 +01:00
Michal Koutný
0fa7b50053 core: Make (user) instance aware of delegated cgroup controllers
systemd user instance assumed same controllers are available to it as to
PID 1. That is not true generally, in v1 (legacy, hybrid) we don't delegate any
controllers to anyone and in v2 (unified) we may delegate only subset of
controllers.
The user instance would fail silently when the controller cgroup cannot
be created or the controller cannot be enabled on the unified hierarchy.

The changes in 7b63961415 ("cgroup: Swap cgroup v1 deletion and
migration") caused some attempts of operating on non-delegated
controllers to be logged.

Make the user instance first check what controllers are availble to it
and narrow operations only to these controllers. The original checks are
kept in place.

Note that daemon-reexec needs to be invoked in order to update the set
of unabled controllers after a change.

Fixes: #18047
Fixes: #17862
2021-02-11 16:58:34 +01:00
Michal Koutný
81504017f4 cgroup: Simplify cg_get_path_and_check
The function controller_is_accessible() doesn't do really much in case
of the unified hierarchy. Move common parts into cg_get_path_and_check
and make controller check v1 specific. This is refactoring only.
2021-02-11 11:51:59 +01:00
1613 changed files with 75403 additions and 30826 deletions

View File

@ -7,8 +7,10 @@ about: A report of an error in a recent systemd version
**systemd version the issue has been seen with**
> …
<!-- **NOTE:** Do not submit bug reports about anything but the two most recently released (non-rc) systemd versions upstream! -->
<!-- See https://github.com/systemd/systemd/releases for the list of most recent releases. -->
<!-- **NOTE:** Do not submit bug reports about anything but the two most recently released *major* systemd versions upstream! -->
<!-- If there have been multiple stable releases for that major version, please consider updating to a recent one before reporting an issue. -->
<!-- When using a distro package, please make sure that the version reported is meaningful for upstream. -->
<!-- See https://github.com/systemd/systemd-stable/releases for the list of most recent releases. -->
<!-- For older version please use distribution trackers (see https://systemd.io/CONTRIBUTING#filing-issues). -->
**Used distribution**

View File

@ -13,6 +13,7 @@ ARGS=(
"--optimization=3 -Db_lto=true"
"--optimization=3 -Db_lto=false"
"--optimization=3 -Ddns-over-tls=openssl"
"--optimization=3 -Dfexecve=true -Dstandalone-binaries=true -Dstatic-libsystemd=true -Dstatic-libudev=true"
"-Db_ndebug=true"
)
PACKAGES=(
@ -45,9 +46,9 @@ PACKAGES=(
mount
net-tools
perl
python-lxml
python3-evdev
python3-lxml
python3-jinja2
python3-pip
python3-pyparsing
python3-setuptools

View File

@ -19,6 +19,7 @@ jobs:
matrix:
env:
- { COMPILER: "gcc", COMPILER_VERSION: "10" }
- { COMPILER: "gcc", COMPILER_VERSION: "11" }
- { COMPILER: "clang", COMPILER_VERSION: "10" }
- { COMPILER: "clang", COMPILER_VERSION: "11" }
- { COMPILER: "clang", COMPILER_VERSION: "12" }

View File

@ -27,7 +27,7 @@ jobs:
- uses: systemd/mkosi@v9
- name: Install
run: sudo apt-get update && sudo apt-get install --no-install-recommends python3-pexpect
run: sudo apt-get update && sudo apt-get install --no-install-recommends python3-pexpect python3-jinja2
- name: Symlink
run: ln -s .mkosi/mkosi.${{ matrix.distro }} mkosi.default
@ -48,6 +48,9 @@ jobs:
- name: Build ${{ matrix.distro }}
run: sudo python3 -m mkosi --password= --qemu-headless build
- name: Show ${{ matrix.distro }} image summary
run: sudo python3 -m mkosi --password= --qemu-headless summary
- name: Boot ${{ matrix.distro }} systemd-nspawn
run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless boot

View File

@ -8,9 +8,6 @@ import sys
def run() -> None:
p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300)
p.expect("login:")
p.sendline("root")
p.expect("#")
p.sendline("systemctl poweroff")

View File

@ -6,6 +6,7 @@ ADDITIONAL_DEPS=(
clang
expect
fdisk
jekyll
libfdisk-dev
libfido2-dev
libp11-kit-dev

View File

@ -9,6 +9,7 @@ extraction:
- libfdisk-dev
- libp11-kit-dev
- libssl-dev
- python3-jinja2
python:
python_setup:
version: 3

View File

@ -115,12 +115,14 @@ Michael Biebl <biebl@debian.org> <mbiebl@gmail.com>
Michael Buesch <mbuesch@freenet.de>
Michael Hoy <rimmington@gmail.com>
Michael Olbrich <m.olbrich@pengutronix.de>
Michael Trapp <michael.trapp@sap.com>
Michal Soltys <soltys@ziu.info> <nozo@ziu.info>
Michal Suchanek <msuchanek@suse.de>
Michal Suchanek <msuchanek@suse.de> <hramrach@gmail.com>
Michal Sekletár <msekleta@redhat.com>
Michał Szczepański <skrzatu@hotmail.com> <skrzatu@gmail.com>
Michel Kraus <github@demonsphere.de> <27o@users.noreply.github.com>
Michele Guerini Rocco <rnhmjoj@inventati.org>
Miklos Vajna <vmiklos@frugalware.org> <vmiklos@gmail.com>
Milan Pässler <me@petabyteboy.de>
Neil Brown <neil@brown.name>
@ -209,3 +211,4 @@ Andrey Yashkin <38919268+AndreyYashkin@users.noreply.github.com>
Ronald Tschalär <ronald@innovation.ch>
Jay Burger <jay.burger@fujitsu.com> <root@new-host-3.home>
Yi Gao <ymuemc@163.com>
Weblate <noreply@weblate.org>

View File

@ -35,13 +35,14 @@ BuildPackages=
libxkbcommon
libxslt
lz4
m4
meson
pam
pkgconfig
python
python-lxml
python-jinja
qrencode
rsync
xz
zstd
@ -51,4 +52,3 @@ Packages=
nano
qrencode
strace
vi

View File

@ -46,11 +46,11 @@ BuildPackages=
libtss2-dev
libxkbcommon-dev
libzstd-dev
m4
meson
pkg-config
python3
python3-lxml
python3-jinja2
tree
uuid-dev
xsltproc
@ -68,4 +68,3 @@ Packages=
locales
nano
strace
vim-tiny

View File

@ -5,17 +5,12 @@
[Distribution]
Distribution=fedora
Release=33
Release=34
[Packages]
BuildPackages=
audit-libs-devel
bzip2-devel
cryptsetup-devel
dbus-devel
diffutils
docbook-style-xsl
elfutils-devel
findutils
gcc
gettext
@ -23,56 +18,56 @@ BuildPackages=
glibc-minimal-langpack
gnu-efi
gnu-efi-devel
gnutls-devel
gperf
iptables-devel
kmod-devel
libacl-devel
libblkid-devel
libcap-devel
libcurl-devel
libfdisk-devel
libfido2-devel
libgcrypt-devel
libidn2-devel
libmicrohttpd-devel
libmount-devel
libpwquality-devel
libseccomp-devel
libselinux-devel
libxkbcommon-devel
libxslt
libzstd-devel
lz4
lz4-devel
m4
meson
ninja-build
openssl-devel
p11-kit-devel
pam-devel
pcre2-devel
perl(IPC::SysV)
perl(Time::HiRes)
pkgconfig
python3-devel
python3-lxml
qrencode-devel
pkgconfig(audit)
pkgconfig(blkid)
pkgconfig(bzip2)
pkgconfig(dbus-1)
pkgconfig(fdisk)
pkgconfig(gnutls)
pkgconfig(libacl)
pkgconfig(libcap)
pkgconfig(libcryptsetup)
pkgconfig(libcurl)
pkgconfig(libdw)
pkgconfig(libfido2)
pkgconfig(libgcrypt)
pkgconfig(libidn2)
pkgconfig(libiptc)
pkgconfig(libkmod)
pkgconfig(liblz4)
pkgconfig(liblzma)
pkgconfig(libmicrohttpd)
pkgconfig(libpcre2-8)
pkgconfig(libqrencode)
pkgconfig(libseccomp)
pkgconfig(libselinux)
pkgconfig(libzstd)
pkgconfig(mount)
pkgconfig(openssl)
pkgconfig(p11-kit-1)
pkgconfig(pwquality)
pkgconfig(tss2-esys)
pkgconfig(tss2-mu)
pkgconfig(tss2-rc)
pkgconfig(valgrind)
pkgconfig(xkbcommon)
python3dist(jinja2)
python3dist(lxml)
rpm
tpm2-tss-devel
tree
valgrind-devel
xz-devel
zstd
/usr/bin/xsltproc
Packages=
gdb
# libfido2 + libzstd can be dropped once the Fedora RPM gets a dependency on them
libfido2
libzstd
nano
# procps-ng provides a set of useful utilies (ps, free, etc)
procps-ng
strace
tpm2-tss
vi

View File

@ -30,13 +30,13 @@ BuildPackages=
libseccomp-devel
libselinux-devel
libxslt-tools
m4
meson
pam-devel
pciutils-devel
pcre-devel
python3
python3-lxml
python3-jinja2
qrencode-devel
system-user-nobody
systemd-sysvinit
@ -69,4 +69,3 @@ Packages=
nano
strace
util-linux
vi

View File

@ -49,11 +49,11 @@ BuildPackages=
libxkbcommon-dev
libxtables-dev
libzstd-dev
m4
meson
pkg-config
python3
python3-lxml
python3-jinja2
tree
tzdata
uuid-dev
@ -71,4 +71,3 @@ Packages=
locales
nano
strace
vim-tiny

View File

@ -18,22 +18,19 @@ actions:
post-upstream-clone:
# Use the Fedora Rawhide specfile
- "git clone https://src.fedoraproject.org/rpms/systemd .packit_rpm --depth=1"
# Drop the "sources" file so rebase-helper doesn't think we're a dist-git
- "rm -fv .packit_rpm/sources"
# Drop backported patches from the specfile, but keep the downstream-only ones
# - Patch0000-0499: backported patches from upstream
# - Patch0500-9999: downstream-only patches
- "sed -ri '/^Patch0[0-4][0-9]{2}+\\:.+\\.patch/d' .packit_rpm/systemd.spec"
# Build the RPMs with -Werror to catch possible compiler warnings. Since
# --werror in meson doesn't seem to work with -Db_lto=true [0], let's use
# -Dc_args= and -Dcpp_args= instead.
#
# Exceptions:
# - use -Wno-deprecated-declarations to get around mallinfo() use in
# basic/selinux-util.c
# - don't use -Werror on x86 architectures, otherwise all function checks
# will fail (with error: cast from pointer to integer of different size)
- "sed -ri '/^Patch0[0-4]?[0-9]{0,2}\\:.+\\.patch/d' .packit_rpm/systemd.spec"
# Build the RPM with --werror. Even though --werror doesn't work in all
# cases (see [0]), we can't use -Dc_args=/-Dcpp_args= here because of the
# RPM hardening macros, that use $CFLAGS/$CPPFLAGS (see [1]).
#
# [0] https://github.com/mesonbuild/meson/issues/7360
- 'sed -i "/^CONFIGURE_OPTS=(/a%ifnarch i386 i686\n-Dc_args=\"-Werror -Wno-deprecated-declarations\" -Dcpp_args=\"-Werror -Wno-deprecated-declarations\"\n%endif" .packit_rpm/systemd.spec'
# [1] https://github.com/systemd/systemd/pull/18908#issuecomment-792250110
- 'sed -i "/^CONFIGURE_OPTS=(/a--werror" .packit_rpm/systemd.spec'
jobs:
- job: copr_build

View File

@ -57,7 +57,7 @@ for phase in "${PHASES[@]}"; do
echo "deb http://archive.ubuntu.com/ubuntu $UBUNTU_RELEASE-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/backports.list
sudo apt-get -q update
sudo apt-get install -y -t "$UBUNTU_RELEASE-backports" lxc
sudo apt-get install -y python3-debian git dpkg-dev fakeroot
sudo apt-get install -y python3-debian git dpkg-dev fakeroot python3-jinja2
[ -d $AUTOPKGTEST_DIR ] || git clone --quiet --depth=1 https://salsa.debian.org/ci-team/autopkgtest.git "$AUTOPKGTEST_DIR"

637
NEWS
View File

@ -1,5 +1,535 @@
systemd System and Service Manager
CHANGES WITH 249 in spe:
* When operating on disk images via the --image= switch of various
tools (such as systemd-nspawn or systemd-dissect), and multiple
suitable root or /usr/ partitions exist in the image, then a simple
comparison inspired by strverscmp() is done on the GPT partition
label, and the newest partition is picked. This permits a simple and
generic whole-file-system A/B update logic where new operating system
versions are dropped into partitions whose label is then updated with
a matching version identifier.
* systemd-sysusers now supports querying the passwords to set for the
users it creates via the "credentials" logic introduced in v247: the
passwd.hashed-password.<user> and passwd.plaintext-password.<user>
credentials are consulted for the password to use (either in UNIX
hashed form, or literally). By default these credentials are inherited
down from PID1 (which in turn imports it from a container manager if
there is one). This permits easy configuration of user passwords
during first boot. Example:
# systemd-nspawn -i foo.raw --volatile=yes --set-credential=passwd.plaintext-password.root:foo
Note that systemd-sysusers operates in purely additive mode: it
executes no operation if the declared users already exist, and hence
doesn't set any passwords as effect of the command line above if the
specified root user exists already in the image. (Note that
--volatile=yes ensures it doesn't, though.)
* systemd-firstboot now also supports querying various system
parameters via the credential subsystems. Thus, as above this may be
used to initialize important system parameters on first boot of
previously unprovisioned images (i.e. images with a mostly empty
/etc/).
* The systemd-machine-id-setup tool now supports a --image= switch for
provisioning a machine ID file into an OS disk image, similar to how
--root= operates on an OS file tree. This matches the existing switch
of the same name for systemd-tmpfiles, systemd-firstboot, and
systemd-sysusers tools.
* Similarly, systemd-repart gained support for the --image= switch too.
In combination with the existing --size= option, this makes the tool
particularly useful for easily growing disk images in a single
invocation, following the declarative rules included in the image
itself.
* systemd-repart's partition configuration files gained support for a
new switch MakeDirectories= which may be used to create arbitrary
directories inside file systems that are created, before registering
them in the partition table. This is useful in particular for root
partitions to create mount point directories for other partitions
included in the image. For example, a disk image that contains a
root, /home/, and /var/ partitions, may set MakeDirectories=yes to
create /home/ and /var/ as empty directories in the root file system
on its creation, so that the resulting image can be mounted
immediately, even in read-only mode.
* systemd-repart's CopyBlocks= setting gained support for the special
value "auto". If used, a suitable matching partition on the booted OS
is found as source to copy blocks from. This is useful when
implementing replicating installers, that are booted from one medium
and then stream their own root partition onto the target medium.
* systemd-repart's partition configuration files gained support for a
Flags= and a ReadOnly= setting, allowing control of the GPT partition
flags for the created partitions: this is useful for marking newly
created partitions as read-only from the start.
* The /etc/os-release file has been extended with two new (optional)
variables IMAGE_VERSION= and IMAGE_ID=, carrying identity and version
information for OS images that are updated comprehensively and
atomically as one image. Two new specifiers %M, %A now resolve to
these two fields in the various configuration options that resolve
specifiers.
* portablectl gained a new switch --extension= for enabling portable
service images with extensions that follow the extension image
concept introduced with v248, and thus allows layering multiple
images when setting up the root filesystem of the service.
* systemd-coredump will now extract ELF build-id information from
processes dumping core and include it in the coredump report.
Moreover, it will look for ELF .note.package sections with
distribution packaging meta-information about the crashing process.
This is useful to directly embed the rpm or deb (or any other)
package name and version in ELF files, making it easy to match
coredump reports with the specific package for which the software was
compiled. This is particularly useful on environments with ELF files
from multiple vendors, different distributions and versions, as is
common today in our containerized and sand-boxed world. For further
information, see:
https://systemd.io/COREDUMP_PACKAGE_METADATA
* A new udev hardware database has been added for FireWire devices
(IEEE 1394).
* The "net_id" built-in of udev has been updated with three
backwards-incompatible changes:
- PCI hotplug slot names on s390 systems are now parsed as
hexadecimal numbers. They were incorrectly parsed as decimal
previously, or ignored if the name was not a valid decimal
number.
- PCI onboard indices up to 65535 are allowed. Previously, numbers
above 16383 were rejected. This primarily impacts s390 systems,
where values up to 65535 are used.
- Invalid characters in interface names are replaced with "_".
The new version of the net naming scheme is "v249". The previous
scheme can be selected via the "net.naming-scheme=v247" kernel
command line parameter.
* sd-bus' sd_bus_is_ready() and sd_bus_is_open() calls now accept a
NULL bus object, for which they will return false. Or in other words,
an unallocated bus connection is neither ready nor open.
* The sd-device API acquired a new API function
sd_device_get_usec_initialized() that returns the monotonic time when
the udev device first appeared in the database.
* sd-device gained a new APIs sd_device_trigger_with_uuid() and
sd_device_get_trigger_uuid(). The former is similar to
sd_device_trigger() but returns a randomly generated UUID that is
associated with the synthetic uevent generated by the call. This UUID
may be read from the sd_device object a monitor eventually receives,
via the sd_device_get_trigger_uuid(). This interface requires kernel
4.13 or above to work, and allows tracking a synthetic uevent through
the entire device management stack. The "udevadm trigger --settle"
logic has been updated to make use of this concept if available to
wait precisely for the uevents it generates. "udevadm trigger" also
gained a new parameter --uuid that prints the UUID for each generated
uevent.
* sd-device also gained new APIs sd_device_new_from_ifname() and
sd_device_new_from_ifindex() for allocating an sd-device object for
the specified network interface. The former accepts an interface name
(either a primary or an alternative name), the latter an interface
index.
* The native Journal protocol has been documented. Clients may talk
this as alternative to the classic BSD syslog protocol for locally
delivering log records to the Journal. The protocol has been stable
for a long time and in fact been implemented already in a variety
of alternative client libraries. This documentation makes the support
for that official:
https://systemd.io/JOURNAL_NATIVE_PROTOCOL
* A new BPFProgram= setting has been added to service files. It may be
set to a path to a loaded kernel BPF program, i.e. a path to a bpffs
file, or a bind mount or symlink to one. This may be used to upload
and manage BPF programs externally and then hook arbitrary systemd
services into them.
* The "home.arpa" domain that has been officially declared as the
choice for domain for local home networks per RFC 8375 has been added
to the default NTA list of resolved, since DNSSEC is generally not
available on private domains.
* The CPUAffinity= setting of unit files now resolves "%" specifiers.
* A new ManageForeignRoutingPolicyRules= setting has been added to
.network files which may be used to exclude foreign-created routing
policy rules from systemd-networkd management.
* systemd-network-wait-online gained two new switches -4 and -6 that
may be used to tweak whether to wait for only IPv4 or only IPv6
connectivity.
* .network files gained a new RequiredFamilyForOnline= setting to
fine-tune whether to require an IPv4 or IPv6 address in order to
consider an interface "online".
* networkctl will now show an over-all "online" state in the per-link
information.
* In .network files a new OutgoingInterface= setting has been added to
specify the output interface in bridge FDB setups.
* In .network files the Multipath group ID may now be configured for
[NextHop] entries, via the new Group= setting.
* The DHCP server logic configured in .network files gained a new
setting RelayTarget= that turns the server into a DHCP server relay.
The RelayAgentCircuitId= and RelayAgentRemoteId= settings may be used
to further tweak the DHCP relay behaviour.
* The DHCP server logic also gained a new ServerAddress= setting in
.network files that explicitly specifies the server IP address to
use. If not specified, the address is determined automatically, as
before.
* The DHCP server logic in systemd-networkd gained support for static
DHCP leases, configurable via the [DHCPServerStaticLease]
section. This allows explicitly mapping specific MAC addresses to
fixed IP addresses and vice versa.
* The RestrictAddressFamilies= setting in service files now supports a
new special value "none". If specified sockets of all address
families will be made unavailable to services configured that way.
* systemd-fstab-generator and systemd-repart have been updated to
support booting from disks that carry only a /usr/ partition but no
root partition yet, and where systemd-repart can add it in on the
first boot. This is useful for implementing systems that ship with a
single /usr/ file system, and whose root file system shall be set up
and formatted on a LUKS-encrypted volume whose key is generated
locally (and possibly enrolled in the TPM) during the first boot.
* The [Address] section of .network files now accepts a new
RouteMetric= setting that configures the routing metric to use for
the prefix route created as effect of the address configuration.
Similarly, the [DHCPv6PrefixDelegation] and [IPv6Prefix] sections
gained matching settings for their prefix routes. (The option of the
same name in the [DHCPv6] section is moved to [IPv6AcceptRA], since
it conceptually belongs there; the old option is still understood for
compatibility.)
* The DHCPv6 IAID and DUID are now explicitly configurable in .network
files.
* A new udev property ID_NET_DHCP_BROADCAST on network interface
devices is now honoured by systemd-networkd, controlling whether to
issue DHCP offers via broadcasting. This is used to ensure that s390
layer 3 network interfaces work out-of-the-box with systemd-networkd.
* nss-myhostname and systemd-resolved will now synthesize address
records for a new special hostname "_outbound". The name will always
resolve to the local IP addresses most likely used for outbound
connections towards the default routes. On multi-homed hosts this is
useful to have a stable handle referring to "the" local IP address
that matters most, to the point where this is defined.
* The Discoverable Partition Specification has been updated with a new
GPT partition flag "grow-file-system" defined for its partition
types. Whenever partitions with this flag set are automatically
mounted (i.e. via systemd-gpt-auto-generator or the --image= switch
of systemd-nspawn or other tools; and as opposed to explicit mounting
via /etc/fstab), the file system within the partition is
automatically grown to the full size of the partition. If the file
system size already matches the partition size this flag has no
effect. Previously, this functionality has been available via the
explicit x-systemd.growfs mount option, and this new flag extends
this to automatically discovered mounts. A new GrowFileSystem=
setting has been added to systemd-repart drop-in files that allows
configuring this partition flag. This new flag defaults to on for
partitions automatically created by systemd-repart, except if they
are marked read-only. See the specification for further details:
https://systemd.io/DISCOVERABLE_PARTITIONS
* .network files gained a new setting RoutesToNTP= in the [DHCPv4]
section. If enabled (which is the default), and an NTP server address
is acquired through a DHCP lease on this interface an explicit route
to this address is created on this interface to ensure that NTP
traffic to the NTP server acquired on an interface is also routed
through that interface. The pre-existing RoutesToDNS= setting that
implements the same for DNS servers is now enabled by default.
* A pair of service settings SocketBindAllow= + SocketBindDeny= have
been added that may be used to restrict the network interfaces
sockets created by the service may be bound to. This is implemented
via BPF.
* A new ConditionFirmware= setting has been added to unit files to
conditionalize on certain firmware features. At the moment it may
check whether running on an UEFI system, a device.tree system, or if
the system is compatible with some specified device-tree feature.
* A new ConditionOSRelease= setting has been added to unit files to
check os-release(5) fields. The "=", "!=", "<", "<=", ">=", ">"
operators may be used to check if some field has some specific value
or do an alphanumerical comparison. Equality comparisons are useful
for fields like ID, but relative comparisons for fields like
VERSION_ID or IMAGE_VERSION.
* hostnamed gained a new Describe() D-Bus method that returns a JSON
serialization of the host data it exposes. This is exposed via
"hostnamectl --json=" to acquire a host identity description in JSON.
It's our intention to add a similar features to most services and
objects systemd manages, in order to simplify integration with
program code that can consume JSON.
* Similarly, networkd gained a Describe() method on its Manager and
Link bus objects. This is exposed via "networkctl --json=".
* hostnamectl's various "get-xyz"/"set-xyz" verb pairs
(e.g. "hostnamectl get-hostname", "hostnamectl "set-hostname") have
been replaced by a single "xyz" verb (e.g. "hostnamectl hostname")
that is used both to get the value (when no argument is given), and
to set the value (when an argument is specified). The old names
continue to be supported for compatibility.
* systemd-detect-virt and ConditionVirtualization= are now able to
correctly identify Amazon EC2 environments.
* The LogLevelMax= setting of unit files now applies not only to log
messages generated *by* the service, but also to log messages
generated *about* the service by PID 1. To suppress logs concerning a
specific service comprehensively, set this option to a high log
level.
* bootctl gained support for a new --make-machine-id-directory= switch
that allows precise control on whether to create the top-level
per-machine directory in the boot partition that typically contains
Type 1 boot loader entries.
* During build SBAT data to include in the systemd-boot EFI PE binaries
may be specified now.
* /etc/crypttab learnt a new option "headless". If specified any
requests to query the user interactively for passwords or PINs will
be skipped. This is useful on systems that are headless, i.e. where
an interactive user is generally not present.
* /etc/crypttab also learnt a new option "password-echo=" that allows
configuring whether the encryption password prompt shall echo the
typed password and if so, do so literally or via asterisks. (The
default is the same behaviour as before: provide echo feedback via
asterisks.)
* FIDO2 support in systemd-cryptenroll/systemd-cryptsetup and
systemd-homed has been updated to allow explicit configuration of the
"user presence" and "user verification" checks, as well as whether a
PIN is required for authentication, via the new switches
--fido2-with-user-presence=, --fido2-with-user-verification=,
--fido2-with-client-pin= to systemd-cryptenroll and homectl. Which
features are available, and may be enabled or disabled depends on the
used FIDO2 token.
* systemd-nspawn's --private-user= switch now accepts the special value
"identity" which configures a user namespacing environment with an
identity mapping of 65535 UIDs. This means the container UID 0 is
mapped to the host UID 0, and the UID 1 to host UID 1. On first look
this doesn't appear to be useful, however it does reduce the attack
surface a bit, since the resulting container will possess process
capabilities only within its namespace and not on the host.
* systemd-nspawn's --private-user-chown switch has been replaced by a
more generic --private-user-ownership= switch that accepts one of
three values: "chown" is equivalent to the old --private-user-chown,
and "off" is equivalent to the absence of the old switch. The value
"map" uses the new UID mapping mounts of Linux 5.12 to map ownership
of files and directories of the underlying image to the chosen UID
range for the container. "auto" is equivalent to "map" if UID mapping
mount are supported, otherwise it is equivalent to "chown". The short
-U switch systemd-nspawn now implies --private-user-ownership=auto
instead of the old --private-user-chown. Effectively this means: if
the backing file system supports UID mapping mounts the feature is
now used by default if -U is used. Generally, it's a good idea to use
UID mapping mounts instead of recursive chown()ing, since it allows
running containers off immutable images (since no modifications of
the images need to take place), and share images between multiple
instances. Moreover, the recursive chown()ing operation is slow and
can be avoided. Conceptually it's also a good thing if transient UID
range uses do not leak into persistent file ownership anymore. TLDR:
finally, the last major drawback of user namespacing has been
removed, and -U should always be used (unless you use btrfs, where
UID mapped mounts do not exist; or your container actually needs
privileges on the host).
* nss-systemd now synthesizes user and group shadow records in addition
to the main user and group records. Thus, hashed passwords managed by
systemd-homed are now accessible via the shadow database.
* The userdb logic (and thus nss-systemd, and so on) now read
additional user/group definitions in JSON format from the drop-in
directories /etc/userdb/, /run/userdb/, /run/host/userdb/ and
/usr/lib/userdb/. This is a simple and powerful mechanism for making
additional users available to the system, with full integration into
NSS including the shadow databases. Since the full JSON user/group
record format is supported this may also be used to define users with
resource management settings and other runtime settings that
pam_systemd and systemd-logind enforce at login.
* The userdbctl tool gained two new switches --with-dropin= and
--with-varlink= which can be used to fine-tune the sources used for
user database lookups.
* systemd-nspawn gained a new switch --bind-user= for binding a host
user account into the container. This does three things: the user's
home directory is bind mounted from the host into the container,
below the /run/userdb/home/ hierarchy. A free UID is picked in the
container, and a user namespacing UID mapping to the host user's UID
installed. And finally, a minimal JSON user and group record (along
with its hashed password) is dropped into /run/host/userdb/. These
records are picked up automatically by the userdb drop-in logic
describe above, and allow the user to login with the same password as
on the host. Effectively this means: if host and container run new
enough systemd versions making a host user available to the container
is trivially simple.
* systemd-journal-gatewayd now supports the switches --user, --system,
--merge, --file= that are equivalent to the same switches of
journalctl, and permit exposing only the specified subset of the
Journal records.
* The OnFailure= dependency between units is now augmented with a
implicit reverse dependency OnFailureOf= (this new dependency cannot
be configured directly it's only created as effect of an OnFailure=
dependency in the reverse order — it's visible in "systemctl show"
however). Similar, Slice= now has an reverse dependency SliceOf=,
that is also not configurable directly, but useful to determine all
units that are members of a slice.
* A pair of new dependency types between units PropagatesStopTo= +
StopPropagatedFrom= has been added, that allows propagation of unit
stop events between two units. It operates similar to the existing
PropagatesReloadTo= + ReloadPropagatedFrom= dependencies.
* A new dependency type OnSuccess= has been added (plus the reverse
dependency OnSuccessOf=, which cannot be configured directly, but
exists only as effect of the reverse OnSuccess=). It is similar to
OnFailure=, but triggers in the opposite case: when a service exits
cleanly. This allows "chaining up" of services where one or more
services are started once another service has successfully completed.
* A new dependency type Upholds= has been added (plus the reverse
dependency UpheldBy=, which cannot be configured directly, but exists
only as effect of Upholds=). This dependency type is a stronger form
of Wants=: if a unit has an UpHolds= dependency on some other unit
and the former is active then the latter is started whenever it is
found inactive (and no job is queued for it). This is an alternative
to Restart= inside service units, but less configurable, and the
request to uphold a unit is not encoded in the unit itself but in
another unit that intends to uphold it.
* The systemd-ask-password tool now also supports reading passwords
from the credentials subsystem, via the new --credential= switch.
* The systemd-ask-password tool learnt a new switch --emoji= which may
be used to explicit control whether the lock and key emoji (🔐) is
shown in the password prompt on suitable TTYs.
* The --echo switch of systemd-ask-password now optionally takes a
parameter that controls character echo. It may either show asterisks
(default, as before), turn echo off entirely, or echo the typed
characters literally.
* New documentation has been added that describes the organization of
the systemd source code tree:
https://systemd.io/ARCHITECTURE
* Units using ConditionNeedsUpdate= will no longer be activated in
the initrd.
* It is now possible to list a template unit in the WantedBy= or
RequiredBy= settings of the [Install] section of another template
unit, which will be instantiated using the same instance name.
* A new MemoryAvailable property is available for units. If the unit,
or the slice(s) it is part of, have a memory limit set via MemoryMax=/
MemoryHigh=, MemoryAvailable will indicate how much more memory the
unit can claim before hitting the limit(s).
* systemd-coredump will now try to stay below the cgroup memory limit
placed on itself or one of the slices it runs under, if the storage
area for core files (/var/lib/systemd/coredump/) is placed on a tmpfs,
since files written on such filesystems count toward the cgroup memory
limit. If there is not enough available memory in such cases to store
the core file uncompressed, systemd-coredump will skip to compressed
storage directly (if enabled) and it will avoid analyzing the core file
to print backtrace and metadata in the journal.
* tmpfiles.d/ drop-ins gained a new '=' modifier to check if the type
of a path matches the configured expectations, and remove it if not.
* tmpfiles.d/'s 'Age' now accepts an 'age-by' argument, which allows to
specify which of the several available filesystem timestamps (access
time, birth time, change time, modification time) to look at when
deciding whether a path has aged enough to be cleaned.
* A new IPv6StableSecretAddress= setting has been added to .network
files, which takes an IPv6 address to use as secret for IPv6 address
generation.
* The [DHCPServer] logic in .network files gained support for a new
UplinkInterface= setting that permits configuration of the uplink
interface name to propagate DHCP lease information from.
* The WakeOnLan= setting in .link files now accepts a list of flags
instead of a single one, to configure multiple wake-on-LAN policies.
* User-space defined tracepoints (USDT) have been added to udev at
strategic locations. This is useful for tracing udev behaviour and
performance with bpftrace and similar tools.
* systemd-journald-upload gained a new NetworkTimeoutSec= option for
setting a network timeout time.
* If a system service is running in a new mount namespace (RootDirectory=
and friends), all file systems will be mounted with MS_NOSUID by
default, unless the system is running with SELinux enabled.
Contributions from: Aakash Singh, adrian5, Alexander Sverdlin,
alexlzhu, Allen Webb, Alvin Šipraga, Alyssa Ross, Anders Wenhaug,
Andrea Pappacoda, Anita Zhang, asavah, Balint Reczey, Bertrand Jacquin,
borna-blazevic, caoxia2008cxx, Carlo Teubner, Christian Göttsche,
Christian Hesse, Daniel Schaefer, Dan Streetman,
David Santamaría Rogado, David Tardon, Deepak Rawat,
Dimitri John Ledkov, ei-ke, Emilio Herrera, Emil Renner Berthing,
Eric Cook, Flos Lonicerae, Franck Bui, Francois Gervais,
Frantisek Sumsal, Gibeom Gwon, gitm0, Hans de Goede, Harsh Barsaiyan,
Henri Chain, Hristo Venev, Igor Zhbanov, imayoda, Jakub Warczarek,
James Buren, Jan Janssen, Jan Macku, Jan Synacek, Jason Francis,
Jayanth Ananthapadmanaban, Jeremy Szu, Jérôme Carretero,
Jesse Stricker, jiangchuangang, Joerg Behrmann, Jóhann B. Guðmundsson,
Jörg Deckert, Jörg Thalheim, Juergen Hoetzel, Julia Kartseva,
Kai-Heng Feng, Khem Raj, KoyamaSohei, Lennart Poettering,
LetzteInstanz, Luca Adrian L, Luca Boccassi, Lucas Magasweran,
Mantas Mikulėnas, Marco Antonio Mauro, Mark Wielaard, Masahiro Matsuya,
Matt Johnston, Michael Catanzaro, Michal Koutný, Michal Sekletár,
Mike Crowe, Mike Kazantsev, Milan, Miroslav Suchý, Morten Linderud,
nerdopolis, nl6720, Noah Meyerhans, Oleg Popov, Olle Lundberg,
Ondrej Kozina, Perry.Yuan, Peter Hutterer, Peter Kjellerstedt,
Peter Morrow, Phaedrus Leeds, plattrap, Roman Beranek, Roshan Shariff,
Ryan Hendrickson, Samuel BF, scootergrisen, Sebastian Blunt,
Seong-ho Cho, Sergey Bugaev, Sevan Janiyan, Sibo Dong, simmon,
Simon Watts, Srinidhi Kaushik, Štěpán Němec, Steve Bonds,
Susant Sahani, sverdlin, syyhao1994, Takashi Sakamoto, Topi Miettinen,
tramsay, Uwe Kleine-König, Viktor Mihajlovski, Vincent Dechenaux,
Vito Caputo, William A. Kennington III, Yangyang Shen, Yegor Alexeyev,
Yi Gao, Yu Watanabe, Zbigniew Jędrzejewski-Szmek, zsien, наб
— Warsaw, 2021-06-25
CHANGES WITH 248:
* A concept of system extension images is introduced. Such images may
@ -25,6 +555,10 @@ CHANGES WITH 248:
file hierarchy of specific services, following the same rules and
constraints.
* Support for a new special "root=tmpfs" kernel command-line option has
been added. When specified, a tmpfs is mounted on /, and mount.usr=
should be used to point to the operating system implementation.
* A new configuration file /etc/veritytab may be used to configure
dm-verity integrity protection for block devices. Each line is in the
format "volume-name data-device hash-device roothash options",
@ -123,6 +657,13 @@ CHANGES WITH 248:
unified v2 cgroup hierarchy is used, and "v1" means that legacy v1
hierarchy or the hybrid hierarchy are used.
* A new PrivateIPC= setting on a unit file allows executed processes to
be moved into a private IPC namespace, with separate System V IPC
identifiers and POSIX message queues.
A new IPCNamespacePath= allows the unit to be joined to an existing
IPC namespace.
* The tables of system calls in seccomp filters are now automatically
generated from kernel lists exported on
https://fedora.juszkiewicz.com.pl/syscalls.html.
@ -185,6 +726,13 @@ CHANGES WITH 248:
GenericSegmentOffloadMaxSegments= allow capping the packet size and
the number of segments accepted in Generic Segment Offload.
* systemd-networkd gained support for the "B.A.T.M.A.N. advanced"
wireless routing protocol that operates on ISO/OSI Layer 2 only and
uses ethernet frames to route/bridge packets. This encompasses a new
"batadv" netdev Type=, a new [BatmanAdvanced] section with a bunch of
new settings in .netdev files, and a new BatmanAdvanced= setting in
.network files.
* systemd.network files gained a [Network] RouteTable= configuration
switch to select the routing policy table.
@ -203,10 +751,10 @@ CHANGES WITH 248:
systemd.network files gained a [DHCPv6PrefixDelegation]
ManageTemporaryAddress= switch.
.network files gained a new ActivationPolicy= setting which allows
configuration how the UP state of an interface shall be managed,
systemd.network files gained a new ActivationPolicy= setting which
allows configuring how the UP state of an interface shall be managed,
i.e. whether the interface is always upped, always downed, or may be
upped/downed by the user using "ip dev".
upped/downed by the user using "ip link set dev".
* The default for the Broadcast= setting in .network files has slightly
changed: the broadcast address will not be configured for wireguard
@ -362,6 +910,12 @@ CHANGES WITH 248:
"tainted", to make it clearer that using the legacy hierarchy is not
recommended.
* systemd-localed will now refuse to configure a keymap which is not
installed in the file system. This is intended as a bug fix, but
could break cases where systemd-localed was used to configure the
keymap in advanced of it being installed. It is necessary to install
the keymap file first.
* The main git development branch has been renamed to 'main'.
* mmcblk[0-9]boot[0-9] devices will no longer be probed automatically
@ -413,37 +967,48 @@ CHANGES WITH 248:
* portablectl gained a new "reattach" verb for detaching/reattaching a
portable service image, useful for updating images on-the-fly.
Contributions from: Adam Nielsen, Adrian Vovk, AJ Jordan, Alan Perry,
Alexander Batischev, Ali Abdallah, Andrew Balmos, Anita Zhang, Ansgar
Burchardt, Antonius Frie, Ardy, Arian van Putten, Ariel Fermani, Arnaud
T, A S Alam, Bastien Nocera, Benjamin Berg, Benjamin Robin, Björn
Daase, chri2, Christian Ehrhardt, Christian Hesse, Christopher Obbard,
clayton craft, corvusnix, cprn, d032747, Daan De Meyer, Daniele Medri,
Dan Streetman, Darren Ng, David Edmundson, Deepak Rawat, Devon Pringle,
Dmitry Borodaenko, dropsignal, Einsler Lee, Endre Szabo, Evgeny
Vereshchagin, Fabian Affolter, Felipe Borges, feliperodriguesfr, Felix
Stupp, Florian Hülsmann, Florian Klink, Florian Westphal, Franck Bui,
Frantisek Sumsal, Gablegritule, Gaël PORTAY, Gaurav, Giedrius
Statkevičius, Greg Depoire--Ferrer, Hans de Goede, heretoenhance, Iago
López Galeiras, igo95862, Ilya Dmitrichenko, Jameer Pathan, Jan Tojnar,
Jiehong, Jinyuan Si, John Slade, Jonathan G. Underwood, Jonathan
McDowell, Josh Triplett, Joshua Watt, Julia Cartwright, Julien Humbert,
Kairui Song, Karel Zak, Kevin P. Fleming, Khem Raj, Konomi, krissgjeng,
l4gfcm, Lennart Poettering, Luca Boccassi, Luca BRUNO, Lucas
Werkmeister, Luka Kudra, Luna Jernberg, Marc-André Lureau, Matthias
Klumpp, Matt Turner, Michael Marley, Michal Fabik, Michał Kopeć, Michal
Sekletár, Mike Gilbert, milovlad, moson-mo, Nick, nihilix-melix, Oğuz
Ersen, Ondrej Mosnacek, pali, Pavel Hrdina, Pavel Sapezhko, Peter
Hutterer, Pierre Dubouilh, Piotr Drąg, Richard Laager, rnhmjoj,
RussianNeuroMancer, Sebastiaan van Stijn, Sergey Bugaev, shenyangyang4,
Simonas Kazlauskas, Stefan Agner, Steve Ramage, Susant Sahani, Sven
Mueller, Tad Fisher, Takashi Iwai, Thomas Haller, Topi Miettinen,
Torsten Hilbrich, Tyler Hicks, Ulrich Ölmann, Vinnie Magro, Vito
Caputo, Vlad, walbit-de, Weblate, Weblate (bot), Whired Planck, wouter
bolsterlee, Yuri Chornoivan, Yu Watanabe, Zach Smith, Zbigniew
Jędrzejewski-Szmek, Zmicer Turok, Дамјан Георгиевски
* Intel SGX enclave device nodes (which expose a security feature of
newer Intel CPUs) will now be owned by a new system group "sgx".
— Warsaw, 2021-02-23
Contributions from: Adam Nielsen, Adrian Vovk, AJ Jordan, Alan Perry,
Alastair Pharo, Alexander Batischev, Ali Abdallah, Andrew Balmos,
Anita Zhang, Annika Wickert, Ansgar Burchardt, Antonio Terceiro,
Antonius Frie, Ardy, Arian van Putten, Ariel Fermani, Arnaud T,
A S Alam, Bastien Nocera, Benjamin Berg, Benjamin Robin, Björn Daase,
caoxia, Carlo Wood, Charles Lee, ChopperRob, chri2, Christian Ehrhardt,
Christian Hesse, Christopher Obbard, clayton craft, corvusnix, cprn,
Daan De Meyer, Daniele Medri, Daniel Rusek, Dan Sanders, Dan Streetman,
Darren Ng, David Edmundson, David Tardon, Deepak Rawat, Devon Pringle,
Dmitry Borodaenko, dropsignal, Einsler Lee, Endre Szabo,
Evgeny Vereshchagin, Fabian Affolter, Fangrui Song, Felipe Borges,
feliperodriguesfr, Felix Stupp, Florian Hülsmann, Florian Klink,
Florian Westphal, Franck Bui, Frantisek Sumsal, Gablegritule,
Gaël PORTAY, Gaurav, Giedrius Statkevičius, Greg Depoire-Ferrer,
Gustavo Costa, Hans de Goede, Hela Basa, heretoenhance, hide,
Iago López Galeiras, igo95862, Ilya Dmitrichenko, Jameer Pathan,
Jan Tojnar, Jiehong, Jinyuan Si, Joerg Behrmann, John Slade,
Jonathan G. Underwood, Jonathan McDowell, Josh Triplett, Joshua Watt,
Julia Cartwright, Julien Humbert, Kairui Song, Karel Zak,
Kevin Backhouse, Kevin P. Fleming, Khem Raj, Konomi, krissgjeng,
l4gfcm, Lajos Veres, Lennart Poettering, Lincoln Ramsay, Luca Boccassi,
Luca BRUNO, Lucas Werkmeister, Luka Kudra, Luna Jernberg,
Marc-André Lureau, Martin Wilck, Matthias Klumpp, Matt Turner,
Michael Gisbers, Michael Marley, Michael Trapp, Michal Fabik,
Michał Kopeć, Michal Koutný, Michal Sekletár, Michele Guerini Rocco,
Mike Gilbert, milovlad, moson-mo, Nick, nihilix-melix, Oğuz Ersen,
Ondrej Mosnacek, pali, Pavel Hrdina, Pavel Sapezhko, Perry Yuan,
Peter Hutterer, Pierre Dubouilh, Piotr Drąg, Pjotr Vertaalt,
Richard Laager, RussianNeuroMancer, Sam Lunt, Sebastiaan van Stijn,
Sergey Bugaev, shenyangyang4, simmon, Simonas Kazlauskas,
Slimane Selyan Amiri, Stefan Agner, Steve Ramage, Susant Sahani,
Sven Mueller, Tad Fisher, Takashi Iwai, Thomas Haller, Tom Shield,
Topi Miettinen, Torsten Hilbrich, tpgxyz, Tyler Hicks, ulf-f,
Ulrich Ölmann, Vincent Pelletier, Vinnie Magro, Vito Caputo, Vlad,
walbit-de, Whired Planck, wouter bolsterlee, X Ruoyao, Yangyang Shen,
Yuri Chornoivan, Yu Watanabe, Zach Smith, Zbigniew Jędrzejewski-Szmek,
Zmicer Turok, Дамјан Георгиевски
— Berlin, 2021-03-30
CHANGES WITH 247:
@ -760,7 +1325,7 @@ CHANGES WITH 247:
all system calls known at the time systemd was built.
* Behaviour of system call filter allow lists has changed slightly:
system calls that are contained in @known will result in a EPERM by
system calls that are contained in @known will result in EPERM by
default, while those not contained in it result in ENOSYS. This
should improve compatibility because known system calls will thus be
communicated as prohibited, while unknown (and thus newer ones) will
@ -5231,7 +5796,7 @@ CHANGES WITH 233:
* sd-id128 gained a new API for generating unique IDs for the host in a
way that does not leak the machine ID. Specifically,
sd_id128_get_machine_app_specific() derives an ID based on the
machine ID a in well-defined, non-reversible, stable way. This is
machine ID in a well-defined, non-reversible, stable way. This is
useful whenever an identifier for the host is needed but where the
identifier shall not be useful to identify the system beyond the
scope of the application itself. (Internally this uses HMAC-SHA256 as
@ -7481,7 +8046,7 @@ CHANGES WITH 220:
* udev will no longer create device symlinks for all block devices by
default. A deny list for excluding special block devices from this
logic has been turned into a allow list that requires picking block
logic has been turned into an allow list that requires picking block
devices explicitly that require device symlinks.
* A new (currently still internal) API sd-device.h has been

33
README
View File

@ -14,7 +14,7 @@ MAILING LIST:
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
IRC:
#systemd on irc.freenode.org
#systemd on irc.libera.chat
BUG REPORTS:
https://github.com/systemd/systemd/issues
@ -35,6 +35,10 @@ LICENSE:
REQUIREMENTS:
Linux kernel >= 3.13
Linux kernel >= 4.2 for unified cgroup hierarchy support
Linux kernel >= 4.10 for cgroup-bpf egress and ingress hooks
Linux kernel >= 4.15 for cgroup-bpf device hook
Linux kernel >= 4.17 for cgroup-bpf socket address hooks
Linux kernel >= 5.3 for bounded-loops in BPF program
Linux kernel >= 5.4 for signed Verity images support
Kernel Config Options:
@ -81,7 +85,7 @@ REQUIREMENTS:
Optional but strongly recommended:
CONFIG_IPV6
CONFIG_AUTOFS4_FS
CONFIG_AUTOFS_FS
CONFIG_TMPFS_XATTR
CONFIG_{TMPFS,EXT4_FS,XFS,BTRFS_FS,...}_POSIX_ACL
CONFIG_SECCOMP
@ -95,8 +99,20 @@ REQUIREMENTS:
Required for CPUQuota= in resource control unit settings
CONFIG_CFS_BANDWIDTH
Required for IPAddressDeny= and IPAddressAllow= in resource control
Required for IPAddressDeny=, IPAddressAllow=, IPIngressFilterPath=,
IPEgressFilterPath= in resource control unit settings
unit settings
CONFIG_BPF
CONFIG_BPF_SYSCALL
CONFIG_BPF_JIT
CONFIG_HAVE_EBPF_JIT
CONFIG_CGROUP_BPF
Required for SocketBind{Allow|Deny}= in resource control unit settings
CONFIG_BPF
CONFIG_BPF_SYSCALL
CONFIG_BPF_JIT
CONFIG_HAVE_EBPF_JIT
CONFIG_CGROUP_BPF
For UEFI systems:
@ -154,6 +170,7 @@ REQUIREMENTS:
libcryptsetup (optional), >= 2.3.0 required for signed Verity images support
libaudit (optional)
libacl (optional)
libbpf >= 0.2.0 (optional)
libfdisk >= 2.33 (from util-linux) (optional)
libselinux (optional)
liblzma (optional)
@ -173,11 +190,14 @@ REQUIREMENTS:
gperf
docbook-xsl (optional, required for documentation)
xsltproc (optional, required for documentation)
python-jinja2
python-lxml (optional, required to build the indices)
python >= 3.5
meson >= 0.46 (>= 0.49 is required to build position-independent executables)
ninja
gcc, awk, sed, grep, m4, and similar tools
gcc, awk, sed, grep, and similar tools
clang >= 10.0, llvm >= 10.0 (optional, required to build BPF programs
from source code in C)
During runtime, you need the following additional
dependencies:
@ -337,8 +357,3 @@ STABLE BRANCHES AND BACKPORTS:
distribution maintainers on an as needed basis. See
https://www.freedesktop.org/wiki/Software/systemd/Backports/ for some
more information and examples.
ENGINEERING AND CONSULTING SERVICES:
Kinvolk (https://kinvolk.io) offers professional engineering
and consulting services for systemd. Please contact Chris Kühl
<chris@kinvolk.io> for more information.

View File

@ -26,12 +26,14 @@ Information about build requirements is provided in the [README file](README).
Consult our [NEWS file](NEWS) for information about what's new in the most recent systemd versions.
Please see the [Code Map](docs/ARCHITECTURE.md) for information about this repository's layout and content.
Please see the [Hacking guide](docs/HACKING.md) for information on how to hack on systemd and test your modifications.
Please see our [Contribution Guidelines](docs/CONTRIBUTING.md) for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our [Coding Style Guidelines](docs/CODING_STYLE.md).
If you are looking for support, please contact our [mailing list](https://lists.freedesktop.org/mailman/listinfo/systemd-devel) or join our [IRC channel](irc://irc.freenode.org/%23systemd).
If you are looking for support, please contact our [mailing list](https://lists.freedesktop.org/mailman/listinfo/systemd-devel) or join our [IRC channel](irc://irc.libera.chat/%23systemd).
Stable branches with backported patches are available in the [stable repo](https://github.com/systemd/systemd-stable).

152
TODO
View File

@ -7,6 +7,12 @@ Bugfixes:
* userdbctl: "Password OK: yes" is shown even when there are no passwords
or the password is locked.
* Get rid of nftw(). We should refuse to use such useless APIs on principle.
* Jun 01 09:43:02 krowka systemd[1]: Unit user@1000.service has alias user@.service.
Jun 01 09:43:02 krowka systemd[1]: Unit user@6.service has alias user@.service.
Jun 01 09:43:02 krowka systemd[1]: Unit user-runtime-dir@6.service has alias user-runtime-dir@.service.
External:
* Fedora: add an rpmlint check that verifies that all unit files in the RPM are listed in %systemd_post macros.
@ -20,6 +26,84 @@ Janitorial Clean-ups:
Features:
* firstboot: allow provisioning of /etc/hosts entries, so that we can via the
credentials logic insert host name to resolve into containers/hosts. Usecase:
fork a container, and make it ping some specific address which is defined by
the host on invocation
* in sd-id128: also parse UUIDs in RFC4122 URN syntax (i.e. chop off urn:uuid: prefix)
* ability to insert trusted configuration and secrets into the boot parameters
of a kernel booting in a VM or on baremetal some way, via TPM
protection. idea:
1. pass via /proc/bootconfig
2. for secrets: put secrets in node of /proc/bootconfig, decrypt them via
TPM early on in PID 1, put them in $CREDENTIAL_PATH logic
3. for config: put signed data in node /proc/booconfig, validate via TPM
early on in PID 1, put data into /run/bootconfig/ as individual files
4. boot loader/stub should pick these up automatically from the boot loader
file systems
* journald: support RFC3164 fully for the incoming syslog transport, see
https://github.com/systemd/systemd/issues/19251#issuecomment-816601955
* homed: if kernel 5.12 uid mapping mounts exist, use that instead of recursive
chowns.
* DynamicUser= + StateDirectory= → use uid mapping mounts, too, in order to
make dirs appear under right UID.
* nspawn: make --bind= work sanely with --private-users when uid mapping mounts
are used.
* systemd-sysext: optionally, run it in initrd already, before transitioning
into host, to open up possibility for services shipped like that.
* add a new switch --auto-definitions=yes/no or so to systemd-repart. If
specified, synthesize a definition automatically if we can: enlarge last
partition on disk, but only if it is marked for growing and not read-only.
* add a switch to homectl (maybe called --first-boot) where it will check if
any non-system users exist, and if not prompts interactively for basic user
info, mimicking systemd-firstboot. Then, place this in a service that runs
after systemd-homed, but before gdm and friends, as a simple, barebones
fallback logic to get a regular user created on uninitialized systems.
* maybe add a tool that displays most recent journal logs as QR code to scan
off screen and run it automatically on boot failures, emergency logs and
such. Use DRM APIs directly, see
https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset.c for an example
for doing that.
* pass systemd-detect-virt result to generators as env var. Modifying behaviour
based on whether we are virtualized or not is a pretty common thing, hence
maybe just pass that info along for free in an env var. We cache the result
anyway, so it's basically free.
* systemd-repart: read LUKS encryption key from $CREDENTIALS_PATH
* introduce /dev/disk/root/* symlinks that allow referencing partitions on the
disk the rootfs is on in a reasonably secure way. (or maybe: add
/dev/gpt-auto-{home,srv,boot,…} similar in style to /dev/gpt-auto-root as we
already have it.
* systemd-repart: add a switch to factory reset the partition table without
immediately applying the new configuration again. i.e. --factory-reset=leave
or so. (this is useful to factory reset an image, then putting it into
another machine, ensuring that luks key is generated on new machine, not old)
* systemd-repart: support setting up dm-integrity with HMAC
* systemd-repart: maybe remove half-initialized image on failure. It fails
if the output file exists, so a repeated invocation will usually fail if
something goes wrong on the way.
* systemd-repart: drop pager mode on normal operation?
* move logind udev rules to top-level rule.d/ directory
* move multiseat vid/pid matches from logind udev rule to hwdb
* whenever we receive fds via SCM_RIGHTS make sure none got dropped due to the
reception limit the kernel silently enforces.
@ -133,22 +217,9 @@ Features:
* systemd-analyze netif that explains predictable interface (or networkctl)
* port selinux code from mallinfo() to mallinfo2() once added to glibc
* Add service setting to run a service within the specified VRF. i.e. do the
equivalent of "ip vrf exec".
* export action of device object on sd-device, so that monitor becomes useful
* add root=tmpfs that mounts a tmpfs to /sysroot (to be used in combination
with usr=…, for a similar effect as systemd.volatile=yes but without the
"hide-out" effect). Also, add root=gpt-auto-late support or so, that is like
root=gpt-auto but initially mounts a tmpfs to /sysroot, and then revisits
later after systemd-repart ran. Usecase: let's ship images with only /usr
partition, then on first boot create the root partition. In this case we want
to read the repart data from /usr before the root partition exists. Add
usr=gpt-auto that automatically finds a /usr partition.
* change SwitchRoot() implementation in PID 1 to use pivot_root(".", "."), as
documented in the pivot_root(2) man page, so that we can drop the /oldroot
temporary dir.
@ -159,15 +230,11 @@ Features:
* homed: keep an fd to the homedir open at all times, to keep the fs pinned
(autofs and such) while user is logged in.
* nss-systemd: also synthesize shadow records for users/groups
* make use of new glibc 2.32 APIs sigabbrev_np() and strerrorname_np().
* when main nspawn supervisor process gets suspended due to SIGSTOP/SIGTTOU or
so, freeze the payload too.
* repart: support setting up dm-integrity with HMAC
* add /etc/integritytab, to support dm-integrity setups. In particular those
with HMAC as hash function, so that we can have a protected /home without
encryption (leaving encryption to the individual dirs/homed).
@ -275,15 +342,6 @@ Features:
* busctl: maybe expose a verb "ping" for pinging a dbus service to see if it
exists and responds.
* when systemd-nspawn and suchlike dissect an OS image, and there are multiple
root partitions, do an strverscmp() on the partition label and boot
first. That is inspired how sd-boot figures out which kernel to boot, and
thus allows defining OS images which can be A/B updated and we default to the
newest version automatically, both in nspawn and in sd-boot
* systemd-gpt-auto should probably set x-systemd.growfs on the mounts it
creates
* bootctl:
- teach it to prepare an ESP wholesale, i.e. with mkfs.vfat invocation
- teach it to copy in unified kernel images and maybe type #1 boot loader spec entries from host
@ -334,8 +392,6 @@ Features:
* systemd-repart: allow sizing partitions as factor of available RAM, so that
we can reasonably size swap partitions for hibernation.
* systemd-repart: allow managing the gpt read-only partition flag + auto-mount flag
* systemd-repart: allow boolean option that ensures that if existing partition
doesn't exist within the configured size bounds the whole command fails. This
is useful to implement ESP vs. XBOOTLDR schemes in installers: have one set
@ -386,9 +442,6 @@ Features:
shouldn't operate in a volatile mode unless we got told so from a trusted
source.
* figure out automatic partition discovery when combining writable root dir
with immutable /usr
* coredump: maybe when coredumping read a new xattr from /proc/$PID/exe that
may be used to mark a whole binary as non-coredumpable. Would fix:
https://bugs.freedesktop.org/show_bug.cgi?id=69447
@ -509,10 +562,6 @@ Features:
a seccomp option we don't have to set NNP. For that, change uid first whil
keeping CAP_SYS_ADMIN, then apply seccomp, the drop cap.
* add a concept for automatically loading per-unit secrets off disk and
inserting them into the kernel keyring. Maybe SecretsDirectory= similar to
ConfigurationDirectory=.
* when no locale is configured, default to UEFI's PlatformLang variable
* bootctl,sd-boot: actually honour the "architecture" key
@ -565,13 +614,6 @@ Features:
output of "systemctl list-units" slightly by showing the tree structure of
the slices, and the units attached to them.
* the a-posteriori stopping of units bound to units that disappeared logic
should be reworked: there should be a queue of units, and we should only
enqueue stop jobs from a defer event that processes queue instead of
right-away when we find a unit that is bound to one that doesn't exist
anymore. (similar to how the stop-unneeded queue has been reworked the same
way)
* nspawn: make nspawn suitable for shell pipelines: instead of triggering a
hangup when input is finished, send ^D, which synthesizes an EOF. Then wait
for hangup or ^D before passing on the EOF.
@ -599,8 +641,6 @@ Features:
* add support for "portablectl attach http://foobar.com/waaa.raw (i.e. importd integration)
* add attach --enable and attach --now (for attach+enable+start)
* sync dynamic uids/gids between host+portable srvice (i.e. if DynamicUser=1 is set for a service, make sure that the
selected user is resolvable in the service even if it ships its own /etc/passwd)
@ -643,9 +683,6 @@ Features:
* add proper dbus APIs for the various sd_notify() commands, such as MAINPID=1
and so on, which would mean we could report errors and such.
* teach tmpfiles.d q/Q logic something sensible in the context of XFS/ext4
project quota
* introduce DefaultSlice= or so in system.conf that allows changing where we
place our units by default, i.e. change system.slice to something
else. Similar, ManagerSlice= should exist so that PID1's own scope unit could
@ -762,10 +799,6 @@ Features:
"systemd-gdb" for attaching to the start-up of any system service in its
natural habitat.
* gpt-auto logic: related to the above, maybe support a "secondary" root
partition, that is mounted to / and is writable, and where the actual root's
/usr is mounted into.
* gpt-auto logic: support encrypted swap, add kernel cmdline option to force it, and honour a gpt bit about it, plus maybe a configuration file
* drop nss-myhostname in favour of nss-resolve?
@ -798,13 +831,13 @@ Features:
on PID 1 with the relevant signals, and makes relevant files in /sys and
/proc (such as the sysrq stuff) unavailable
* Support ReadWritePaths/ReadOnlyPaths/InaccessiblePaths in systemd --user instances
via the new unprivileged Landlock LSM (https://landlock.io)
* make sure the ratelimit object can deal with USEC_INFINITY as way to turn off things
* journalctl: make sure -f ends when the container indicated by -M terminates
* mount: automatically search for "main" partition of an image has multiple
partitions
* in nss-systemd, if we run inside of RootDirectory= with PrivateUsers= set,
find a way to map the User=/Group= of the service to the right name. This way
a user/group for a service only has to exist on the host for the right
@ -852,6 +885,10 @@ Features:
* fstab-generator: default to tmpfs-as-root if only usr= is specified on the kernel cmdline
* initrd-parse-etc.service: can we skip daemon-reload if /sysroot/etc/fstab is missing?
Note that we start initrd-fs.target and initrd-cleanup.target there, so a straightforward
ConditionPathExists= is not enough.
* docs: bring http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime up to date
* add a job mode that will fail if a transaction would mean stopping
@ -890,8 +927,6 @@ Features:
* firstboot: make it useful to be run immediately after yum --installroot to set up a machine. (most specifically, make --copy-root-password work even if /etc/passwd already exists
* maybe add support for specifier expansion in user.conf, specifically DefaultEnvironment=
* maybe allow timer units with an empty Units= setting, so that they
can be used for resuming the system but nothing else.
@ -1005,8 +1040,6 @@ Features:
here:
http://blog.vmsplice.net/2020/07/rethinking-event-loop-integration-for.html
* investigate endianness issues of UUID vs. GUID
* dbus: when a unit failed to load (i.e. is in UNIT_ERROR state), we
should be able to safely try another attempt when the bus call LoadUnit() is invoked.
@ -1273,6 +1306,8 @@ Features:
should not follow symlinks. None of the other adjustment or creation
calls follow symlinks.
- add --test mode
- teach tmpfiles.d q/Q logic something sensible in the context of XFS/ext4
project quota
* make sure systemd-ask-password-wall does not shutdown systemd-ask-password-console too early
@ -1342,7 +1377,6 @@ Features:
https://bugzilla.redhat.com/show_bug.cgi?id=723942
- allow writing multiple conditions in unit files on one line
- introduce Type=pid-file
- introduce mix of BindTo and Requisite
- add a concept of RemainAfterExit= to scope units
- Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely
- add verification of [Install] section to systemd-analyze verify

View File

@ -30,5 +30,4 @@ foreach file : in_files
endforeach
meson.add_install_script('sh', '-c',
'test -n "$DESTDIR" || @0@/journalctl --update-catalog'
.format(rootbindir))
'test -n "$DESTDIR" || @0@/journalctl --update-catalog'.format(rootbindir))

View File

@ -8,7 +8,8 @@ position p : script:python() {
p[0].current_element == "log_set_max_level_realm" or
p[0].current_element == "unichar_is_valid")
};
expression x, y;
expression x;
constant y;
@@
(
- ((x@p) & (y)) == (y)

View File

@ -7,6 +7,7 @@ EXCLUDED_PATHS=(
"src/basic/linux/*"
# Symlinked to test-bus-vtable-cc.cc, which causes issues with the IN_SET macro
"src/libsystemd/sd-bus/test-bus-vtable.c"
"src/libsystemd/sd-journal/lookup3.c"
)
top="$(git rev-parse --show-toplevel)"

View File

@ -1,6 +1,7 @@
@@
position p : script:python() { p[0].current_element != "test_strjoina" };
expression n, m;
expression list s;
@@
- n = strjoina(m, s, NULL);
- n = strjoina@p(m, s, NULL);
+ n = strjoina(m, s);

3
docs/.gitignore vendored
View File

@ -1 +1,2 @@
_site
/_site/
/.jekyll-cache/

121
docs/ARCHITECTURE.md Normal file
View File

@ -0,0 +1,121 @@
---
title: systemd Repository Architecture
category: Contributing
layout: default
---
# Code Map
This section will attempt to provide a high-level overview of the various
components of the systemd repository.
# Source Code
Directories in `src/` provide the implementation of all daemons, libraries and
command-line tools shipped by the project. There are many, and more are
constantly added, so we will not enumerate them all here — the directory
names are self-explanatory.
## Shared Code
You might wonder what kind of common code belongs in `src/shared/` and what
belongs in `src/basic/`. The split is like this: anything that is used to
implement the public shared objects we provide (`sd-bus`, `sd-login`,
`sd-id128`, `nss-systemd`, `nss-mymachines`, `nss-resolve`, `nss-myhostname`,
`pam_systemd`), must be located in `src/basic` (those objects are not allowed
to link to `libsystemd-shared.so`). Conversely, anything which is shared
between multiple components and does not need to be in `src/basic/`, should be
in `src/shared/`.
To summarize:
`src/basic/`
- may be used by all code in the tree
- may not use any code outside of `src/basic/`
`src/libsystemd/`
- may be used by all code in the tree, except for code in `src/basic/`
- may not use any code outside of `src/basic/`, `src/libsystemd/`
`src/shared/`
- may be used by all code in the tree, except for code in `src/basic/`,
`src/libsystemd/`, `src/nss-*`, `src/login/pam_systemd.*`, and files under
`src/journal/` that end up in `libjournal-client.a` convenience library.
- may not use any code outside of `src/basic/`, `src/libsystemd/`, `src/shared/`
## PID 1
Code located in `src/core/` implements the main logic of the systemd system (and user)
service manager.
BPF helpers written in C and used by PID 1 can be found under `src/core/bpf/`.
## UDEV
Sources for the udev daemon and command-line tool (single binary) can be found under
`src/udev/`.
## Unit Tests
Source files found under `src/test/` implement unit-level testing, mostly for
modules found in `src/basic/` and `src/shared/`, but not exclusively. Each test
file is compiled in a standalone binary that can be run to exercise the
corresponding module. While most of the tests can be ran by any user, some
require privileges, and will attempt to clearly log about what they need
(mostly in the form of effective capabilities). These tests are self-contained,
and generally safe to run on the host without side effects.
Ideally, every module in `src/basic/` and `src/shared/` should have a
corresponding unit test under `src/test/`, exercising every helper function.
# Integration Tests
Sources in `test/` implement system-level testing for executables, libraries and
daemons that are shipped by the project. They require privileges to run, and
are not safe to execute directly on a host. By default they will build an image
and run the test under it via `QEMU` or `systemd-nspawn`.
Most of those tests should be able to run via `systemd-nspawn`, which is orders of
magnitude faster than `QEMU`, but some tests require privileged operations like
using `dm-crypt` or `loopdev`. They are clearly marked if that is the case.
See `test/README.testsuite` for more specific details.
# HWDB
Rules built in the static `HWDB` database shipped by the project can be found
under `hwdb.d/`. Some of these files are updated automatically, some are filled
by contributors.
# Documentation
## systemd.io
Markdown files found under `docs/` are automatically published on the
[systemd.io](https://systemd.io) website using Github Pages. A minimal unit test
to ensure the formatting doesn't have errors is included in the
`meson test -C build/ github-pages` run as part of the CI.
## MAN pages
Manpages for binaries and libraries, and the DBUS interfaces, can be found under
`man/` and should ideally be kept in sync with changes to the corresponding
binaries and libraries.
## Translations
Translations files for binaries and daemons, provided by volunteers, can be found
under `po/` in the usual format. They are kept up to date by contributors and by
automated tools.
# System Configuration files and presets
Presets (or templates from which they are generated) for various daemons and tools
can be found under various directories such as `factory/`, `modprobe.d/`, `network/`,
`presets/`, `rules.d/`, `shell-completion/`, `sysctl.d/`, `sysusers.d/`, `tmpfiles.d/`.
# Utilities for Developers
`tools/`, `coccinelle/`, `.github/`, `.semaphore/`, `.lgtm/`, `.mkosi/` host various
utilities and scripts that are used by maintainers and developers. They are not
shipped or installed.

View File

@ -130,7 +130,7 @@ names for them in UIs.
discovered Windows installation might have the identifier `auto-windows` or
`auto-windows-10` or so.).
4. Similar, boot menu entries referring to Apple MacOS X installations should
4. Similar, boot menu entries referring to Apple macOS installations should
use the identifier `osx` or one that is prefixed with `osx-`. If such an
entry is automatically discovered by the boot loader use `auto-osx` as
identifier, or `auto-osx-` as prefix for the identifier, see above.

View File

@ -208,9 +208,9 @@ On EFI, any such images shall be added to the list of valid boot entries.
Note that these configurations snippets do not need to be the only configuration source for a boot loader. It may extend this list of entries with additional items from other configuration files (for example its own native configuration files) or automatically detected other entries without explicit configuration.
To make this explicitly clear: this specification is designed with "free" operating systems in mind, starting Windows or MacOS is out of focus with these configuration snippets, use boot-loader specific solutions for that. In the text above, if we say "OS" we hence imply "free", i.e. primarily Linux (though this could be easily be extended to the BSDs and whatnot).
To make this explicitly clear: this specification is designed with "free" operating systems in mind, starting Windows or macOS is out of focus with these configuration snippets, use boot-loader specific solutions for that. In the text above, if we say "OS" we hence imply "free", i.e. primarily Linux (though this could be easily be extended to the BSDs and whatnot).
Note that all paths used in the configuration snippets use a Unix-style "/" as path separator. This needs to be converted to an EFI-style "\" separator in EFI boot loaders.
Note that all paths used in the configuration snippets use a Unix-style "/" as path separator. This needs to be converted to an EFI-style "\\" separator in EFI boot loaders.
## Logic

View File

@ -131,7 +131,7 @@ If you wonder how to detect which of these three modes is currently used, use
you are either in legacy or hybrid mode. To distinguish these two cases, run
`statfs()` again on `/sys/fs/cgroup/unified/`. If that succeeds and reports
`CGROUP2_SUPER_MAGIC` you are in hybrid mode, otherwise not.
From a shell, you can use check the `Type` in `stat -f /sys/fs/cgroup` and
From a shell, you can check the `Type` in `stat -f /sys/fs/cgroup` and
`stat -f /sys/fs/cgroup/unified`.
## systemd's Unit Types
@ -224,7 +224,7 @@ guarantees:
cgroups below it. Note however that systemd will do that only in the unified
hierarchy (in unified and hybrid mode) as well as on systemd's own private
hierarchy (in legacy and hybrid mode). It won't pass ownership of the legacy
controller hierarchies. Delegation to less privileges processes is not safe
controller hierarchies. Delegation to less privileged processes is not safe
in cgroup v1 (as a limitation of the kernel), hence systemd won't facilitate
access to it.
@ -243,7 +243,7 @@ delegated.
Let's stress one thing: delegation is available on scope and service units
only. It's expressly not available on slice units. Why? Because slice units are
our *inner* nodes of the cgroup trees and we freely attach service and scopes
our *inner* nodes of the cgroup trees and we freely attach services and scopes
to them. If we'd allow delegation on slice units then this would mean that
both systemd and your own manager would create/delete cgroups below the slice
unit and that conflicts with the single-writer rule.

View File

@ -69,6 +69,14 @@ layout: default
```
- Do not write `foo ()`, write `foo()`.
- `else` blocks should generally start on the same line as the closing `}`:
```c
if (foobar) {
find();
waldo();
} else
dont_find_waldo();
```
## Code Organization and Semantics
@ -135,31 +143,6 @@ layout: default
global in global variables, for example data parsed from command lines, see
below.
- You might wonder what kind of common code belongs in `src/shared/` and what
belongs in `src/basic/`. The split is like this: anything that is used to
implement the public shared object we provide (sd-bus, sd-login, sd-id128,
nss-systemd, nss-mymachines, nss-resolve, nss-myhostname, pam_systemd), must
be located in `src/basic` (those objects are not allowed to link to
libsystemd-shared.so). Conversely, anything which is shared between multiple
components and does not need to be in `src/basic/`, should be in
`src/shared/`.
To summarize:
`src/basic/`
- may be used by all code in the tree
- may not use any code outside of `src/basic/`
`src/libsystemd/`
- may be used by all code in the tree, except for code in `src/basic/`
- may not use any code outside of `src/basic/`, `src/libsystemd/`
`src/shared/`
- may be used by all code in the tree, except for code in `src/basic/`,
`src/libsystemd/`, `src/nss-*`, `src/login/pam_systemd.*`, and files under
`src/journal/` that end up in `libjournal-client.a` convenience library.
- may not use any code outside of `src/basic/`, `src/libsystemd/`, `src/shared/`
- Our focus is on the GNU libc (glibc), not any other libcs. If other libcs are
incompatible with glibc it's on them. However, if there are equivalent POSIX
and Linux/GNU-specific APIs, we generally prefer the POSIX APIs. If there
@ -168,18 +151,37 @@ layout: default
## Using C Constructs
- Preferably allocate local variables on the top of the block:
- Allocate local variables where it makes sense: at the top of the block, or at
the point where they can be initialized. `r` is typically used for a local
state variable, but should almost always be declared at the top of the
function.
```c
{
int a, b;
uint64_t a, b;
int r;
a = 5;
b = a;
a = frobnicate();
b = a + 5;
r = do_something();
if (r < 0)
}
```
- Do not mix function invocations with variable definitions in one line. Wrong:
- Do not mix function invocations with variable definitions in one line.
```c
{
uint64_t x = 7;
int a;
a = foobar();
}
```
instead of:
```c
{
@ -188,18 +190,7 @@ layout: default
}
```
Right:
```c
{
int a;
uint64_t x = 7;
a = foobar();
}
```
- Use `goto` for cleaning up, and only use it for that. i.e. you may only jump
- Use `goto` for cleaning up, and only use it for that. I.e. you may only jump
to the end of a function, and little else. Never jump backwards!
- To minimize strict aliasing violations, we prefer unions over casting.
@ -372,8 +363,7 @@ layout: default
`log_oom()` for then printing a short message, but not in "library" code.
- Avoid fixed-size string buffers, unless you really know the maximum size and
that maximum size is small. They are a source of errors, since they possibly
result in truncated strings. It is often nicer to use dynamic memory,
that maximum size is small. It is often nicer to use dynamic memory,
`alloca()` or VLAs. If you do allocate fixed-size strings on the stack, then
it is probably only OK if you either use a maximum size such as `LINE_MAX`,
or count in detail the maximum size a string can have. (`DECIMAL_STR_MAX` and
@ -429,7 +419,7 @@ layout: default
limits after which it will refuse operation. It's fine if it is hard-coded
(at least initially), but it needs to be there. This is particularly
important for objects that unprivileged users may allocate, but also matters
for everything else any user may allocated.
for everything else any user may allocate.
## Types
@ -464,7 +454,7 @@ layout: default
- Use the bool type for booleans, not integers. One exception: in public
headers (i.e those in `src/systemd/sd-*.h`) use integers after all, as `bool`
is C99 and in our public APIs we try to stick to C89 (with a few extension).
is C99 and in our public APIs we try to stick to C89 (with a few extensions).
## Deadlocks
@ -581,12 +571,18 @@ layout: default
process, please use `_exit()` instead of `exit()`, so that the exit handlers
are not run.
- We never use the POSIX version of `basename()` (which glibc defines it in
- We never use the POSIX version of `basename()` (which glibc defines in
`libgen.h`), only the GNU version (which glibc defines in `string.h`). The
only reason to include `libgen.h` is because `dirname()` is needed. Every
time you need that please immediately undefine `basename()`, and add a
comment about it, so that no code ever ends up using the POSIX version!
- Never use `FILENAME_MAX`. Use `PATH_MAX` instead (for checking maximum size
of paths) and `NAME_MAX` (for checking maximum size of filenames).
`FILENAME_MAX` is not POSIX, and is a confusingly named alias for `PATH_MAX`
on Linux. Note that `NAME_MAX` does not include space for a trailing `NUL`,
but `PATH_MAX` does. UNIX FTW!
## Committing to git
- Commit message subject lines should be prefixed with an appropriate component

View File

@ -140,7 +140,7 @@ manager, please consider supporting the following interfaces.
`$CREDENTIALS_DIRECTORY` environment variable. If the container managers
does this, the credentials passed to the service manager can be propagated
to services via `LoadCredential=` (see ...). The container manager can
choose any path, but `/run/host/credentials` is recommended."
choose any path, but `/run/host/credentials` is recommended.
## Advanced Integration
@ -329,6 +329,19 @@ care should be taken to avoid naming conflicts. `systemd` (and in particular
sub-directories of `/sys/` writable, but make sure to leave the root of
`/sys/` read-only.)
8. Do not pass the `CAP_AUDIT_CONTROL`, `CAP_AUDIT_READ`, `CAP_AUDIT_WRITE`
capabilities to the container, in particular not to those making use of user
namespaces. The kernel's audit subsystem is still not virtualized for
containers, and passing these credentials is pointless hence, given the
actual attempt to make use of the audit subsystem will fail. Note that
systemd's audit support is partially conditioned on these capabilities, thus
by dropping them you ensure that you get an entirely clean boot, as systemd
will make no attempt to use it. If you pass the capabilities to the payload
systemd will assume that audit is available and works, and some components
will subsequently fail in various ways. Note that once the kernel learnt
native support for container-virtualized audit, adding the capability to the
container description will automatically make the container payload use it.
## Fully Unprivileged Container Payload
First things first, to make this clear: Linux containers are not a security

View File

@ -0,0 +1,125 @@
---
title: Package Metadata for Core Files
category: Interfaces
layout: default
---
# Package Metadata for Core Files
*Intended audience: hackers working on userspace subsystems that create ELF binaries
or parse ELF core files.*
## Motivation
ELF binaries get stamped with a unique, build-time generated hex string identifier called
`build-id`, [which gets embedded as an ELF note called `.note.gnu.build-id`](https://fedoraproject.org/wiki/Releases/FeatureBuildId).
In most cases, this allows to associate a stripped binary with its debugging information.
It is used, for example, to dynamically fetch DWARF symbols from a debuginfo server, or
to query the local package manager and find out the package metadata or, again, the DWARF
symbols or program sources.
However, this usage of the `build-id` requires either local metadata, usually set up by
the package manager, or access to a remote server over the network. Both of those might
be unavailable or forbidden.
Thus it becomes desirable to add additional metadata to a binary at build time, so that
`systemd-coredump` and other services analyzing core files are able to extract said
metadata simply from the core file itself, without external dependencies.
## Implementation
This document will attempt to define a common metadata format specification, so that
multiple implementers might use it when building packages, or core file analyzers, and
so on.
The metadata will be embedded in a single, new ELF header section, in a key-value JSON
format. Implementers working on parsing core files should not assume a specific list of
keys, but parse anything that is included in the section.
Implementers working on build tools should strive to use the same key names, for
consistency. The most common will be listed here. When corresponding to the content of
os-release, the values should match, again for consistency.
If available, the metadata should also include the debuginfod server URL that can provide
the original executable, debuginfo and sources, to further facilitate debugging.
* Section header
```
SECTION: `.note.package`
node-id: `0xcafe1a7e`
Owner: `FDO` (FreeDesktop.org)
Value: a JSON string with the structure described below
```
* JSON payload
```json
{
"type":"rpm", # this provides a namespace for the package+package-version fields
"os":"fedora",
"osVersion":"33",
"name":"coreutils",
"version": "4711.0815.fc13.arm32",
"osCpe": "cpe:/o:fedoraproject:fedora:33", # A CPE name for the operating system, `CPE_NAME` from os-release is a good default
"debugInfoUrl": "https://debuginfod.fedoraproject.org/"
}
```
A reference implementations of a [build-time tool is provided](https://github.com/systemd/package-notes)
and can be used to generate a linker script, which can then be used at build time via
```LDFLAGS="-Wl,-T,/path/to/generated/script"``` to include the note in the binary.
Generator:
```console
$ ./generate-package-notes.py --rpm systemd-248~rc2-1.fc34
SECTIONS
{
.note.package : ALIGN(4) {
BYTE(0x04) BYTE(0x00) BYTE(0x00) BYTE(0x00) /* Length of Owner including NUL */
BYTE(0x64) BYTE(0x00) BYTE(0x00) BYTE(0x00) /* Length of Value including NUL */
BYTE(0x7e) BYTE(0x1a) BYTE(0xfe) BYTE(0xca) /* Note ID */
BYTE(0x46) BYTE(0x44) BYTE(0x4f) BYTE(0x00) /* Owner: 'FDO\x00' */
BYTE(0x7b) BYTE(0x22) BYTE(0x74) BYTE(0x79) /* Value: '{"type":"rpm","name":"systemd","version":"248~rc2-1.fc34","osCpe":"cpe:/o:fedoraproject:fedora:33"}\x00' */
BYTE(0x70) BYTE(0x65) BYTE(0x22) BYTE(0x3a)
BYTE(0x22) BYTE(0x72) BYTE(0x70) BYTE(0x6d)
BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x6e)
BYTE(0x61) BYTE(0x6d) BYTE(0x65) BYTE(0x22)
BYTE(0x3a) BYTE(0x22) BYTE(0x73) BYTE(0x79)
BYTE(0x73) BYTE(0x74) BYTE(0x65) BYTE(0x6d)
BYTE(0x64) BYTE(0x22) BYTE(0x2c) BYTE(0x22)
BYTE(0x76) BYTE(0x65) BYTE(0x72) BYTE(0x73)
BYTE(0x69) BYTE(0x6f) BYTE(0x6e) BYTE(0x22)
BYTE(0x3a) BYTE(0x22) BYTE(0x32) BYTE(0x34)
BYTE(0x38) BYTE(0x7e) BYTE(0x72) BYTE(0x63)
BYTE(0x32) BYTE(0x2d) BYTE(0x31) BYTE(0x2e)
BYTE(0x66) BYTE(0x63) BYTE(0x33) BYTE(0x34)
BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x6f)
BYTE(0x73) BYTE(0x43) BYTE(0x70) BYTE(0x65)
BYTE(0x22) BYTE(0x3a) BYTE(0x22) BYTE(0x63)
BYTE(0x70) BYTE(0x65) BYTE(0x3a) BYTE(0x2f)
BYTE(0x6f) BYTE(0x3a) BYTE(0x66) BYTE(0x65)
BYTE(0x64) BYTE(0x6f) BYTE(0x72) BYTE(0x61)
BYTE(0x70) BYTE(0x72) BYTE(0x6f) BYTE(0x6a)
BYTE(0x65) BYTE(0x63) BYTE(0x74) BYTE(0x3a)
BYTE(0x66) BYTE(0x65) BYTE(0x64) BYTE(0x6f)
BYTE(0x72) BYTE(0x61) BYTE(0x3a) BYTE(0x33)
BYTE(0x33) BYTE(0x22) BYTE(0x7d) BYTE(0x00)
}
}
INSERT AFTER .note.gnu.build-id;
```
## Well-known keys
The metadata format is intentionally left open, so that vendors can add their own information.
A set of well-known keys is defined here, and hopefully shared among all vendors.
| Key name | Key description | Example value |
|--------------|--------------------------------------------------------------------------|---------------------------------------|
| type | The packaging type | rpm |
| os | The OS name, typically corresponding to ID in os-release | fedora |
| osVersion | The OS version, typically corresponding to VERSION_ID in os-release | 33 |
| name | The source package name | coreutils |
| version | The source package version | 4711.0815.fc13.arm32 |
| osCpe | A CPE name for the OS, typically corresponding to CPE_NAME in os-release | cpe:/o:fedoraproject:fedora:33 |
| debugInfoUrl | The debuginfod server url, if available | https://debuginfod.fedoraproject.org/ |

View File

@ -62,7 +62,7 @@ Interface](https://systemd.io/BOOT_LOADER_INTERFACE).
| `4301d2a6-4e3b-4b2a-bb94-9e0b2c4225ea` | _`/usr/` Partition (Itanium/IA-64)_ | ditto | ditto |
| `b933fb22-5c3f-4f91-af90-e2bb0fa50702` | _`/usr/` Partition (RISC-V 32-bit)_ | ditto | ditto |
| `beaec34b-8442-439b-a40b-984381ed097d` | _`/usr/` Partition (RISC-V 64-bit)_ | ditto | ditto |
| `8f461b0d-14ee-4e81-9aa9-049b6fb97abd` | _`/usr/` Verity Partition (x86)_ | Any native, optionally in LUKS | Similar semantics to root Verity partition, but just for the `/usr/` partition. |
| `8f461b0d-14ee-4e81-9aa9-049b6fb97abd` | _`/usr/` Verity Partition (x86)_ | A dm-verity superblock followed by hash data | Similar semantics to root Verity partition, but just for the `/usr/` partition. |
| `77ff5f63-e7b6-4633-acf4-1565b864c0e6` | _`/usr/` Verity Partition (x86-64)_ | ditto | ditto |
| `c215d751-7bcd-4649-be90-6627490a4c05` | _`/usr/` Verity Partition (32-bit ARM)_ | ditto | ditto |
| `6e11a4e7-fbca-4ded-b9e9-e1a512bb664e` | _`/usr/` Verity Partition (64-bit ARM/AArch64)_ | ditto | ditto |
@ -73,10 +73,10 @@ Interface](https://systemd.io/BOOT_LOADER_INTERFACE).
| `3b8f8425-20e0-4f3b-907f-1a25a76f98e8` | _Server Data Partition_ | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/srv/`. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/srv`. |
| `4d21b016-b534-45c2-a9fb-5c16e091fd2d` | _Variable Data Partition_ | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/var/` — under the condition that its partition UUID matches the first 128 bit of `HMAC-SHA256(machine-id, 0x4d21b016b53445c2a9fb5c16e091fd2d)` (i.e. the SHA256 HMAC hash of the binary type UUID keyed by the machine ID as read from [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html). This special requirement is made because `/var/` (unlike the other partition types listed here) is inherently private to a specific installation and cannot possibly be shared between multiple OS installations on the same disk, and thus should be bound to a specific instance of the OS, identified by its machine ID. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/var`. |
| `7ec6f557-3bc5-4aca-b293-16ef5df639d1` | _Temporary Data Partition_ | Any native, optionally in LUKS | The first partition with this type UUID on the disk containing the root partition is automatically mounted to `/var/tmp/`. If the partition is encrypted with LUKS, the device mapper file will be named `/dev/mapper/tmp`. Note that the intended mount point is indeed `/var/tmp/`, not `/tmp/`. The latter is typically maintained in memory via <tt>tmpfs</tt> and does not require a partition on disk. In some cases it might be desirable to make `/tmp/` persistent too, in which case it is recommended to make it a symlink or bind mount to `/var/tmp/`, thus not requiring its own partition type UUID. |
| `0657fd6d-a4ab-43c4-84e5-0933c84b4f4f` | _Swap_ | Swap | All swap partitions on the disk containing the root partition are automatically enabled. |
| `0657fd6d-a4ab-43c4-84e5-0933c84b4f4f` | _Swap_ | Swap | All swap partitions on the disk containing the root partition are automatically enabled. This partition type predates the Discoverable Partitions Specification. |
| `0fc63daf-8483-4772-8e79-3d69d8477de4` | _Generic Linux Data Partitions_ | Any native, optionally in LUKS | No automatic mounting takes place for other Linux data partitions. This partition type should be used for all partitions that carry Linux file systems. The installer needs to mount them explicitly via entries in <tt>/etc/fstab</tt>. Optionally, these partitions may be encrypted with LUKS. This partition type predates the Discoverable Partitions Specification. |
| `c12a7328-f81f-11d2-ba4b-00a0c93ec93b` | _EFI System Partition_ | VFAT | The ESP used for the current boot is automatically mounted to `/efi/` (or `/boot/` as fallback), unless a different partition is mounted there (possibly via `/etc/fstab`, or because the Extended Boot Loader Partition — see below — exists) or the directory is non-empty on the root disk. This partition type is defined by the [UEFI Specification](http://www.uefi.org/specifications). |
| `bc13c2ff-59e6-4262-a352-b275fd6f7172` | _Extended Boot Loader Partition_ | Typically VFAT | The Extended Boot Loader Partition (XBOOTLDR) used for the current boot is automatically mounted to <tt>/boot/</tt>, unless a different partition is mounted there (possibly via <tt>/etc/fstab</tt>) or the directory is non-empty on the root disk. This partition type is defined by the [Boot Loader Specification](https://systemd.io/BOOT_LOADER_SPECIFICATION). |
| `0fc63daf-8483-4772-8e79-3d69d8477de4` | _Other Data Partitions_ | Any native, optionally in LUKS | No automatic mounting takes place for other Linux data partitions. This partition type should be used for all partitions that carry Linux file systems. The installer needs to mount them explicitly via entries in <tt>/etc/fstab</tt>. Optionally, these partitions may be encrypted with LUKS. |
Other GPT type IDs might be used on Linux, for example to mark software RAID or
LVM partitions. The definitions of those GPT types is outside of the scope of
@ -94,24 +94,48 @@ localized.
## Partition Flags
For the root, `/usr/`, server data, home, variable data, temporary data and swap
partitions, the partition flag bit 63 ("*no-auto*") may be used to turn off
auto-discovery for the specific partition. If set, the partition will not be
automatically mounted or enabled.
This specification defines three GPT partition flags that may be set for the
partition types defined above:
For the root, `/usr/`, server data, home, variable data and temporary data
partitions, the partition flag bit 60 ("*read-only*") may be used to mark a
partition for read-only mounts only. If set, the partition will be mounted
read-only instead of read-write. Note that the variable data partition and the
temporary data partition will generally not be able to serve their purpose if
marked read-only, since by their very definition they are supposed to be
mutable. (The home and server data partitions are generally assumed to be
mutable as well, but the requirement for them is not equally strong.) Because
of that, while the read-only flag is defined and supported, it's almost never a
good idea to actually use it for these partitions.
1. For the root, `/usr/`, Verity, home, server data, variable data, temporary data,
swap and extended boot loader partitions, the partition flag bit 63
("*no-auto*") may be used to turn off auto-discovery for the specific
partition. If set, the partition will not be automatically mounted or
enabled.
Note that these two flag definitions happen to map nicely to the ones used by
Microsoft Basic Data Partitions.
2. For the root, `/usr/`, Verity, home, server data, variable data, temporary
data and extended boot loader partitions, the partition flag bit 60
("*read-only*") may be used to mark a partition for read-only mounts only.
If set, the partition will be mounted read-only instead of read-write. Note
that the variable data partition and the temporary data partition will
generally not be able to serve their purpose if marked read-only, since by
their very definition they are supposed to be mutable. (The home and server
data partitions are generally assumed to be mutable as well, but the
requirement for them is not equally strong.) Because of that, while the
read-only flag is defined and supported, it's almost never a good idea to
actually use it for these partitions. Also note that Verity partitions are
by their semantics always read-only. The flag is hence of little effect for
them, and it is recommended to set it unconditionally for the Verity
partition types.
3. For the root, `/usr/`, home, server data, variable data, temporary data and
extended boot loader partitions, the partition flag bit 59
("*grow-file-system*") may be used to mark a partition for automatic growing
of the contained file system to the size of the partition when
mounted. Tools that automatically mount disk image with a GPT partition
table are suggested to implicitly grow the contained file system to the
partition size they are contained in. This flag is without effect on
partitions marked read-only.
Note that the first two flag definitions happen to map nicely to the ones used
by Microsoft Basic Data Partitions.
All three of these flags generally affect only auto-discovery and automatic
mounting of disk images. If partitions marked with these flags are mounted
using low-level commands like
[mount(8)](https://man7.org/linux/man-pages/man2/mount.8.html) or directly with
[mount(2)](https://man7.org/linux/man-pages/man2/mount.2.html), they typically
have no effect.
## Suggested Mode of Operation
@ -162,7 +186,14 @@ partition is listed in `/etc/fstab` or with `root=` on the kernel command line,
it _must_ take precedence over automatically discovered partitions. If a
`/home/`, `/usr/`, `/srv/`, `/boot/`, `/var/`, `/var/tmp/`, `/efi/` or `/boot/`
directory is found to be populated already in the root partition, the automatic
discovery _must not_ mount any discovered file system over it.
discovery _must not_ mount any discovered file system over it. Optionally, in
case of the root, `/usr/` and their Verity partitions instead of strictly
mounting the first suitable partition an OS might choose to mount the partition
whose label compares the highest according to `strverscmp()` or a similar
logic, in order to implement a simple partition-based A/B versioning
scheme. The precise rules are left for the implementation to decide, but when
in doubt earlier partitions (by their index) should always win over later
partitions if the label comparison is inconclusive.
A *container* *manager* should automatically discover and mount the root,
`/usr/`, `/home/`, `/srv/`, `/var/`, `/var/tmp/` partitions inside a container
@ -190,11 +221,11 @@ We are not. `/etc/fstab` always overrides automatic discovery and is indeed
mentioned in the specifications. We are simply trying to make the boot and
installation processes of Linux a bit more robust and self-descriptive.
### Why did you only define the root partition for x86, x86-64, ARM, ARM64, ia64?
### Why did you only define the root partition for x86, x86-64, ARM, ARM64, ia64, riscv32, riscv64?
The automatic discovery of the root partition is defined to operate on the disk
containing the current EFI System Partition (ESP). Since EFI only exists on
x86, x86-64, ia64, and ARM so far, we only defined root partition UUIDs for
x86, x86-64, ia64, ARM and RISC-V so far, we only defined root partition UUIDs for
these architectures. Should EFI become more common on other architectures, we
can define additional UUIDs for them.

View File

@ -198,11 +198,6 @@ All tools:
prefixed with `:` in which case the kernel command line option takes
precedence, if it is specified as well.
installed systemd tests:
* `$SYSTEMD_TEST_DATA` — override the location of test data. This is useful if
a test executable is moved to an arbitrary location.
`nss-systemd`:
* `$SYSTEMD_NSS_BYPASS_SYNTHETIC=1` — if set, `nss-systemd` won't synthesize
@ -288,8 +283,36 @@ installed systemd tests:
`systemd-tmpfiles`:
* `SYSTEMD_TMPFILES_FORCE_SUBVOL` - if unset, `v`/`q`/`Q` lines will create
* `SYSTEMD_TMPFILES_FORCE_SUBVOL` if unset, `v`/`q`/`Q` lines will create
subvolumes only if the OS itself is installed into a subvolume. If set to `1`
(or another value interpreted as true), these lines will always create
subvolumes if the backing filesystem supports them. If set to `0`, these
lines will always create directories.
`systemd-sysv-generator`:
* `$SYSTEMD_SYSVINIT_PATH` — Controls where `systemd-sysv-generator` looks for
SysV init scripts.
* `$SYSTEMD_SYSVRCND_PATH` — Controls where `systemd-sysv-generator` looks for
SysV init script runlevel link farms.
systemd tests:
* `$SYSTEMD_TEST_DATA` — override the location of test data. This is useful if
a test executable is moved to an arbitrary location.
* `$SYSTEMD_TEST_NSS_BUFSIZE` — size of scratch buffers for "reentrant"
functions exported by the nss modules.
fuzzers:
* `$SYSTEMD_FUZZ_OUTPUT` — A boolean that specifies whether to write output to
stdout. Setting to true is useful in manual invocations, since all output is
suppressed by default.
* `$SYSTEMD_FUZZ_RUNS` — The number of times execution should be repeated in
manual invocations.
Note that is may be also useful to set `$SYSTEMD_LOG_LEVEL`, since all logging
is suppressed by default.

View File

@ -10,8 +10,8 @@ We welcome all contributions to systemd. If you notice a bug or a missing
feature, please feel invited to fix it, and submit your work as a GitHub Pull
Request (PR) at https://github.com/systemd/systemd/pull/new.
Please make sure to follow our [Coding Style](CODING_STYLE.md) when submitting patches.
Also have a look at our [Contribution Guidelines](CONTRIBUTING.md).
Please make sure to follow our [Coding Style](CODING_STYLE.md) when submitting
patches. Also have a look at our [Contribution Guidelines](CONTRIBUTING.md).
When adding new functionality, tests should be added. For shared functionality
(in `src/basic/` and `src/shared/`) unit tests should be sufficient. The general
@ -22,8 +22,8 @@ test executable. For features at a higher level, tests in `src/test/` are very
strongly recommended. If that is not possible, integration tests in `test/` are
encouraged.
Please also have a look at our list of [code quality tools](CODE_QUALITY.md) we have setup for systemd,
to ensure our codebase stays in good shape.
Please also have a look at our list of [code quality tools](CODE_QUALITY.md) we
have setup for systemd, to ensure our codebase stays in good shape.
Please always test your work before submitting a PR. For many of the components
of systemd testing is straight-forward as you can simply compile systemd and
@ -36,12 +36,12 @@ building clean OS images from an upstream distribution in combination with a
fresh build of the project in the local working directory. To make use of this,
please acquire `mkosi` from https://github.com/systemd/mkosi first, unless your
distribution has packaged it already and you can get it from there. After the
tool is installed, symlink the settings file for your distribution of choice from
.mkosi/ to mkosi.default in the project root directory (note that the package
manager for this distro needs to be installed on your host system). After doing
that, it is sufficient to type `mkosi` in the systemd project directory to
generate a disk image `image.raw` you can boot either in `systemd-nspawn` or in
an UEFI-capable VM:
tool is installed, symlink the settings file for your distribution of choice
from .mkosi/ to mkosi.default in the project root directory (note that the
package manager for this distro needs to be installed on your host system).
After doing that, it is sufficient to type `mkosi` in the systemd project
directory to generate a disk image `image.raw` you can boot either in
`systemd-nspawn` or in an UEFI-capable VM:
```
# mkosi boot
@ -106,13 +106,34 @@ And after that, head over to your repo on GitHub and click "Compare & pull reque
Happy hacking!
## Templating engines in .in files
Some source files are generated during build. We use two templating engines:
* meson's `configure_file()` directive uses syntax with `@VARIABLE@`.
See the
[Meson docs for `configure_file()`](https://mesonbuild.com/Reference-manual.html#configure_file)
for details.
{% raw %}
* most files are rendered using jinja2, with `{{VARIABLE}}` and `{% if … %}`,
`{% elif … %}`, `{% else … %}`, `{% endif … %}` blocks. `{# … #}` is a
jinja2 comment, i.e. that block will not be visible in the rendered
output. `{% raw %} … `{% endraw %}`{{ '{' }}{{ '% endraw %' }}}` creates a block
where jinja2 syntax is not interpreted.
See the
[Jinja Template Designer Documentation](https://jinja2docs.readthedocs.io/en/stable/templates.html#synopsis)
for details.
Please note that files for both template engines use the `.in` extension.
## Developer and release modes
In the default meson configuration (`-Dmode=developer`), certain checks are
enabled that are suitable when hacking on systemd (such as internal
documentation consistency checks). Those are not useful when compiling for code
for distribution and can be disabled by setting `-Dmode=release`.
documentation consistency checks). Those are not useful when compiling for
distribution and can be disabled by setting `-Dmode=release`.
## Fuzzers

View File

@ -24,7 +24,7 @@ The systemd journal stores log data in a binary format with several features:
This document explains the basic structure of the file format on disk. We are
making this available primarily to allow review and provide documentation. Note
that the actual implementation in the [systemd
codebase](https://github.com/systemd/systemd/blob/master/src/journal/) is the
codebase](https://github.com/systemd/systemd/blob/main/src/libsystemd/sd-journal/) is the
only ultimately authoritative description of the format, so if this document
and the code disagree, the code is right. That said we'll of course try hard to
keep this document up-to-date and accurate.
@ -106,7 +106,7 @@ ignored on reading. They are currently not used but might be used later on.
## Structure
The file format's data structures are declared in
[journal-def.h](https://github.com/systemd/systemd/blob/master/src/journal/journal-def.h).
[journal-def.h](https://github.com/systemd/systemd/blob/main/src/libsystemd/sd-journal/journal-def.h).
The file format begins with a header structure. After the header structure
object structures follow. Objects are appended to the end as time

View File

@ -0,0 +1,190 @@
---
title: Native Journal Protocol
category: Interfaces
layout: default
---
# Native Journal Protocol
`systemd-journald.service` accepts log data via various protocols:
* Classic RFC3164 BSD syslog via the `/dev/log` socket
* STDOUT/STDERR of programs via `StandardOutput=journal` + `StandardError=journal` in service files (both of which are default settings)
* Kernel log messages via the `/dev/kmsg` device node
* Audit records via the kernel's audit subsystem
* Structured log messages via `journald`'s native protocol
The latter is what this document is about: if you are developing a program and
want to pass structured log data to `journald`, it's the Journal's native
protocol what you want to use. The systemd project provides the
[`sd_journal_print(3)`](https://www.freedesktop.org/software/systemd/man/sd_journal_print.html)
API that implements the client side of this protocol. This document explains
what this interface does behind the scenes, in case you'd like to implement a
client for it yourself, without linking to `libsystemd` — for example because
you work in a programming language other than C or otherwise want to avoid the
dependency.
## Basics
The native protocol of `journald` is spoken on the
`/run/systemd/journal/socket` `AF_UNIX`/`SOCK_DGRAM` socket on which
`systemd-journald.service` listens. Each datagram sent to this socket
encapsulates one journal entry that shall be written. Since datagrams are
subject to a size limit and we want to allow large journal entries, datagrams
sent over this socket may come in one of two formats:
* A datagram with the literal journal entry data as payload, without
any file descriptors attached.
* A datagram with an empty payload, but with a single
[`memfd`](https://man7.org/linux/man-pages/man2/memfd_create.2.html)
file descriptor that contains the literal journal entry data.
Other combinations are not permitted, i.e. datagrams with both payload and file
descriptors, or datagrams with neither, or more than one file descriptor. Such
datagrams are ignored. The `memfd` file descriptor should be fully sealed. The
binary format in the datagram payload and in the `memfd` memory is
identical. Typically a client would attempt to first send the data as datagram
payload, but if this fails with an `EMSGSIZE` error it would immediately retry
via the `memfd` logic.
A client probably should bump up the `SO_SNDBUF` socket option of its `AF_UNIX`
socket towards `journald` in order to delay blocking I/O as much as possible.
## Data Format
Each datagram should consist of a number of environment-like key/value
assignments. Unlike environment variable assignments the value may contain NUL
bytes however, as well as any other binary data. Keys may not include the `=`
or newline characters (or any other control characters or non-ASCII characters)
and may not be empty.
Serialization into the datagram payload or `memfd` is straight-forward: each
key/value pair is serialized via one of two methods:
* The first method inserts a `=` character between key and value, and suffixes
the result with `\n` (i.e. the newline character, ASCII code 10). Example: a
key `FOO` with a value `BAR` is serialized `F`, `O`, `O`, `=`, `B`, `A`, `R`,
`\n`.
* The second method should be used if the value of a field contains a `\n`
byte. In this case, the key name is serialized as is, followed by a `\n`
character, followed by a (non-aligned) little-endian unsigned 64bit integer
encoding the size of the value, followed by the literal value data, followed by
`\n`. Example: a key `FOO` with a value `BAR` may be serialized using this
second method as: `F`, `O`, `O`, `\n`, `\003`, `\000`, `\000`, `\000`, `\000`,
`\000`, `\000`, `\000`, `B`, `A`, `R`, `\n`.
If the value of a key/value pair contains a newline character (`\n`), it *must*
be serialized using the second method. If it does not, either method is
permitted. However, it is generally recommended to use the first method if
possible for all key/value pairs where applicable since the generated datagrams
are easily recognized and understood by the human eye this way, without any
manual binary decoding — which improves the debugging experience a lot, in
particular with tools such as `strace` that can show datagram content as text
dump. After all, log messages are highly relevant for debugging programs, hence
optimizing log traffic for readability without special tools is generally
desirable.
Note that keys that begin with `_` have special semantics in `journald`: they
are *trusted* and implicitly appended by `journald` on the receiving
side. Clients should not send them — if they do anyway, they will be ignored.
The most important key/value pair to send is `MESSAGE=`, as that contains the
actual log message text. Other relevant keys a client should send in most cases
are `PRIORITY=`, `CODE_FILE=`, `CODE_LINE=`, `CODE_FUNC=`, `ERRNO=`. It's
recommended to generate these fields implicitly on the client side. For further
information see the [relevant documentation of these
fields](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).
The order in which the fields are serialized within one datagram is undefined
and may be freely chosen by the client. The server side might or might not
retain or reorder it when writing it to the Journal.
Some programs might generate multi-line log messages (e.g. a stack unwinder
generating log output about a stack trace, with one line for each stack
frame). It's highly recommended to send these as a single datagram, using a
single `MESSAGE=` field with embedded newline characters between the lines (the
second serialization method described above must hence be used for this
field). If possible do not split up individual events into multiple Journal
events that might then be processed and written into the Journal as separate
entries. The Journal toolchain is capable of handling multi-line log entries
just fine, and it's generally preferred to have a single set of metadata fields
associated with each multi-line message.
Note that the same keys may be used multiple times within the same datagram,
with different values. The Journal supports this and will write such entries to
disk without complaining. This is useful for associating a single log entry
with multiple suitable objects of the same type at once. This should only be
used for specific Journal fields however, where this is expected. Do not use
this for Journal fields where this is not expected and where code reasonably
assumes per-event uniqueness of the keys. In most cases code that consumes and
displays log entries is likely to ignore such non-unique fields or only
consider the first of the specified values. Specifically, if a Journal entry
contains multiple `MESSAGE=` fields, likely only the first one is
displayed. Note that a well-written logging client library thus will not use a
plain dictionary for accepting structured log metadata, but rather a data
structure that allows non-unique keys, for example an array, or a dictionary
that optionally maps to a set of values instead of a single value.
## Example Datagram
Here's an encoded message, with various common fields, all encoded according to
the first serialization method, with the exception of one, where the value
contains a newline character, and thus the second method is needed to be used.
```
PRIORITY=3\n
SYSLOG_FACILITY=3\n
CODE_FILE=src/foobar.c\n
CODE_LINE=77\n
BINARY_BLOB\n
\004\000\000\000\000\000\000\000xx\nx\n
CODE_FUNC=some_func\n
SYSLOG_IDENTIFIER=footool\n
MESSAGE=Something happened.\n
```
(Lines are broken here after each `\n` to make things more readable. C-style
backslash escaping is used.)
## Automatic Protocol Upgrading
It might be wise to automatically upgrade to logging via the Journal's native
protocol in clients that previously used the BSD syslog protocol. Behaviour in
this case should be pretty obvious: try connecting a socket to
`/run/systemd/journal/socket` first (on success use the native Journal
protocol), and if that fails fall back to `/dev/log` (and use the BSD syslog
protocol).
Programs normally logging to STDERR might also choose to upgrade to native
Journal logging in case they are invoked via systemd's service logic, where
STDOUT and STDERR are going to the Journal anyway. By preferring the native
protocol over STDERR-based logging, structured metadata can be passed along,
including priority information and more — which is not available on STDERR
based logging. If a program wants to detect automatically whether its STDERR is
connected to the Journal's stream transport, look for the `$JOURNAL_STREAM`
environment variable. The systemd service logic sets this variable to a
colon-separated pair of device and inode number (formatted in decimal ASCII) of
the STDERR file descriptor. If the `.st_dev` and `.st_ino` fields of the
`struct stat` data returned by `fstat(STDERR_FILENO, …)` match these values a
program can be sure its STDERR is connected to the Journal, and may then opt to
upgrade to the native Journal protocol via an `AF_UNIX` socket of its own, and
cease to use STDERR.
Why bother with this environment variable check? A service program invoked by
systemd might employ shell-style I/O redirection on invoked subprograms, and
those should likely not upgrade to the native Journal protocol, but instead
continue to use the redirected file descriptors passed to them. Thus, by
comparing the device and inode number of the actual STDERR file descriptor with
the one the service manager passed, one can make sure that no I/O redirection
took place for the current program.
## Alternative Implementations
If you are looking for alternative implementations of this protocol (besides
systemd's own in `sd_journal_print()`), consider
[GLib's](https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gmessages.c) or
[`dbus-broker`'s](https://github.com/bus1/dbus-broker/blob/main/src/util/log.c).
And that's already all there is to it.

View File

@ -59,14 +59,14 @@ The "portable service" concept ultimately will not provide a fully isolated
environment to the payload, like containers mostly intend to. Instead they are
from the beginning more alike regular system services, can be controlled with
the same tools, are exposed the same way in all infrastructure and so on. Their
main difference is that the use a different root directory than the rest of the
main difference is that they use a different root directory than the rest of the
system. Hence, the intention is not to run code in a different, isolated world
from the host — like most containers would do it —, but to run it in the same
from the host — like most containers would do it — but to run it in the same
world, but with stricter access controls on what the service can see and do.
As one point of differentiation: as programs run as "portable services" are
pretty much regular system services, they won't run as PID 1 (like Docker would
do it), but as normal process. A corollary of that is that they aren't supposed
do it), but as normal processes. A corollary of that is that they aren't supposed
to manage anything in their own environment (such as the network) as the
execution environment is mostly shared with the rest of the system.
@ -77,12 +77,12 @@ focus includes system extensions otherwise sometimes called "super-privileged
containers".
Note that portable services are only available for system services, not for
user services. i.e. the functionality cannot be used for the stuff
bubblewrap/flatpak is focusing on.
user services (i.e. the functionality cannot be used for the stuff
bubblewrap/flatpak is focusing on).
## Mode of Operation
If you have portable service image, maybe in a raw disk image called
If you have a portable service image, maybe in a raw disk image called
`foobar_0.7.23.raw`, then attaching the services to the host is as easy as:
```
@ -135,7 +135,7 @@ This command does the following:
And that's already it.
Note that the images need to stay around (and the same location) as long as the
Note that the images need to stay around (and in the same location) as long as the
portable service is attached. If an image is moved, the `RootImage=` line
written to the unit drop-in would point to an non-existing place, and break the
logic.
@ -144,7 +144,7 @@ The `portablectl detach` command executes the reverse operation: it looks for
the drop-ins and the unit files associated with the image, and removes them
again.
Note that `portable attach` won't enable or start any of the units it copies
Note that `portablectl attach` won't enable or start any of the units it copies
out. This still has to take place in a second, separate step. (That said We
might add options to do this automatically later on.).
@ -223,7 +223,7 @@ read-only, immutable images (e.g. squashfs images) all files and directories to
over-mount must exist already.
Note that as no new image format or metadata is defined, it's very
straight-forward to define images than can be made use of it a number of
straightforward to define images than can be made use of in a number of
different ways. For example, by using `mkosi -b` you can trivially build a
single, unified image that:

View File

@ -9,14 +9,15 @@ layout: default
1. Add all items to NEWS
2. Update the contributors list in NEWS (`meson compile -C build git-contrib`)
3. Update the time and place in NEWS
4. [RC1] Update version and library numbers in `meson.build`
5. Check dbus docs with `meson compile -C build update-dbus-docs`
6. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"`
7. Do `meson compile -C build`
8. Make sure that the version string and package string match: `build/systemctl --version`
9. Upload the documentation: `meson compile -C build doc-sync`
10. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones)
11. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate.
12. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically.
13. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`)
14. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable origin/master:master origin/master:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches).
4. Update hwb (`meson compile -C build update-hwdb update-hwdb-autosuspend`)
5. [RC1] Update version and library numbers in `meson.build`
6. Check dbus docs with `meson compile -C build update-dbus-docs`
7. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"`
8. Do `meson compile -C build`
9. Make sure that the version string and package string match: `build/systemctl --version`
10. Upload the documentation: `meson compile -C build doc-sync`
11. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones)
12. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate.
13. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically.
14. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`)
15. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable origin/master:master origin/master:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches).

View File

@ -68,6 +68,7 @@ Most generic unit settings are available for transient units.
✓ ConditionKernelCommandLine=
✓ ConditionKernelVersion=
✓ ConditionArchitecture=
✓ ConditionFirmware=
✓ ConditionVirtualization=
✓ ConditionSecurity=
✓ ConditionCapability=

View File

@ -241,8 +241,9 @@ the artifacts the container manager persistently leaves in the system.
| 5 | `tty` group | `systemd` | `/etc/passwd` |
| 6…999 | System users | Distributions | `/etc/passwd` |
| 1000…60000 | Regular users | Distributions | `/etc/passwd` + LDAP/NIS/… |
| 60001…60513 | Human Users (homed) | `systemd` | `nss-systemd` |
| 60514…61183 | Unused | | |
| 60001…60513 | Human users (homed) | `systemd` | `nss-systemd` |
| 60514…60577 | Host users mapped into containers | `systemd` | `systemd-nspawn` |
| 60578…61183 | Unused | | |
| 61184…65519 | Dynamic service users | `systemd` | `nss-systemd` |
| 65520…65533 | Unused | | |
| 65534 | `nobody` user | Linux | `/etc/passwd` + `nss-systemd` |

View File

@ -56,7 +56,7 @@ and only switches back to the shell's UI after the user re-authenticated there.
Note that this change in behavior is a good idea in any case, and does not
create any dependencies on `systemd-homed` or systemd-specific APIs. It's
simply a change of behavior regarding use of existing APIs, not a suggested
hook-up to a any new API.
hook-up to any new APIs.
A display manager which supports this kind of out-of-context screen lock
operation needs to inform systemd-homed about this so that systemd-homed knows

View File

@ -19,6 +19,12 @@ expose. Or in other words, it both allows applications to efficiently query
user/group records from local services, and allows local subsystems to provide
user/group records efficiently to local applications.
The concepts described here define an IPC interface. Alternatively, user/group
records may be dropped in number of drop-in directories as files where they are
picked up in addition to the users/groups defined by this IPC logic. See
[`nss-systemd(8)`](https://www.freedesktop.org/software/systemd/man/nss-systemd.html)
for details.
This simple API only exposes only three method calls, and requires only a small
subset of the Varlink functionality.

View File

@ -87,8 +87,8 @@ hyphen. A size limit is enforced: the minimum of `sysconf(_SC_LOGIN_NAME_MAX)`
(typically 256 on Linux; rationale: this is how POSIX suggests to detect the
limit), `UT_NAMESIZE-1` (typically 31 on Linux; rationale: names longer than
this cannot correctly appear in `utmp`/`wtmp` and create ambiguity with login
accounting) and `FILENAME_MAX` (4096 on Linux; rationale: user names typically
appear in directory names, i.e. the home directory), thus MIN(256, 31, 4096) =
accounting) and `NAME_MAX` (255 on Linux; rationale: user names typically
appear in directory names, i.e. the home directory), thus MIN(256, 31, 255) =
31.
Note that these rules are both more strict and more relaxed than all of the

View File

@ -75,7 +75,11 @@ Records](https://systemd.io/GROUP_RECORD) that encapsulate UNIX groups.
JSON User Records may be transferred or written to disk in various protocols
and formats. To inquire about such records defined on the local system use the
[User/Group Lookup API via Varlink](https://systemd.io/USER_GROUP_API).
[User/Group Lookup API via
Varlink](https://systemd.io/USER_GROUP_API). User/group records may also be
dropped in number of drop-in directories as files. See
[`nss-systemd(8)`](https://www.freedesktop.org/software/systemd/man/nss-systemd.html)
for details.
## Why JSON?
@ -624,18 +628,21 @@ user records.
`fido2HmacSalt` → An array of objects, implementing authentication support with
FIDO2 devices that implement the `hmac-secret` extension. Each element of the
array should be an object consisting of three string fields: `credential`,
`salt`, `hashedPassword`. The first two shall contain Base64-encoded binary
`salt`, `hashedPassword`, and three boolean fields: `up`, `uv` and
`clientPin`. The first two string fields shall contain Base64-encoded binary
data: the FIDO2 credential ID and the salt value to pass to the FIDO2
device. During authentication this salt along with the credential ID is sent to
the FIDO2 token, which will HMAC hash the salt with its internal secret key and
return the result. This resulting binary key should then be Base64-encoded and
used as string password for the further layers of the stack. The
`hashedPassword` field of the `fido2HmacSalt` field shall be a UNIX password
hash to test this derived secret key against for authentication. It is
generally recommended that for each entry in `fido2HmacSalt` there's also a
matching one in `fido2HmacCredential`, and vice versa, with the same credential
ID, appearing in the same order, but this should not be required by
applications processing user records.
hash to test this derived secret key against for authentication. The `up`, `uv`
and `clientPin` booleans map to the FIDO2 concepts of the same name and encode
whether the `uv`/`up` options are enabled during the authentication, and
whether a PIN shall be required. It is generally recommended that for each
entry in `fido2HmacSalt` there's also a matching one in `fido2HmacCredential`,
and vice versa, with the same credential ID, appearing in the same order, but
this should not be required by applications processing user records.
`recoveryKey`→ An array of objects, each defining a recovery key. The object
has two mandatory fields: `type` indicates the type of recovery key. The only
@ -678,11 +685,11 @@ in full).
The following fields are defined in this section:
`matchMachineId` → An array of strings with each a formatted 128bit ID in
`matchMachineId` → An array of strings that are formatted 128bit IDs in
hex. If any of the specified IDs match the system's local machine ID
(i.e. matches `/etc/machine-id`) the fields in this object are honored.
`matchHostname` → An array of string with a each a valid hostname. If any of
`matchHostname` → An array of strings that are valid hostnames. If any of
the specified hostnames match the system's local hostname, the fields in this
object are honored. If both `matchHostname` and `matchMachineId` are used
within the same array entry, the object is honored when either match succeeds,
@ -923,8 +930,15 @@ user. If false or unset, authentication this way shall not be attempted.
`fido2UserPresencePermitted` → a boolean. If set to true allows the receiver to
use the FIDO2 "user presence" flag. This is similar to the concept of
`pkcs11ProtectedAuthenticationPathPermitted`, but exposes the FIDO2 concept
behind it. If false or unset authentication this way shall not be attempted.
`pkcs11ProtectedAuthenticationPathPermitted`, but exposes the FIDO2 "up"
concept behind it. If false or unset authentication this way shall not be
attempted.
`fido2UserVerificationPermitted` → a boolean. If set to true allows the
receiver to use the FIDO2 "user verification" flag. This is similar to the
concept of `pkcs11ProtectedAuthenticationPathPermitted`, but exposes the FIDO2
"uv" concept behind it. If false or unset authentication this way shall not be
attempted.
## Mapping to `struct passwd` and `struct spwd`

View File

@ -1,5 +1,5 @@
<footer class="site-footer">
<p>&copy; systemd, 2020</p>
<p>&copy; systemd, 2021</p>
<p><a href="https://github.com/systemd/systemd">Website source</a></p>
<p><a href="https://github.com/systemd/systemd/tree/main/docs">Website source</a></p>
</footer>

View File

@ -1,4 +1,4 @@
You are looking for the traditional init scripts in @SYSTEM_SYSVINIT_PATH@,
You are looking for the traditional init scripts in {{ SYSTEM_SYSVINIT_PATH }},
and they are gone?
Here's an explanation on what's going on:
@ -15,7 +15,7 @@ service, respectively. For further details, please refer to
systemctl(1).
Note that traditional init scripts continue to function on a systemd
system. An init script @SYSTEM_SYSVINIT_PATH@/foobar is implicitly mapped
system. An init script {{ SYSTEM_SYSVINIT_PATH }}/foobar is implicitly mapped
into a service unit foobar.service during system initialization.
Thank you!

View File

@ -1,11 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
file = configure_file(
custom_target(
'README',
input : 'README.in',
output : 'README',
configuration : substs)
if conf.get('HAVE_SYSV_COMPAT') == 1
install_data(file,
install_dir : sysvinit_path)
endif
command : [meson_render_jinja2, config_h, '@INPUT@'],
capture : true,
install : conf.get('HAVE_SYSV_COMPAT') == 1,
install_dir : sysvinit_path)

View File

@ -2,7 +2,8 @@
passwd: compat systemd
group: compat [SUCCESS=merge] systemd
shadow: compat
shadow: compat systemd
gshadow: files systemd
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
networks: files

View File

@ -13,7 +13,7 @@ account sufficient pam_unix.so
account required pam_permit.so
-password sufficient pam_systemd_home.so
password sufficient pam_unix.so sha512 shadow try_first_pass try_authtok
password sufficient pam_unix.so sha512 shadow try_first_pass use_authtok
password required pam_deny.so
-session optional pam_keyinit.so revoke

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,9 @@ acpi:ATML*:
acpi:AUTH*:
ID_VENDOR_FROM_DATABASE=AuthenTec
acpi:BABA*:
ID_VENDOR_FROM_DATABASE=Alibaba Co., Ltd.
acpi:BOOT*:
ID_VENDOR_FROM_DATABASE=Coreboot Project
@ -72,6 +75,9 @@ acpi:CPLM*:
acpi:DELL*:
ID_VENDOR_FROM_DATABASE=Dell, Inc.
acpi:DIOO*:
ID_VENDOR_FROM_DATABASE=Dioo Microcircuits Co., Ltd. Jiangsu
acpi:DLGS*:
ID_VENDOR_FROM_DATABASE=Dialog Semiconductor PLC
@ -81,6 +87,9 @@ acpi:DLLK*:
acpi:DMST*:
ID_VENDOR_FROM_DATABASE=DMIST RESEARCH LTD
acpi:DNBK*:
ID_VENDOR_FROM_DATABASE=Dynabook Inc.
acpi:DSUO*:
ID_VENDOR_FROM_DATABASE=Shenzhen DSO Microelectronics Co.,Ltd.
@ -93,6 +102,9 @@ acpi:ESSX*:
acpi:EXAR*:
ID_VENDOR_FROM_DATABASE=Exar Corporation
acpi:FRMW*:
ID_VENDOR_FROM_DATABASE=Framework Computer LLC
acpi:FRSC*:
ID_VENDOR_FROM_DATABASE=Freescale, Inc
@ -168,6 +180,9 @@ acpi:IP3T*:
acpi:IPHI*:
ID_VENDOR_FROM_DATABASE=Inphi Corporation
acpi:JSYS*:
ID_VENDOR_FROM_DATABASE=Juniper Systems, Inc.
acpi:KIOX*:
ID_VENDOR_FROM_DATABASE=Kionix, Inc.
@ -228,6 +243,12 @@ acpi:PHYT*:
acpi:PIXA*:
ID_VENDOR_FROM_DATABASE=PixArt imaging inc.
acpi:PNSO*:
ID_VENDOR_FROM_DATABASE=Pensando Systems, Inc.
acpi:PURI*:
ID_VENDOR_FROM_DATABASE=Purism SPC
acpi:QCOM*:
ID_VENDOR_FROM_DATABASE=Qualcomm Inc
@ -243,6 +264,9 @@ acpi:RKCP*:
acpi:RZSN*:
ID_VENDOR_FROM_DATABASE=Rozsnyó, s.r.o.
acpi:SECC*:
ID_VENDOR_FROM_DATABASE=Seiko Epson Corporation
acpi:SHRP*:
ID_VENDOR_FROM_DATABASE=Sharp Corporation
@ -592,7 +616,7 @@ acpi:ALO*:
ID_VENDOR_FROM_DATABASE=Algolith Inc.
acpi:ALP*:
ID_VENDOR_FROM_DATABASE=Alps Electric Company Ltd
ID_VENDOR_FROM_DATABASE=ALPS ALPINE CO., LTD.
acpi:ALR*:
ID_VENDOR_FROM_DATABASE=Advanced Logic
@ -718,7 +742,7 @@ acpi:APD*:
ID_VENDOR_FROM_DATABASE=AppliAdata
acpi:APE*:
ID_VENDOR_FROM_DATABASE=Alpine Electronics, Inc.
ID_VENDOR_FROM_DATABASE=ALPS ALPINE CO., LTD.
acpi:APG*:
ID_VENDOR_FROM_DATABASE=Horner Electric Inc
@ -883,7 +907,7 @@ acpi:AUG*:
ID_VENDOR_FROM_DATABASE=August Home, Inc.
acpi:AUI*:
ID_VENDOR_FROM_DATABASE=Alps Electric Inc
ID_VENDOR_FROM_DATABASE=ALPS ALPINE CO., LTD.
acpi:AUO*:
ID_VENDOR_FROM_DATABASE=AU Optronics
@ -1473,6 +1497,9 @@ acpi:CLM*:
acpi:CLO*:
ID_VENDOR_FROM_DATABASE=Clone Computers
acpi:CLR*:
ID_VENDOR_FROM_DATABASE=Clover Electronics
acpi:CLT*:
ID_VENDOR_FROM_DATABASE=automated computer control systems
@ -1521,6 +1548,9 @@ acpi:CNB*:
acpi:CNC*:
ID_VENDOR_FROM_DATABASE=Alvedon Computers Ltd
acpi:CND*:
ID_VENDOR_FROM_DATABASE=Micro-Star Int'l Co., Ltd.
acpi:CNE*:
ID_VENDOR_FROM_DATABASE=Cine-tal
@ -1620,6 +1650,9 @@ acpi:CRI*:
acpi:CRL*:
ID_VENDOR_FROM_DATABASE=Creative Logic
acpi:CRM*:
ID_VENDOR_FROM_DATABASE=CORSAIR MEMORY Inc.
acpi:CRN*:
ID_VENDOR_FROM_DATABASE=Cornerstone Imaging
@ -1971,6 +2004,9 @@ acpi:DLK*:
acpi:DLL*:
ID_VENDOR_FROM_DATABASE=Dell Inc
acpi:DLM*:
ID_VENDOR_FROM_DATABASE=DLOGIC Ltd.
acpi:DLO*:
ID_VENDOR_FROM_DATABASE=Shenzhen Dlodlo Technologies Co., Ltd.
@ -1983,6 +2019,9 @@ acpi:DMB*:
acpi:DMC*:
ID_VENDOR_FROM_DATABASE=Dune Microsystems Corporation
acpi:DMG*:
ID_VENDOR_FROM_DATABASE=Monoprice.Inc
acpi:DMM*:
ID_VENDOR_FROM_DATABASE=Dimond Multimedia Systems Inc
@ -2355,6 +2394,9 @@ acpi:EMK*:
acpi:EMO*:
ID_VENDOR_FROM_DATABASE=ELMO COMPANY, LIMITED
acpi:EMR*:
ID_VENDOR_FROM_DATABASE=ICC Intelligent Platforms GmbH
acpi:EMU*:
ID_VENDOR_FROM_DATABASE=Emulex Corporation
@ -2733,6 +2775,9 @@ acpi:FTW*:
acpi:FUJ*:
ID_VENDOR_FROM_DATABASE=Fujitsu Ltd
acpi:FUL*:
ID_VENDOR_FROM_DATABASE=Fun Technology Innovation INC.
acpi:FUN*:
ID_VENDOR_FROM_DATABASE=sisel muhendislik
@ -3039,6 +3084,9 @@ acpi:HHC*:
acpi:HHI*:
ID_VENDOR_FROM_DATABASE=Fraunhofer Heinrich-Hertz-Institute
acpi:HHT*:
ID_VENDOR_FROM_DATABASE=Hitevision Group
acpi:HIB*:
ID_VENDOR_FROM_DATABASE=Hibino Corporation
@ -3159,6 +3207,9 @@ acpi:HSL*:
acpi:HSM*:
ID_VENDOR_FROM_DATABASE=AT&T Microelectronics
acpi:HSN*:
ID_VENDOR_FROM_DATABASE=Hansung Co., Ltd
acpi:HSP*:
ID_VENDOR_FROM_DATABASE=HannStar Display Corp
@ -3486,6 +3537,9 @@ acpi:INZ*:
acpi:IOA*:
ID_VENDOR_FROM_DATABASE=CRE Technology Corporation
acpi:IOC*:
ID_VENDOR_FROM_DATABASE=Guangxi Century Innovation Display Electronics Co., Ltd
acpi:IOD*:
ID_VENDOR_FROM_DATABASE=I-O Data Device Inc
@ -3891,6 +3945,9 @@ acpi:KTK*:
acpi:KTN*:
ID_VENDOR_FROM_DATABASE=Katron Tech Inc
acpi:KTS*:
ID_VENDOR_FROM_DATABASE=Kyokko Communication System Co., Ltd.
acpi:KUR*:
ID_VENDOR_FROM_DATABASE=Kurta Corporation
@ -3966,6 +4023,9 @@ acpi:LCM*:
acpi:LCN*:
ID_VENDOR_FROM_DATABASE=LEXICON
acpi:LCP*:
ID_VENDOR_FROM_DATABASE=Silent Power Electronics GmbH
acpi:LCS*:
ID_VENDOR_FROM_DATABASE=Longshine Electronics Company
@ -4032,6 +4092,9 @@ acpi:LIN*:
acpi:LIP*:
ID_VENDOR_FROM_DATABASE=Linked IP GmbH
acpi:LIS*:
ID_VENDOR_FROM_DATABASE=Life is Style Inc.
acpi:LIT*:
ID_VENDOR_FROM_DATABASE=Lithics Silicon Technology
@ -4740,6 +4803,9 @@ acpi:NAC*:
acpi:NAD*:
ID_VENDOR_FROM_DATABASE=NAD Electronics
acpi:NAF*:
ID_VENDOR_FROM_DATABASE=NAFASAE INDIA Pvt. Ltd
acpi:NAK*:
ID_VENDOR_FROM_DATABASE=Nakano Engineering Co.,Ltd.
@ -4842,6 +4908,9 @@ acpi:NGC*:
acpi:NGS*:
ID_VENDOR_FROM_DATABASE=A D S Exports
acpi:NHC*:
ID_VENDOR_FROM_DATABASE=New H3C Technology Co., Ltd.
acpi:NHT*:
ID_VENDOR_FROM_DATABASE=Vinci Labs
@ -4986,6 +5055,9 @@ acpi:NVT*:
acpi:NWC*:
ID_VENDOR_FROM_DATABASE=NW Computer Engineering
acpi:NWL*:
ID_VENDOR_FROM_DATABASE=Newline Interactive Inc.
acpi:NWP*:
ID_VENDOR_FROM_DATABASE=NovaWeb Technologies Inc
@ -5190,6 +5262,9 @@ acpi:PAC*:
acpi:PAD*:
ID_VENDOR_FROM_DATABASE=Promotion and Display Technology Ltd.
acpi:PAE*:
ID_VENDOR_FROM_DATABASE=PreSonus Audio Electronics
acpi:PAK*:
ID_VENDOR_FROM_DATABASE=Many CNC System Co., Ltd.
@ -5346,6 +5421,9 @@ acpi:PIM*:
acpi:PIO*:
ID_VENDOR_FROM_DATABASE=Pioneer Electronic Corporation
acpi:PIR*:
ID_VENDOR_FROM_DATABASE=Pico Technology Inc.
acpi:PIS*:
ID_VENDOR_FROM_DATABASE=TECNART CO.,LTD.
@ -5949,6 +6027,9 @@ acpi:SCD*:
acpi:SCE*:
ID_VENDOR_FROM_DATABASE=Sun Corporation
acpi:SCG*:
ID_VENDOR_FROM_DATABASE=Seco S.p.A.
acpi:SCH*:
ID_VENDOR_FROM_DATABASE=Schlumberger Cards
@ -6162,6 +6243,9 @@ acpi:SJE*:
acpi:SKD*:
ID_VENDOR_FROM_DATABASE=Schneider & Koch
acpi:SKG*:
ID_VENDOR_FROM_DATABASE=Shenzhen KTC Technology Group
acpi:SKI*:
ID_VENDOR_FROM_DATABASE=LLC SKTB “SKIT”
@ -6804,6 +6888,9 @@ acpi:TLV*:
acpi:TLX*:
ID_VENDOR_FROM_DATABASE=Telxon Corporation
acpi:TLY*:
ID_VENDOR_FROM_DATABASE=Truly Semiconductors Ltd.
acpi:TMC*:
ID_VENDOR_FROM_DATABASE=Techmedia Computer Systems Corporation
@ -6816,6 +6903,9 @@ acpi:TMI*:
acpi:TMM*:
ID_VENDOR_FROM_DATABASE=Time Management, Inc.
acpi:TMO*:
ID_VENDOR_FROM_DATABASE=Terumo Corporation
acpi:TMR*:
ID_VENDOR_FROM_DATABASE=Taicom International Inc
@ -7002,6 +7092,9 @@ acpi:TTL*:
acpi:TTP*:
ID_VENDOR_FROM_DATABASE=Toshiba Corporation
acpi:TTR*:
ID_VENDOR_FROM_DATABASE=Hubei Century Joint Innovation Technology Co.Ltd
acpi:TTS*:
ID_VENDOR_FROM_DATABASE=TechnoTrend Systemtechnik GmbH
@ -7218,6 +7311,9 @@ acpi:VAR*:
acpi:VAT*:
ID_VENDOR_FROM_DATABASE=VADATECH INC
acpi:VAV*:
ID_VENDOR_FROM_DATABASE=aviica
acpi:VBR*:
ID_VENDOR_FROM_DATABASE=VBrick Systems Inc.
@ -7293,6 +7389,9 @@ acpi:VIM*:
acpi:VIN*:
ID_VENDOR_FROM_DATABASE=Vine Micros Ltd
acpi:VIO*:
ID_VENDOR_FROM_DATABASE=Zake IP Holdings LLC (3B tech)
acpi:VIR*:
ID_VENDOR_FROM_DATABASE=Visual Interface, Inc

View File

@ -1,5 +1,5 @@
--- 20-acpi-vendor.hwdb.base 2021-02-12 15:42:10.664053745 +0100
+++ 20-acpi-vendor.hwdb 2021-02-12 15:42:10.706054210 +0100
--- 20-acpi-vendor.hwdb.base 2021-06-25 14:20:43.637315960 +0200
+++ 20-acpi-vendor.hwdb 2021-06-25 14:20:43.655316147 +0200
@@ -3,6 +3,8 @@
# Data imported from:
# https://uefi.org/uefi-pnp-export
@ -19,7 +19,7 @@
acpi:AMDI*:
ID_VENDOR_FROM_DATABASE=AMD
@@ -295,6 +294,9 @@
@@ -319,6 +318,9 @@
acpi:AAA*:
ID_VENDOR_FROM_DATABASE=Avolites Ltd
@ -29,7 +29,7 @@
acpi:AAE*:
ID_VENDOR_FROM_DATABASE=Anatek Electronics Inc.
@@ -322,6 +324,9 @@
@@ -346,6 +348,9 @@
acpi:ABO*:
ID_VENDOR_FROM_DATABASE=D-Link Systems Inc
@ -39,7 +39,7 @@
acpi:ABS*:
ID_VENDOR_FROM_DATABASE=Abaco Systems, Inc.
@@ -367,7 +372,7 @@
@@ -391,7 +396,7 @@
acpi:ACO*:
ID_VENDOR_FROM_DATABASE=Allion Computer Inc.
@ -48,7 +48,7 @@
ID_VENDOR_FROM_DATABASE=Aspen Tech Inc
acpi:ACR*:
@@ -640,6 +645,9 @@
@@ -664,6 +669,9 @@
acpi:AMT*:
ID_VENDOR_FROM_DATABASE=AMT International Industry
@ -58,7 +58,7 @@
acpi:AMX*:
ID_VENDOR_FROM_DATABASE=AMX LLC
@@ -688,6 +696,9 @@
@@ -712,6 +720,9 @@
acpi:AOA*:
ID_VENDOR_FROM_DATABASE=AOpen Inc.
@ -68,7 +68,7 @@
acpi:AOE*:
ID_VENDOR_FROM_DATABASE=Advanced Optics Electronics, Inc.
@@ -697,6 +708,9 @@
@@ -721,6 +732,9 @@
acpi:AOT*:
ID_VENDOR_FROM_DATABASE=Alcatel
@ -78,8 +78,8 @@
acpi:APC*:
ID_VENDOR_FROM_DATABASE=American Power Conversion
@@ -872,7 +886,7 @@
ID_VENDOR_FROM_DATABASE=Alps Electric Inc
@@ -896,7 +910,7 @@
ID_VENDOR_FROM_DATABASE=ALPS ALPINE CO., LTD.
acpi:AUO*:
- ID_VENDOR_FROM_DATABASE=DO NOT USE - AUO
@ -87,7 +87,7 @@
acpi:AUR*:
ID_VENDOR_FROM_DATABASE=Aureal Semiconductor
@@ -952,6 +966,9 @@
@@ -976,6 +990,9 @@
acpi:AXE*:
ID_VENDOR_FROM_DATABASE=Axell Corporation
@ -97,7 +97,7 @@
acpi:AXI*:
ID_VENDOR_FROM_DATABASE=American Magnetics
@@ -1102,6 +1119,9 @@
@@ -1126,6 +1143,9 @@
acpi:BML*:
ID_VENDOR_FROM_DATABASE=BIOMED Lab
@ -107,7 +107,7 @@
acpi:BMS*:
ID_VENDOR_FROM_DATABASE=BIOMEDISYS
@@ -1114,6 +1134,9 @@
@@ -1138,6 +1158,9 @@
acpi:BNO*:
ID_VENDOR_FROM_DATABASE=Bang & Olufsen
@ -117,7 +117,7 @@
acpi:BNS*:
ID_VENDOR_FROM_DATABASE=Boulder Nonlinear Systems
@@ -1357,6 +1380,9 @@
@@ -1381,6 +1404,9 @@
acpi:CHA*:
ID_VENDOR_FROM_DATABASE=Chase Research PLC
@ -127,7 +127,7 @@
acpi:CHD*:
ID_VENDOR_FROM_DATABASE=ChangHong Electric Co.,Ltd
@@ -1513,6 +1539,9 @@
@@ -1543,6 +1569,9 @@
acpi:COD*:
ID_VENDOR_FROM_DATABASE=CODAN Pty. Ltd.
@ -137,7 +137,7 @@
acpi:COI*:
ID_VENDOR_FROM_DATABASE=Codec Inc.
@@ -1919,7 +1948,7 @@
@@ -1952,7 +1981,7 @@
ID_VENDOR_FROM_DATABASE=Dragon Information Technology
acpi:DJE*:
@ -146,7 +146,7 @@
acpi:DJP*:
ID_VENDOR_FROM_DATABASE=Maygay Machines, Ltd
@@ -2251,6 +2280,9 @@
@@ -2290,6 +2319,9 @@
acpi:EIN*:
ID_VENDOR_FROM_DATABASE=Elegant Invention
@ -156,7 +156,7 @@
acpi:EKA*:
ID_VENDOR_FROM_DATABASE=MagTek Inc.
@@ -2512,6 +2544,9 @@
@@ -2554,6 +2586,9 @@
acpi:FCG*:
ID_VENDOR_FROM_DATABASE=First International Computer Ltd
@ -166,7 +166,7 @@
acpi:FCS*:
ID_VENDOR_FROM_DATABASE=Focus Enhancements, Inc.
@@ -2885,7 +2920,7 @@
@@ -2930,7 +2965,7 @@
ID_VENDOR_FROM_DATABASE=General Standards Corporation
acpi:GSM*:
@ -175,7 +175,7 @@
acpi:GSN*:
ID_VENDOR_FROM_DATABASE=Grandstream Networks, Inc.
@@ -2986,6 +3021,9 @@
@@ -3031,6 +3066,9 @@
acpi:HEC*:
ID_VENDOR_FROM_DATABASE=Hisense Electric Co., Ltd.
@ -185,7 +185,7 @@
acpi:HEL*:
ID_VENDOR_FROM_DATABASE=Hitachi Micro Systems Europe Ltd
@@ -3115,6 +3153,9 @@
@@ -3163,6 +3201,9 @@
acpi:HSD*:
ID_VENDOR_FROM_DATABASE=HannStar Display Corp
@ -195,7 +195,7 @@
acpi:HSM*:
ID_VENDOR_FROM_DATABASE=AT&T Microelectronics
@@ -3238,6 +3279,9 @@
@@ -3289,6 +3330,9 @@
acpi:ICI*:
ID_VENDOR_FROM_DATABASE=Infotek Communication Inc
@ -205,7 +205,7 @@
acpi:ICM*:
ID_VENDOR_FROM_DATABASE=Intracom SA
@@ -3334,6 +3378,9 @@
@@ -3385,6 +3429,9 @@
acpi:IKE*:
ID_VENDOR_FROM_DATABASE=Ikegami Tsushinki Co. Ltd.
@ -215,7 +215,7 @@
acpi:IKS*:
ID_VENDOR_FROM_DATABASE=Ikos Systems Inc
@@ -3379,6 +3426,9 @@
@@ -3430,6 +3477,9 @@
acpi:IMT*:
ID_VENDOR_FROM_DATABASE=Inmax Technology Corporation
@ -225,7 +225,7 @@
acpi:INA*:
ID_VENDOR_FROM_DATABASE=Inventec Corporation
@@ -3886,6 +3936,9 @@
@@ -3943,6 +3993,9 @@
acpi:LAN*:
ID_VENDOR_FROM_DATABASE=Sodeman Lancom Inc
@ -235,7 +235,7 @@
acpi:LAS*:
ID_VENDOR_FROM_DATABASE=LASAT Comm. A/S
@@ -3931,6 +3984,9 @@
@@ -3991,6 +4044,9 @@
acpi:LED*:
ID_VENDOR_FROM_DATABASE=Long Engineering Design Inc
@ -245,7 +245,7 @@
acpi:LEG*:
ID_VENDOR_FROM_DATABASE=Legerity, Inc
@@ -3946,6 +4002,9 @@
@@ -4006,6 +4062,9 @@
acpi:LGC*:
ID_VENDOR_FROM_DATABASE=Logic Ltd
@ -255,7 +255,7 @@
acpi:LGI*:
ID_VENDOR_FROM_DATABASE=Logitech Inc
@@ -4000,6 +4059,9 @@
@@ -4063,6 +4122,9 @@
acpi:LND*:
ID_VENDOR_FROM_DATABASE=Land Computer Company Ltd
@ -265,7 +265,7 @@
acpi:LNK*:
ID_VENDOR_FROM_DATABASE=Link Tech Inc
@@ -4034,7 +4096,7 @@
@@ -4097,7 +4159,7 @@
ID_VENDOR_FROM_DATABASE=Design Technology
acpi:LPL*:
@ -274,7 +274,7 @@
acpi:LSC*:
ID_VENDOR_FROM_DATABASE=LifeSize Communications
@@ -4210,6 +4272,9 @@
@@ -4273,6 +4335,9 @@
acpi:MCX*:
ID_VENDOR_FROM_DATABASE=Millson Custom Solutions Inc.
@ -284,7 +284,7 @@
acpi:MDA*:
ID_VENDOR_FROM_DATABASE=Media4 Inc
@@ -4450,6 +4515,9 @@
@@ -4513,6 +4578,9 @@
acpi:MOM*:
ID_VENDOR_FROM_DATABASE=Momentum Data Systems
@ -294,7 +294,7 @@
acpi:MOS*:
ID_VENDOR_FROM_DATABASE=Moses Corporation
@@ -4678,6 +4746,9 @@
@@ -4744,6 +4812,9 @@
acpi:NAL*:
ID_VENDOR_FROM_DATABASE=Network Alchemy
@ -304,7 +304,7 @@
acpi:NAT*:
ID_VENDOR_FROM_DATABASE=NaturalPoint Inc.
@@ -5185,6 +5256,9 @@
@@ -5260,6 +5331,9 @@
acpi:PCX*:
ID_VENDOR_FROM_DATABASE=PC Xperten
@ -314,7 +314,7 @@
acpi:PDM*:
ID_VENDOR_FROM_DATABASE=Psion Dacom Plc.
@@ -5248,9 +5322,6 @@
@@ -5323,9 +5397,6 @@
acpi:PHE*:
ID_VENDOR_FROM_DATABASE=Philips Medical Systems Boeblingen GmbH
@ -324,7 +324,7 @@
acpi:PHL*:
ID_VENDOR_FROM_DATABASE=Philips Consumer Electronics Company
@@ -5338,9 +5409,6 @@
@@ -5416,9 +5487,6 @@
acpi:PNL*:
ID_VENDOR_FROM_DATABASE=Panelview, Inc.
@ -334,7 +334,7 @@
acpi:PNR*:
ID_VENDOR_FROM_DATABASE=Planar Systems, Inc.
@@ -5476,15 +5544,9 @@
@@ -5554,15 +5622,9 @@
acpi:PTS*:
ID_VENDOR_FROM_DATABASE=Plain Tree Systems Inc
@ -350,7 +350,7 @@
acpi:PVG*:
ID_VENDOR_FROM_DATABASE=Proview Global Co., Ltd
@@ -5800,9 +5862,6 @@
@@ -5878,9 +5940,6 @@
acpi:RTI*:
ID_VENDOR_FROM_DATABASE=Rancho Tech Inc
@ -360,7 +360,7 @@
acpi:RTL*:
ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Company Ltd
@@ -5968,9 +6027,6 @@
@@ -6049,9 +6108,6 @@
acpi:SEE*:
ID_VENDOR_FROM_DATABASE=SeeColor Corporation
@ -370,7 +370,7 @@
acpi:SEI*:
ID_VENDOR_FROM_DATABASE=Seitz & Associates Inc
@@ -6430,6 +6486,9 @@
@@ -6514,6 +6570,9 @@
acpi:SVD*:
ID_VENDOR_FROM_DATABASE=SVD Computer
@ -380,7 +380,7 @@
acpi:SVI*:
ID_VENDOR_FROM_DATABASE=Sun Microsystems
@@ -6514,6 +6573,9 @@
@@ -6598,6 +6657,9 @@
acpi:SZM*:
ID_VENDOR_FROM_DATABASE=Shenzhen MTC Co., Ltd
@ -390,7 +390,7 @@
acpi:TAA*:
ID_VENDOR_FROM_DATABASE=Tandberg
@@ -6604,6 +6666,9 @@
@@ -6688,6 +6750,9 @@
acpi:TDG*:
ID_VENDOR_FROM_DATABASE=Six15 Technologies
@ -400,7 +400,7 @@
acpi:TDM*:
ID_VENDOR_FROM_DATABASE=Tandem Computer Europe Inc
@@ -6646,6 +6711,9 @@
@@ -6730,6 +6795,9 @@
acpi:TEV*:
ID_VENDOR_FROM_DATABASE=Televés, S.A.
@ -410,7 +410,7 @@
acpi:TEZ*:
ID_VENDOR_FROM_DATABASE=Tech Source Inc.
@@ -6763,9 +6831,6 @@
@@ -6853,9 +6921,6 @@
acpi:TNC*:
ID_VENDOR_FROM_DATABASE=TNC Industrial Company Ltd
@ -420,7 +420,7 @@
acpi:TNM*:
ID_VENDOR_FROM_DATABASE=TECNIMAGEN SA
@@ -7072,14 +7137,14 @@
@@ -7165,14 +7230,14 @@
acpi:UNC*:
ID_VENDOR_FROM_DATABASE=Unisys Corporation
@ -441,7 +441,7 @@
acpi:UNI*:
ID_VENDOR_FROM_DATABASE=Uniform Industry Corp.
@@ -7114,6 +7179,9 @@
@@ -7207,6 +7272,9 @@
acpi:USA*:
ID_VENDOR_FROM_DATABASE=Utimaco Safeware AG
@ -451,7 +451,7 @@
acpi:USD*:
ID_VENDOR_FROM_DATABASE=U.S. Digital Corporation
@@ -7360,9 +7428,6 @@
@@ -7459,9 +7527,6 @@
acpi:WAL*:
ID_VENDOR_FROM_DATABASE=Wave Access
@ -461,7 +461,7 @@
acpi:WAV*:
ID_VENDOR_FROM_DATABASE=Wavephore
@@ -7487,7 +7552,7 @@
@@ -7586,7 +7651,7 @@
ID_VENDOR_FROM_DATABASE=WyreStorm Technologies LLC
acpi:WYS*:
@ -470,7 +470,7 @@
acpi:WYT*:
ID_VENDOR_FROM_DATABASE=Wooyoung Image & Information Co.,Ltd.
@@ -7501,9 +7566,6 @@
@@ -7600,9 +7665,6 @@
acpi:XDM*:
ID_VENDOR_FROM_DATABASE=XDM Ltd.
@ -480,7 +480,7 @@
acpi:XES*:
ID_VENDOR_FROM_DATABASE=Extreme Engineering Solutions, Inc.
@@ -7534,9 +7596,6 @@
@@ -7633,9 +7695,6 @@
acpi:XNT*:
ID_VENDOR_FROM_DATABASE=XN Technologies, Inc.
@ -490,7 +490,7 @@
acpi:XQU*:
ID_VENDOR_FROM_DATABASE=SHANGHAI SVA-DAV ELECTRONICS CO., LTD
@@ -7603,6 +7662,9 @@
@@ -7702,6 +7761,9 @@
acpi:ZBX*:
ID_VENDOR_FROM_DATABASE=Zebax Technologies

File diff suppressed because it is too large Load Diff

View File

@ -1721,6 +1721,9 @@ usb:v03F0p6302*
usb:v03F0p6317*
ID_MODEL_FROM_DATABASE=Color LaserJet 4730mfp
usb:v03F0p632A*
ID_MODEL_FROM_DATABASE=LaserJet M203-M206
usb:v03F0p6402*
ID_MODEL_FROM_DATABASE=PhotoSmart 715 (ptp)
@ -2285,6 +2288,9 @@ usb:v0402p5661*
usb:v0402p5667*
ID_MODEL_FROM_DATABASE=M5667 MP3 player
usb:v0402p8841*
ID_MODEL_FROM_DATABASE=Newmine Camera
usb:v0402p9665*
ID_MODEL_FROM_DATABASE=Gateway Webcam
@ -2336,6 +2342,9 @@ usb:v0403p6015*
usb:v0403p601F*
ID_MODEL_FROM_DATABASE=Myriad-RF LimeSDR-Mini
usb:v0403p6EE0*
ID_MODEL_FROM_DATABASE=EZO Carrier Board
usb:v0403p6F70*
ID_MODEL_FROM_DATABASE=HB-RF-USB
@ -2402,12 +2411,18 @@ usb:v0403p9132*
usb:v0403p9133*
ID_MODEL_FROM_DATABASE=CallerID
usb:v0403p9134*
ID_MODEL_FROM_DATABASE=Virtual keyboard
usb:v0403p9135*
ID_MODEL_FROM_DATABASE=Rotary Pub alarm
usb:v0403p9136*
ID_MODEL_FROM_DATABASE=Pulsecounter
usb:v0403p9137*
ID_MODEL_FROM_DATABASE=Ledbutton interface
usb:v0403p9E90*
ID_MODEL_FROM_DATABASE=Marvell OpenRD Base/Client
@ -2717,6 +2732,9 @@ usb:v0403pF850*
usb:v0403pF918*
ID_MODEL_FROM_DATABASE=Ant8 Logic Probe
usb:v0403pF9D9*
ID_MODEL_FROM_DATABASE=Wetterempfanger 147.3kHz
usb:v0403pFA00*
ID_MODEL_FROM_DATABASE=Matrix Orbital USB Serial
@ -2984,6 +3002,9 @@ usb:v0409p00F7*
usb:v0409p011D*
ID_MODEL_FROM_DATABASE=e228 Mobile Phone
usb:v0409p0193*
ID_MODEL_FROM_DATABASE=RVT-R Writer
usb:v0409p0203*
ID_MODEL_FROM_DATABASE=HID Audio Controls
@ -4064,6 +4085,9 @@ usb:v041Ep3232*
usb:v041Ep3237*
ID_MODEL_FROM_DATABASE=SB X-Fi Surround 5.1 Pro
usb:v041Ep3241*
ID_MODEL_FROM_DATABASE=Sound Blaster JAM
usb:v041Ep3263*
ID_MODEL_FROM_DATABASE=SB X-Fi Surround 5.1 Pro
@ -4265,6 +4289,9 @@ usb:v041Ep4095*
usb:v041Ep4097*
ID_MODEL_FROM_DATABASE=Live! Cam Chat HD [VF0700]
usb:v041Ep4099*
ID_MODEL_FROM_DATABASE=Creative VF0800 [RealSense Camera SR300]
usb:v041Ep4100*
ID_MODEL_FROM_DATABASE=Nomad Jukebox 2
@ -5954,6 +5981,9 @@ usb:v044FpB653*
usb:v044FpB654*
ID_MODEL_FROM_DATABASE=Ferrari GT Force Feedback Wheel
usb:v044FpB677*
ID_MODEL_FROM_DATABASE=T150 Racing Wheel
usb:v044FpB678*
ID_MODEL_FROM_DATABASE=T.Flight Rudder Pedals
@ -7538,6 +7568,9 @@ usb:v045Ep09C0*
usb:v045Ep0A00*
ID_MODEL_FROM_DATABASE=Lumia 950 Dual SIM (RM-1118)
usb:v045Ep0B12*
ID_MODEL_FROM_DATABASE=Xbox Wireless Controller (model 1914)
usb:v045Ep930A*
ID_MODEL_FROM_DATABASE=ISOUSB.SYS Intel 82930 Isochronous IO Test Board
@ -7991,20 +8024,41 @@ usb:v046Dp0840*
usb:v046Dp0843*
ID_MODEL_FROM_DATABASE=Webcam C930e
usb:v046Dp0845*
ID_MODEL_FROM_DATABASE=ConferenceCam CC3000e Camera
usb:v046Dp0846*
ID_MODEL_FROM_DATABASE=ConferenceCam CC3000e Speakerphone
usb:v046Dp084B*
ID_MODEL_FROM_DATABASE=ConferenceCam Connect Video
usb:v046Dp0850*
ID_MODEL_FROM_DATABASE=QuickCam Web
usb:v046Dp0857*
ID_MODEL_FROM_DATABASE=Logi Group Speakerphone
usb:v046Dp085C*
ID_MODEL_FROM_DATABASE=C922 Pro Stream Webcam
usb:v046Dp085E*
ID_MODEL_FROM_DATABASE=BRIO Ultra HD Webcam
usb:v046Dp0870*
ID_MODEL_FROM_DATABASE=QuickCam Express
usb:v046Dp0882*
ID_MODEL_FROM_DATABASE=Logi Group Speakerphone
usb:v046Dp0890*
ID_MODEL_FROM_DATABASE=QuickCam Traveler
usb:v046Dp0892*
ID_MODEL_FROM_DATABASE=OrbiCam
ID_MODEL_FROM_DATABASE=C920 HD Pro Webcam
usb:v046Dp0893*
ID_MODEL_FROM_DATABASE=StreamCam
usb:v046Dp0894*
ID_MODEL_FROM_DATABASE=CrystalCam
@ -8330,6 +8384,9 @@ usb:v046Dp0A5D*
usb:v046Dp0A66*
ID_MODEL_FROM_DATABASE=[G533 Wireless Headset Dongle]
usb:v046Dp0A8F*
ID_MODEL_FROM_DATABASE=H390 headset with microphone
usb:v046Dp0B02*
ID_MODEL_FROM_DATABASE=C-UV35 [Bluetooth Mini-Receiver] (HID proxy mode)
@ -8567,6 +8624,9 @@ usb:v046DpC084*
usb:v046DpC08B*
ID_MODEL_FROM_DATABASE=G502 SE HERO Gaming Mouse
usb:v046DpC092*
ID_MODEL_FROM_DATABASE=G203 LIGHTSYNC Gaming Mouse
usb:v046DpC101*
ID_MODEL_FROM_DATABASE=UltraX Media Remote
@ -8744,6 +8804,9 @@ usb:v046DpC24F*
usb:v046DpC260*
ID_MODEL_FROM_DATABASE=G29 Driving Force Racing Wheel [PS4]
usb:v046DpC262*
ID_MODEL_FROM_DATABASE=G920 Driving Force Racing Wheel
usb:v046DpC281*
ID_MODEL_FROM_DATABASE=WingMan Force
@ -8885,6 +8948,9 @@ usb:v046DpC335*
usb:v046DpC33A*
ID_MODEL_FROM_DATABASE=G413 Gaming Keyboard
usb:v046DpC33F*
ID_MODEL_FROM_DATABASE=G815 Mechanical Keyboard
usb:v046DpC401*
ID_MODEL_FROM_DATABASE=TrackMan Marble Wheel
@ -9005,6 +9071,9 @@ usb:v046DpC537*
usb:v046DpC53A*
ID_MODEL_FROM_DATABASE=PowerPlay Wireless Charging System
usb:v046DpC53D*
ID_MODEL_FROM_DATABASE=G631 Keyboard
usb:v046DpC603*
ID_MODEL_FROM_DATABASE=3Dconnexion Spacemouse Plus XT
@ -9845,6 +9914,12 @@ usb:v047Dp5002*
usb:v047Dp5003*
ID_MODEL_FROM_DATABASE=VideoCam
usb:v047Dp8018*
ID_MODEL_FROM_DATABASE=Expert Wireless Trackball Mouse (K72359WW)
usb:v047Dp8068*
ID_MODEL_FROM_DATABASE=Pro Fit Ergo Vertical Wireless Trackball
usb:v047E*
ID_VENDOR_FROM_DATABASE=Agere Systems, Inc. (Lucent)
@ -9905,6 +9980,9 @@ usb:v047FpC00E*
usb:v047FpC03B*
ID_MODEL_FROM_DATABASE=HD1
usb:v047FpCA01*
ID_MODEL_FROM_DATABASE=Calisto 800 Series
usb:v047FpDA60*
ID_MODEL_FROM_DATABASE=DA60
@ -10028,6 +10106,9 @@ usb:v0482p0640*
usb:v0482p069B*
ID_MODEL_FROM_DATABASE=ECOSYS M2635dn
usb:v0482p06B4*
ID_MODEL_FROM_DATABASE=ECOSYS M5526cdw
usb:v0483*
ID_VENDOR_FROM_DATABASE=STMicroelectronics
@ -11042,6 +11123,9 @@ usb:v04A7p04BB*
usb:v04A7p04CD*
ID_MODEL_FROM_DATABASE=Xerox Travel Scanner 150
usb:v04A7p04EE*
ID_MODEL_FROM_DATABASE=Duplex Combo Scanner
usb:v04A8*
ID_VENDOR_FROM_DATABASE=Multivideo Labs, Inc.
@ -11660,6 +11744,9 @@ usb:v04A9p190E*
usb:v04A9p190F*
ID_MODEL_FROM_DATABASE=CanoScan LiDE 220
usb:v04A9p1913*
ID_MODEL_FROM_DATABASE=CanoScan LiDE 300
usb:v04A9p2200*
ID_MODEL_FROM_DATABASE=CanoScan LiDE 25
@ -13043,6 +13130,9 @@ usb:v04A9p32BB*
usb:v04A9p32BF*
ID_MODEL_FROM_DATABASE=PowerShot SX420 IS
usb:v04A9p32C0*
ID_MODEL_FROM_DATABASE=PowerShot ELPH 190IS
usb:v04A9p32C1*
ID_MODEL_FROM_DATABASE=PowerShot ELPH 180 / IXUS 175
@ -13271,6 +13361,12 @@ usb:v04B0p040F*
usb:v04B0p0410*
ID_MODEL_FROM_DATABASE=D200 (ptp)
usb:v04B0p0411*
ID_MODEL_FROM_DATABASE=D80 (mass storage mode)
usb:v04B0p0412*
ID_MODEL_FROM_DATABASE=D80 (MTP/PTP mode)
usb:v04B0p0413*
ID_MODEL_FROM_DATABASE=D40 (mass storage mode)
@ -13430,6 +13526,9 @@ usb:v04B4p0001*
usb:v04B4p0002*
ID_MODEL_FROM_DATABASE=CY7C63x0x Thermometer
usb:v04B4p0008*
ID_MODEL_FROM_DATABASE=CDC ACM serial port
usb:v04B4p0033*
ID_MODEL_FROM_DATABASE=Mouse
@ -13457,6 +13556,9 @@ usb:v04B4p0306*
usb:v04B4p0407*
ID_MODEL_FROM_DATABASE=Optical Skype Mouse
usb:v04B4p0818*
ID_MODEL_FROM_DATABASE=AE-SMKD92-* [Thumb Keyboard]
usb:v04B4p0BAD*
ID_MODEL_FROM_DATABASE=MetaGeek Wi-Spy
@ -14147,6 +14249,9 @@ usb:v04B8p1114*
usb:v04B8p1129*
ID_MODEL_FROM_DATABASE=ET-4750 [WorkForce ET-4750 EcoTank All-in-One]
usb:v04B8p1168*
ID_MODEL_FROM_DATABASE=Workforce WF-7820/7840 Series
usb:v04B9*
ID_VENDOR_FROM_DATABASE=Rainbow Technologies, Inc.
@ -14498,6 +14603,9 @@ usb:v04C5p125A*
usb:v04C5p132E*
ID_MODEL_FROM_DATABASE=fi-7160
usb:v04C5p159F*
ID_MODEL_FROM_DATABASE=ScanSnap iX1500
usb:v04C5p200F*
ID_MODEL_FROM_DATABASE=Sigma DP2 (Mass Storage)
@ -14855,6 +14963,9 @@ usb:v04CBp01D4*
usb:v04CBp01D5*
ID_MODEL_FROM_DATABASE=FinePix F47 (PTP)
usb:v04CBp01E7*
ID_MODEL_FROM_DATABASE=Fujifilm A850 Digital Camera
usb:v04CBp01F7*
ID_MODEL_FROM_DATABASE=FinePix J250 (PTP)
@ -14876,6 +14987,9 @@ usb:v04CBp0278*
usb:v04CBp02C5*
ID_MODEL_FROM_DATABASE=FinePix S9900W Digital Camera (PTP)
usb:v04CBp02E0*
ID_MODEL_FROM_DATABASE=X-T200 Digital Camera
usb:v04CBp5006*
ID_MODEL_FROM_DATABASE=ASK-300
@ -15143,6 +15257,9 @@ usb:v04D9p0022*
usb:v04D9p0348*
ID_MODEL_FROM_DATABASE=Keyboard
usb:v04D9p0407*
ID_MODEL_FROM_DATABASE=Keyboard [TEX Shinobi]
usb:v04D9p048E*
ID_MODEL_FROM_DATABASE=Optical Mouse
@ -15224,6 +15341,9 @@ usb:v04D9pA100*
usb:v04D9pA11B*
ID_MODEL_FROM_DATABASE=Mouse [MX-3200]
usb:v04D9pA153*
ID_MODEL_FROM_DATABASE=Optical Gaming Mouse
usb:v04D9pA29F*
ID_MODEL_FROM_DATABASE=Microarray fingerprint reader
@ -15233,6 +15353,21 @@ usb:v04D9pB534*
usb:v04D9pE002*
ID_MODEL_FROM_DATABASE=MCU
usb:v04D9pFC2A*
ID_MODEL_FROM_DATABASE=Gaming Mouse [Redragon M709]
usb:v04D9pFC30*
ID_MODEL_FROM_DATABASE=Gaming Mouse [Redragon M711]
usb:v04D9pFC38*
ID_MODEL_FROM_DATABASE=Gaming Mouse [Redragon M602-RGB]
usb:v04D9pFC4D*
ID_MODEL_FROM_DATABASE=Gaming Mouse [Redragon M908]
usb:v04D9pFC55*
ID_MODEL_FROM_DATABASE=Venus MMO Gaming Mouse
usb:v04DA*
ID_VENDOR_FROM_DATABASE=Panasonic (Matsushita)
@ -16748,6 +16883,9 @@ usb:v04F2pB1B4*
usb:v04F2pB1B9*
ID_MODEL_FROM_DATABASE=Asus Integrated Webcam
usb:v04F2pB1BB*
ID_MODEL_FROM_DATABASE=2.0M UVC WebCam
usb:v04F2pB1CF*
ID_MODEL_FROM_DATABASE=Lenovo Integrated Camera
@ -16832,6 +16970,12 @@ usb:v04F2pB49F*
usb:v04F2pB563*
ID_MODEL_FROM_DATABASE=Integrated Camera
usb:v04F2pB5AB*
ID_MODEL_FROM_DATABASE=Integrated Camera
usb:v04F2pB5AC*
ID_MODEL_FROM_DATABASE=Integrated IR Camera
usb:v04F2pB5CE*
ID_MODEL_FROM_DATABASE=Integrated Camera
@ -16895,6 +17039,9 @@ usb:v04F3p0381*
usb:v04F3p04A0*
ID_MODEL_FROM_DATABASE=Dream Cheeky Stress/Panic Button
usb:v04F3p0C28*
ID_MODEL_FROM_DATABASE=fingerprint sensor [FeinTech FPS00200]
usb:v04F3p2234*
ID_MODEL_FROM_DATABASE=Touchscreen
@ -17027,6 +17174,12 @@ usb:v04F9p002C*
usb:v04F9p002D*
ID_MODEL_FROM_DATABASE=Printer
usb:v04F9p0037*
ID_MODEL_FROM_DATABASE=HL-3040CN series
usb:v04F9p0038*
ID_MODEL_FROM_DATABASE=HL-3070CW series
usb:v04F9p0039*
ID_MODEL_FROM_DATABASE=HL-5340 series
@ -17567,6 +17720,9 @@ usb:v04F9p01EC*
usb:v04F9p01F4*
ID_MODEL_FROM_DATABASE=MFC-5890CN
usb:v04F9p0204*
ID_MODEL_FROM_DATABASE=DCP-165C
usb:v04F9p020A*
ID_MODEL_FROM_DATABASE=MFC-8670DN
@ -18401,6 +18557,45 @@ usb:v04F9p03BD*
usb:v04F9p03FD*
ID_MODEL_FROM_DATABASE=ADS-2700W
usb:v04F9p043F*
ID_MODEL_FROM_DATABASE=MFC-L3770CDW
usb:v04F9p0440*
ID_MODEL_FROM_DATABASE=MFC-9350CDW
usb:v04F9p0441*
ID_MODEL_FROM_DATABASE=MFC-L3750CDW
usb:v04F9p0442*
ID_MODEL_FROM_DATABASE=MFC-L3745CDW
usb:v04F9p0443*
ID_MODEL_FROM_DATABASE=MFC-L3735CDN
usb:v04F9p0444*
ID_MODEL_FROM_DATABASE=MFC-9150CDN
usb:v04F9p0445*
ID_MODEL_FROM_DATABASE=MFC-L3730CDN
usb:v04F9p0446*
ID_MODEL_FROM_DATABASE=MFC-L3710CW
usb:v04F9p0447*
ID_MODEL_FROM_DATABASE=DCP-9030CDN
usb:v04F9p0448*
ID_MODEL_FROM_DATABASE=DCP-L3550CDW
usb:v04F9p044A*
ID_MODEL_FROM_DATABASE=HL-L3290CDW
usb:v04F9p044B*
ID_MODEL_FROM_DATABASE=DCP-L3510CDW
usb:v04F9p044C*
ID_MODEL_FROM_DATABASE=DCP-L3551CDW
usb:v04F9p1000*
ID_MODEL_FROM_DATABASE=Printer
@ -18473,6 +18668,9 @@ usb:v04F9p2061*
usb:v04F9p2064*
ID_MODEL_FROM_DATABASE=PT-P700 P-touch Label Printer RemovableDisk
usb:v04F9p2074*
ID_MODEL_FROM_DATABASE=PT-D600 P-touch Label Printer
usb:v04F9p209B*
ID_MODEL_FROM_DATABASE=QL-800 Label Printer
@ -19254,7 +19452,7 @@ usb:v0525pA4A4*
ID_MODEL_FROM_DATABASE=Linux-USB user-mode bulk source/sink
usb:v0525pA4A5*
ID_MODEL_FROM_DATABASE=Pocketbook Pro 903 / Mobius 2 Action Cam / xDuoo X3 / PocketBook Pro 602
ID_MODEL_FROM_DATABASE=Linux-USB File-backed Storage Gadget
usb:v0525pA4A6*
ID_MODEL_FROM_DATABASE=Linux-USB Serial Gadget
@ -19271,6 +19469,12 @@ usb:v0525pA4A9*
usb:v0525pA4AA*
ID_MODEL_FROM_DATABASE=Linux-USB CDC Composite Gadge (Ethernet and ACM)
usb:v0525pA4AB*
ID_MODEL_FROM_DATABASE=Linux-USB Multifunction Composite Gadget
usb:v0525pA4AC*
ID_MODEL_FROM_DATABASE=Linux-USB HID Gadget
usb:v0526*
ID_VENDOR_FROM_DATABASE=Temic MHS S.A.
@ -20258,6 +20462,9 @@ usb:v054Cp06BB*
usb:v054Cp06C3*
ID_MODEL_FROM_DATABASE=RC-S380
usb:v054Cp07C3*
ID_MODEL_FROM_DATABASE=ILCE-6000 (aka Alpha-6000) in Mass Storage mode
usb:v054Cp07C4*
ID_MODEL_FROM_DATABASE=ILCE-6000 (aka Alpha-6000) in Mass Storage mode
@ -20267,6 +20474,9 @@ usb:v054Cp082F*
usb:v054Cp0847*
ID_MODEL_FROM_DATABASE=WG-C10 Portable Wireless Server
usb:v054Cp0877*
ID_MODEL_FROM_DATABASE=UP-D898/X898 series
usb:v054Cp0884*
ID_MODEL_FROM_DATABASE=MDR-ZX770BN [Wireless Noise Canceling Stereo Headset]
@ -20300,12 +20510,24 @@ usb:v054Cp0C03*
usb:v054Cp0C34*
ID_MODEL_FROM_DATABASE=ILCE-7M3 [A7III] in PC Remote mode
usb:v054Cp0C7F*
ID_MODEL_FROM_DATABASE=WH-CH700N [Wireless Noise-Canceling Headphones]
usb:v054Cp0CD3*
ID_MODEL_FROM_DATABASE=WH-1000XM3 [Wireless Noise-Canceling Headphones]
usb:v054Cp0CDA*
ID_MODEL_FROM_DATABASE=PlayStation Classic controller
usb:v054Cp0CE0*
ID_MODEL_FROM_DATABASE=WF-1000XM3 [Wireless Noise-Canceling Headphones]
usb:v054Cp0CF0*
ID_MODEL_FROM_DATABASE=MRW-G1
usb:v054Cp0D58*
ID_MODEL_FROM_DATABASE=WH-1000XM4 [Wireless Noise-Canceling Headphones]
usb:v054Cp1000*
ID_MODEL_FROM_DATABASE=Wireless Buzz! Receiver
@ -20438,6 +20660,9 @@ usb:v0557p2221*
usb:v0557p2404*
ID_MODEL_FROM_DATABASE=4-port switch
usb:v0557p2419*
ID_MODEL_FROM_DATABASE=Virtual mouse/keyboard device
usb:v0557p2600*
ID_MODEL_FROM_DATABASE=IDE Bridge
@ -21428,9 +21653,45 @@ usb:v056Dp0002*
usb:v056Dp0003*
ID_MODEL_FROM_DATABASE=Device Bay Controller
usb:v056Dp4000*
ID_MODEL_FROM_DATABASE=FlexScan EV3237
usb:v056Dp4001*
ID_MODEL_FROM_DATABASE=Monitor
usb:v056Dp4002*
ID_MODEL_FROM_DATABASE=USB HID Monitor
usb:v056Dp4014*
ID_MODEL_FROM_DATABASE=FlexScan EV2750
usb:v056Dp4026*
ID_MODEL_FROM_DATABASE=FlexScan EV2451
usb:v056Dp4027*
ID_MODEL_FROM_DATABASE=FlexScan EV2456
usb:v056Dp4036*
ID_MODEL_FROM_DATABASE=FlexScan EV2785
usb:v056Dp4037*
ID_MODEL_FROM_DATABASE=FlexScan EV3285
usb:v056Dp4044*
ID_MODEL_FROM_DATABASE=FlexScan EV2457
usb:v056Dp4059*
ID_MODEL_FROM_DATABASE=FlexScan EV2760
usb:v056Dp405B*
ID_MODEL_FROM_DATABASE=FlexScan EV2460
usb:v056Dp405F*
ID_MODEL_FROM_DATABASE=FlexScan EV2795
usb:v056Dp4065*
ID_MODEL_FROM_DATABASE=FlexScan EV3895
usb:v056E*
ID_VENDOR_FROM_DATABASE=Elecom Co., Ltd
@ -23732,6 +23993,9 @@ usb:v05A3p9320*
usb:v05A3p9331*
ID_MODEL_FROM_DATABASE=Camera
usb:v05A3p9332*
ID_MODEL_FROM_DATABASE=Camera - 1080p
usb:v05A3p9422*
ID_MODEL_FROM_DATABASE=Camera
@ -24392,6 +24656,9 @@ usb:v05ACp8205*
usb:v05ACp8206*
ID_MODEL_FROM_DATABASE=Bluetooth HCI
usb:v05ACp8207*
ID_MODEL_FROM_DATABASE=Built-in Bluetooth
usb:v05ACp820A*
ID_MODEL_FROM_DATABASE=Bluetooth HID Keyboard
@ -24422,6 +24689,9 @@ usb:v05ACp821A*
usb:v05ACp821F*
ID_MODEL_FROM_DATABASE=Built-in Bluetooth 2.0+EDR HCI
usb:v05ACp8233*
ID_MODEL_FROM_DATABASE=iBridge
usb:v05ACp8240*
ID_MODEL_FROM_DATABASE=Built-in IR Receiver
@ -26042,6 +26312,9 @@ usb:v05E3pF103*
usb:v05E3pF104*
ID_MODEL_FROM_DATABASE=VX7012 TV Box
usb:v05E3pF12A*
ID_MODEL_FROM_DATABASE=Digital Microscope
usb:v05E3pFD21*
ID_MODEL_FROM_DATABASE=3M TL20 Temperature Logger
@ -26315,6 +26588,9 @@ usb:v0603p00F1*
usb:v0603p00F2*
ID_MODEL_FROM_DATABASE=Keyboard (Labtec Ultra Flat Keyboard)
usb:v0603p1002*
ID_MODEL_FROM_DATABASE=Mobius actioncam (webcam mode)
usb:v0603p6871*
ID_MODEL_FROM_DATABASE=Mouse
@ -28415,6 +28691,24 @@ usb:v06BCp015E*
usb:v06BCp01C9*
ID_MODEL_FROM_DATABASE=OKI B430 Mono Printer
usb:v06BCp01DB*
ID_MODEL_FROM_DATABASE=MC860 Multifunction Printer
usb:v06BCp01DC*
ID_MODEL_FROM_DATABASE=MC860 Multifunction Printer
usb:v06BCp01DD*
ID_MODEL_FROM_DATABASE=MC860 Multifunction Printer
usb:v06BCp01DE*
ID_MODEL_FROM_DATABASE=MC860 Multifunction Printer
usb:v06BCp01DF*
ID_MODEL_FROM_DATABASE=CX2633 Multifunction Printer
usb:v06BCp01E0*
ID_MODEL_FROM_DATABASE=ES8460 Multifunction Printer
usb:v06BCp020B*
ID_MODEL_FROM_DATABASE=OKI ES4140 Mono Printer
@ -54177,10 +54471,10 @@ usb:v15C2pFFDC*
ID_MODEL_FROM_DATABASE=iMON PAD Remote Controller
usb:v15C5*
ID_VENDOR_FROM_DATABASE=Advance Multimedia Internet Technology Inc. (AMIT)
ID_VENDOR_FROM_DATABASE=Pressure Profile Systems, Inc.
usb:v15C5p0008*
ID_MODEL_FROM_DATABASE=WL532U 802.11g Adapter
ID_MODEL_FROM_DATABASE=Advance Multimedia Internet Technology Inc. (AMIT) WL532U 802.11g Adapter
usb:v15C6*
ID_VENDOR_FROM_DATABASE=Laboratoires MXM
@ -61010,6 +61304,24 @@ usb:v1DE1pC101*
usb:v1DE6*
ID_VENDOR_FROM_DATABASE=MICRORISC s.r.o.
usb:v1DF7*
ID_VENDOR_FROM_DATABASE=SDRplay
usb:v1DF7p2500*
ID_MODEL_FROM_DATABASE=RSP1
usb:v1DF7p3000*
ID_MODEL_FROM_DATABASE=RSP1a
usb:v1DF7p3010*
ID_MODEL_FROM_DATABASE=RSP2/RSP2pro
usb:v1DF7p3020*
ID_MODEL_FROM_DATABASE=RSPduo
usb:v1DF7p3030*
ID_MODEL_FROM_DATABASE=RSPdx
usb:v1E0E*
ID_VENDOR_FROM_DATABASE=Qualcomm / Option
@ -67337,6 +67649,15 @@ usb:v3344*
usb:v3344p3744*
ID_MODEL_FROM_DATABASE=OEM PC Remote
usb:v3384*
ID_VENDOR_FROM_DATABASE=System76
usb:v3384p0000*
ID_MODEL_FROM_DATABASE=Thelio Io (thelio-io)
usb:v3384p0001*
ID_MODEL_FROM_DATABASE=Launch Configurable Keyboard (launch_1)
usb:v348F*
ID_VENDOR_FROM_DATABASE=ISY

View File

@ -5,27 +5,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# This file has been generated using fprint-list-udev-hwdb with all drivers enabled
# Supported by libfprint driver upektc_img
usb:v147Ep2016*
usb:v147Ep2020*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs5011
usb:v138Ap0010*
usb:v138Ap0011*
usb:v138Ap0015*
usb:v138Ap0017*
usb:v138Ap0018*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes3500
usb:v08FFp5731*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes4000
usb:v5501p08FF*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes1610
usb:v08FFp1600*
ID_AUTOSUSPEND=1
@ -50,6 +29,16 @@ usb:v08FFp168E*
usb:v08FFp168F*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes2501
usb:v08FFp2500*
usb:v08FFp2580*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes2550
usb:v08FFp2550*
usb:v08FFp2810*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes2660
usb:v08FFp2660*
usb:v08FFp2680*
@ -71,46 +60,12 @@ usb:v08FFp268F*
usb:v08FFp2691*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes2501
usb:v08FFp2500*
usb:v08FFp2580*
# Supported by libfprint driver aes3500
usb:v08FFp5731*
ID_AUTOSUSPEND=1
# Supported by libfprint driver aes2550
usb:v08FFp2550*
usb:v08FFp2810*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs101
usb:v138Ap0001*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs301
usb:v138Ap0005*
usb:v138Ap0008*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs0050
usb:v138Ap0050*
ID_AUTOSUSPEND=1
# Supported by libfprint driver etes603
usb:v1C7Ap0603*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vcom5s
usb:v061Ap0110*
ID_AUTOSUSPEND=1
# Supported by libfprint driver synaptics
usb:v06CBp00BD*
usb:v06CBp00E9*
usb:v06CBp00DF*
usb:v06CBp00F9*
usb:v06CBp00FC*
usb:v06CBp00C2*
usb:v06CBp00C9*
usb:v06CBp00E7*
# Supported by libfprint driver aes4000
usb:v5501p08FF*
ID_AUTOSUSPEND=1
# Supported by libfprint driver elan
@ -167,8 +122,61 @@ usb:v04F3p0C30*
usb:v04F3p0C31*
usb:v04F3p0C32*
usb:v04F3p0C33*
usb:v04F3p0C3D*
usb:v04F3p0C42*
usb:v04F3p0C4D*
usb:v04F3p0C4F*
usb:v04F3p0C63*
ID_AUTOSUSPEND=1
# Supported by libfprint driver etes603
usb:v1C7Ap0603*
ID_AUTOSUSPEND=1
# Supported by libfprint driver goodixmoc
usb:v27C6p5840*
usb:v27C6p609C*
usb:v27C6p60A2*
usb:v27C6p639C*
usb:v27C6p63AC*
usb:v27C6p6496*
usb:v27C6p6584*
usb:v27C6p658C*
usb:v27C6p6592*
usb:v27C6p6594*
usb:v27C6p659C*
usb:v27C6p6A94*
ID_AUTOSUSPEND=1
# Supported by libfprint driver nb1010
usb:v298Dp1010*
ID_AUTOSUSPEND=1
# Supported by libfprint driver synaptics
usb:v06CBp00BD*
usb:v06CBp00DF*
usb:v06CBp00F9*
usb:v06CBp00FC*
usb:v06CBp00C2*
usb:v06CBp00C9*
usb:v06CBp0100*
usb:v06CBp00F0*
usb:v06CBp0103*
ID_AUTOSUSPEND=1
# Supported by libfprint driver upeksonly
usb:v147Ep2016*
usb:v147Ep1000*
usb:v147Ep1001*
ID_AUTOSUSPEND=1
# Supported by libfprint driver upektc
usb:v0483p2015*
usb:v147Ep3001*
ID_AUTOSUSPEND=1
# Supported by libfprint driver upektc_img
usb:v147Ep2020*
ID_AUTOSUSPEND=1
# Supported by libfprint driver uru4000
@ -180,22 +188,33 @@ usb:v05BAp0008*
usb:v05BAp000A*
ID_AUTOSUSPEND=1
# Supported by libfprint driver upektc
usb:v0483p2015*
usb:v147Ep3001*
# Supported by libfprint driver vcom5s
usb:v061Ap0110*
ID_AUTOSUSPEND=1
# Supported by libfprint driver upeksonly
usb:v147Ep1000*
usb:v147Ep1001*
# Supported by libfprint driver vfs0050
usb:v138Ap0050*
ID_AUTOSUSPEND=1
# Supported by libfprint driver goodixmoc
usb:v27C6p5840*
usb:v27C6p6496*
usb:v27C6p60A2*
usb:v27C6p63AC*
usb:v27C6p639C*
# Supported by libfprint driver vfs101
usb:v138Ap0001*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs301
usb:v138Ap0005*
usb:v138Ap0008*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs5011
usb:v138Ap0010*
usb:v138Ap0011*
usb:v138Ap0015*
usb:v138Ap0017*
usb:v138Ap0018*
ID_AUTOSUSPEND=1
# Supported by libfprint driver vfs7552
usb:v138Ap0091*
ID_AUTOSUSPEND=1
# Known unsupported devices
@ -203,8 +222,8 @@ usb:v04F3p036B*
usb:v04F3p0C00*
usb:v04F3p0C4B*
usb:v04F3p0C4C*
usb:v04F3p0C4F*
usb:v04F3p0C57*
usb:v04F3p0C5E*
usb:v04F3p2706*
usb:v06CBp0081*
usb:v06CBp0088*
@ -215,13 +234,19 @@ usb:v06CBp00A2*
usb:v06CBp00B7*
usb:v06CBp00BB*
usb:v06CBp00BE*
usb:v06CBp00C4*
usb:v06CBp00CB*
usb:v06CBp00D8*
usb:v06CBp00DA*
usb:v06CBp00E9*
usb:v0A5Cp5801*
usb:v0A5Cp5805*
usb:v0A5Cp5834*
usb:v0A5Cp5840*
usb:v0A5Cp5841*
usb:v0A5Cp5842*
usb:v0A5Cp5843*
usb:v0A5Cp5845*
usb:v10A5p0007*
usb:v1188p9545*
usb:v138Ap0007*
@ -230,7 +255,6 @@ usb:v138Ap003C*
usb:v138Ap003D*
usb:v138Ap003F*
usb:v138Ap0090*
usb:v138Ap0091*
usb:v138Ap0092*
usb:v138Ap0094*
usb:v138Ap0097*

View File

@ -55,6 +55,14 @@ usb:v0627p0001:*QEMU USB Mouse*
usb:v0627p0001:*QEMU USB Tablet*
ID_AUTOSUSPEND=1
#########################################
# Sierra Wireless
#########################################
# Sierra Wireless EM7345 4G LTE modem
usb:v1199pA001*
ID_AUTOSUSPEND=1
#########################################
# Wacom
#########################################

View File

@ -265,10 +265,10 @@ evdev:name:AlpsPS/2 ALPS GlidePoint:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE725
# Dell Latitude E7470
evdev:name:AlpsPS/2 ALPS DualPoint TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE7470:*
EVDEV_ABS_00=29:2930:30
EVDEV_ABS_01=26:1533:29
EVDEV_ABS_35=29:2930:30
EVDEV_ABS_36=26:1533:29
EVDEV_ABS_00=29:2930:30:16
EVDEV_ABS_01=26:1533:29:16
EVDEV_ABS_35=29:2930:30:16
EVDEV_ABS_36=26:1533:29:16
# Dell Precision 5510
evdev:name:SynPS/2 Synaptics TouchPad:dmi:bvn*:bvr*:bd*:svnDellInc.:pnPrecision5510:*
@ -560,6 +560,13 @@ evdev:name:AlpsPS/2 ALPS GlidePoint:dmi:*svnLENOVO:*pvrLenovoYoga500-14IBD:*
EVDEV_ABS_35=117:3952:36
EVDEV_ABS_36=105:1960:26
# Lenovo U41-70 (80JV)
evdev:name:AlpsPS/2 ALPS GlidePoint:dmi:*svnLENOVO:*pvrLenovoU41-70:*
EVDEV_ABS_00=117:3958:36
EVDEV_ABS_01=104:1960:26
EVDEV_ABS_35=117:3958:36
EVDEV_ABS_36=104:1960:26
# Lenovo Thinkpad T490 and T14 Gen1
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*:svnLENOVO:*pvrThinkPadT490:*
evdev:name:SynPS/2 Synaptics TouchPad:dmi:*:svnLENOVO:*pvrThinkPadT14Gen1:*

View File

@ -383,8 +383,8 @@ evdev:name:Dell WMI hotkeys:dmi:bvn*:bvr*:bd*:svnDell*:pnPrecision*:*
KEYBOARD_KEY_100150=f20 # Mic mute toggle, should be micmute
# Dell Latitude privacy microphone mute
evdev:name:Dell Privacy Driver:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*:sku0A3E:*
KEYBOARD_KEY_12001=f20 # Mic mute toggle, should be micmute
evdev:name:Dell Privacy Driver:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*:*
KEYBOARD_KEY_120001=f20 # Mic mute toggle, should be micmute
###########################################################
# Everex
@ -623,11 +623,13 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPLicrice:*
# HP EliteBook
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPEliteBook*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteBook*:*
# HP Elite Dragonfly
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteDragonfly*:*
# HP ProBook 440 G2
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP440G2:*
# several HP ProBooks 4xx
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*ProBook4*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHP*ProBook*4*:*
# HP ProBook
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*ProBook*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHP*ProBook*:*
# HP ZBook
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPZBook*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPZBook*:*
@ -684,6 +686,21 @@ evdev:atkbd:dmi:bvn*:bvr*:svnHP*:pnHP*ProBook*645*G4*:*
KEYBOARD_KEY_73=slash # Slash key
KEYBOARD_KEY_f8=wlan # Wireless HW switch button
# HP ProBook 455 G5
evdev:atkbd:dmi:bvn*:bvr*:svnHP*:pnHP*ProBook*455*G5*:*
KEYBOARD_KEY_85=unknown # lid close; also reported via special evdev
KEYBOARD_KEY_f8=wlan # Wireless HW switch button
# HP mt44 Mobile Thin Client
evdev:atkbd:dmi:bvn*:bvr*:svnHP*:pnHP*mt44*Mobile*Thin*Client*:*
KEYBOARD_KEY_64=calendar # Calendar icon (Fn + F12)
KEYBOARD_KEY_6d=displaytoggle # Display icon
KEYBOARD_KEY_66=connect # Pickup phone button → connect → XF86Go
KEYBOARD_KEY_65=cancel # Hangup phone button → cancel → Cancel
KEYBOARD_KEY_81=f20 # Fn+F8; Microphone mute button, should be micmute
KEYBOARD_KEY_85=unknown # lid close; also reported via special evdev
KEYBOARD_KEY_f8=wlan # Wireless HW switch button
# HP Stream 7
# The ACPI tables contains a gpio-keys entry for a non connected GPIO
# causing spurious events, map this to unknown to disable it
@ -863,6 +880,10 @@ evdev:atkbd:dmi:bvn*:bvr*:svnLENOVO*:pn*IdeaPad*Z370*:*
KEYBOARD_KEY_ae=!volumedown
KEYBOARD_KEY_b0=!volumeup
evdev:atkbd:dmi:*:svnLENOVO:*:pvrLenovoYoga300-11IBR:*
KEYBOARD_KEY_62=unknown # Touchpad on, also emitted by "Ideapad extra buttons", ignore
KEYBOARD_KEY_63=unknown # Touchpad off, also emitted by "Ideapad extra buttons", ignore
# Fix for volume keys on Lenovo Yoga S940
# For 10th gen it should be pn81Q8 instead of pn81Q7 but
# I don't have a device to test
@ -896,6 +917,10 @@ evdev:input:b0003v04B3p301B*
KEYBOARD_KEY_90007=mail
KEYBOARD_KEY_90008=www
# Lenovo Ideapad D330-10IGM
evdev:name:SIPODEV Lenovo HID Device:dmi:*:svnLENOVO:*:pvrLenovoideapadD330-10IGM:*
KEYBOARD_KEY_70073=f21 # Fn+Supr (Touchpad toggle)
###########################################################
# Logitech
@ -1236,7 +1261,7 @@ evdev:input:b0003v1532p0200*
KEYBOARD_KEY_c01cb=down # zoomout
###########################################################
# Micro Star
# MSI (aka "Micro Star")
###########################################################
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*:*
@ -1275,24 +1300,19 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*PR200*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:*
KEYBOARD_KEY_e4=reserved
# MSI Prestige15 A10SC specific keycodes. Needed for microphone and screen rotation
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*A10SC*:*
KEYBOARD_KEY_f1=f20
KEYBOARD_KEY_f2=f21
# MSI Modern series
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-StarInternational*:pnModern*:*
KEYBOARD_KEY_f1=f20 # Fn+F5 micmute
KEYBOARD_KEY_76=f21 # Fn+F4 touchpad, becomes meta+ctrl+toggle
# Keymaps MSI Prestige And MSI Modern FnKeys and Special keys
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Prestige*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Modern*:*
KEYBOARD_KEY_56=backslash # Secondary backslash key
KEYBOARD_KEY_f1=f20 # Fn+F5 Micmute
KEYBOARD_KEY_76=f21 # Fn+F4 Toggle touchpad, sends meta+ctrl+toggle
KEYBOARD_KEY_91=prog1 # Fn+F7 Creation Center, sometime F7
KEYBOARD_KEY_f2=prog2 # Fn+F12 screen rotation
KEYBOARD_KEY_97=unknown # lid close
KEYBOARD_KEY_98=unknown # lid open
#Fn+PrntScr sends meta+shif+s
###########################################################
# MSI
###########################################################
KEYBOARD_KEY_f2=prog2 # Fn+F12 Screen rotation
KEYBOARD_KEY_8d=prog3 # Fn+A Change True Color selections
KEYBOARD_KEY_8c=prog4 # Fn+Z Launch True Color
KEYBOARD_KEY_f5=fn_esc # Fn+esc Toggle the behaviour of Fn keys
KEYBOARD_KEY_97=unknown # Lid close
KEYBOARD_KEY_98=unknown # Lid open
evdev:name:MSI Laptop hotkeys:dmi:bvn*:bvr*:bd*:svn*:pnM[iI][cC][rR][oO]-S[tT][aA][rR]*:*
KEYBOARD_KEY_0213=f22

View File

@ -150,6 +150,7 @@ sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP300LJ:*
sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP500LAB:*
sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP500LB:*
sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP550LA:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP300LD:*
@ -344,6 +345,14 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnEVE*:pnEveV:*
sensor:modalias:acpi:KIOX010A*:dmi:*:svnGEO*:pnGeoFlex*:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, 1
#########################################
# Glavey
#########################################
# Glavey TM800A550L
sensor:modalias:acpi:KXCJ9000*:dmi:*:bvrZY-8-BI-PX4S70VTR400-X423B-005-D:*:rvnAMICorporation:rnAptioCRB:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
#########################################
# Google Chromebooks
#########################################
@ -468,6 +477,12 @@ sensor:modalias:acpi:KIOX000A*:dmi:bvnAmericanMegatrendsInc.:*:svnjumper:pnEZpad
sensor:modalias:acpi:KIOX000A*:dmi:bvnINSYDECorp.:bvrVISION.I22K*:svnKAZAM:pnVISION:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
#########################################
# KD / Kurio
#########################################
sensor:modalias:acpi:SMO8500*:dmi:*:svnKDInteractive:pnKurioSmart:*:rnKDM960BCP:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
#########################################
# Lamina
#########################################
@ -497,8 +512,8 @@ sensor:modalias:acpi:BMA250E*:dmi:bvnLENOVO:*:pvrLenovoMIIX3-1030:*
sensor:modalias:acpi:SMO8500*:dmi:bvnLENOVO:*:pvrLenovoMIIX3-830:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
# IdeaPad D330
sensor:modalias:acpi:BOSC0200*:dmi:*:svnLENOVO:pn81H3:*
# IdeaPad D330-10IGM (both 81H3 and 81MD product names)
sensor:modalias:acpi:BOSC0200*:dmi:*:svnLENOVO:*:pvrLenovoideapadD330-10IGM:*
ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
# IdeaPad Miix 300
@ -522,6 +537,16 @@ sensor:modalias:acpi:*BOSC0200*:dmi:*:svnLENOVO*:pn80XE:*
sensor:modalias:acpi:*BOSC0200*:dmi:*:svnLENOVO*:pn80U1:*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
# Yoga 300-11IBR, display sensor
sensor:modalias:acpi:DUAL250E*:dmi:*:svnLENOVO:*:pvrLenovoYoga300-11IBR:*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
ACCEL_LOCATION=display
# Yoga 300-11IBR, base sensor
sensor:modalias:i2c:bmc150_accel:dmi:*:svnLENOVO:*:pvrLenovoYoga300-11IBR:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 1, 0; 0, 0, -1
ACCEL_LOCATION=base
#########################################
# LINX
#########################################
@ -535,6 +560,13 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnLINX*:pnLINX12*64:*
sensor:modalias:acpi:KIOX000A*:dmi:*:svnLINX:pnVISION004:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
#########################################
# Mediacom
#########################################
# Mediacom Winpad 7.0 W700
sensor:modalias:acpi:BMA250*:dmi:*svnMEDIACOM*:pnWinPad7W10-WPW700:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
#########################################
# Medion
#########################################
@ -643,10 +675,20 @@ sensor:modalias:acpi:SMO8500*:dmi:bvnAmericanMegatrendsInc.:bvr5.6.5:bd07/25/201
# One-netbook
#########################################
# One-netbook OneMix 2s
# OneMix 2s has no product name filled, matching entire dmi-alias
sensor:modalias:acpi:BOSC0200*:dmi:bvnAmericanMegatrendsInc.:bvr5.12:bd10/26/2018:br5.12:svnDefaultstring:pnDefaultstring:pvrDefaultstring:rvnDefaultstring:rnDefaultstring:rvrDefaultstring:cvnDefaultstring:ct3:cvrDefaultstring:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
# One-netbook OneMix 3 Pro
sensor:modalias:acpi:BOSC0200*:dmi:*svnONE-NETBOOKTECHNOLOGYCO*:pnOne-Mix3Pro:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
# One-netbook OneMix 3s
# OneMix 3s has no product name filled, matching entire dmi-alias
sensor:modalias:acpi:BOSC0200*:dmi:bvnAmericanMegatrendsInc.:bvr5.12:bd07/17/2019:br5.12:svnDefaultstring:pnDefaultstring:pvrDefaultstring:rvnDefaultstring:rnDefaultstring:rvrDefaultstring:cvnDefaultstring:ct3:cvrDefaultstring:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
#########################################
# Peaq
#########################################
@ -734,6 +776,14 @@ sensor:modalias:acpi:KIOX020A*:dmi:*:svnTECLAST:pnF6Pro:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
ACCEL_LOCATION=base
# Teclast Tbook 11 (E5A6)
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnTbooK11:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
# Teclast X4 2-in-1 (G4M6)
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnX4:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
# Teclast X80 Plus (H5C5)
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTECLAST:pnDefaultstring:*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
@ -766,6 +816,10 @@ sensor:modalias:acpi:BMA250E*:dmi:bvnAmericanMegatrendsInc.:bvr5.6.5:bd04/15/201
# Toshiba
#########################################
# Toshiba Encore WT8-B tablet
sensor:modalias:acpi:INVN6500*:dmi:*:svnTOSHIBA:pnTOSHIBAENCORE2WT8-B:*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
# Toshiba Encore WT10A tablet
sensor:modalias:acpi:INVN6500*:dmi:*:svnTOSHIBA:pnTOSHIBAWT10-A-103:*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1

View File

@ -491,7 +491,9 @@ mouse:bluetooth:v046dpb019:name:MX Master 2S Mouse:*
MOUSE_WHEEL_CLICK_COUNT=24
MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL=14
# Logitech MX Ergo (via Bluetooth)
# Logitech MX Ergo
mouse:usb:v046dp406f:name:Logitech MX Ergo:*
mouse:usb:v046dpc52b:name:Logitech Unifying Device. Wireless PID:406f:*
mouse:bluetooth:v046dpb01d:name:MX Ergo Mouse:*
ID_INPUT_TRACKBALL=1
@ -664,6 +666,10 @@ mouse:bluetooth:v0000p0000:name:Surface Mouse:*
mouse:usb:v045ep0823:name:Microsoft Microsoft?? Classic IntelliMouse??:*
MOUSE_DPI=3200@1000
# Microsoft Pro Intellimouse
mouse:usb:v045ep082a:name:Microsoft Microsoft Pro Intellimouse Mouse:*
MOUSE_DPI=1600@1000
##########################################
# Mionix
##########################################

File diff suppressed because it is too large Load Diff

11
hwdb.d/README Normal file
View File

@ -0,0 +1,11 @@
Files in this directory specify a description of hardware devices, in the form
of mappings from modalias-like keys (which identify specific hardware devices)
to udev properties.
Files in this directory are not read by udev directly. Instead,
man:systemd-hwdb(8) compiles them into a binary database.
See man:hwdb(7) for an overview of the configuration file format, and
man:systemd-udevd.service(8) for a description of the udev daemon.
Use 'systemd-analyze cat-config udev/hwdb.d' to display the effective config.

View File

@ -100,6 +100,14 @@
<tr class="even"><td>CHENGDU HAIGUANG IC DESIGN CO., LTD</td><td>HYGO</td><td>07/15/2020</td> </tr>
<tr class="odd"><td>PixArt imaging inc.</td><td>PIXA</td><td>07/15/2020</td> </tr>
<tr class="even"><td>Loongson Technology Corporation Limited</td><td>LOON</td><td>09/10/2020</td> </tr>
<tr class="odd"><td>Seiko Epson Corporation</td><td>SECC</td><td>02/16/2021</td> </tr>
<tr class="even"><td>Alibaba Co., Ltd.</td><td>BABA</td><td>02/02/2021</td> </tr>
<tr class="odd"><td>Juniper Systems, Inc.</td><td>JSYS</td><td>03/18/2021</td> </tr>
<tr class="even"><td>Framework Computer LLC</td><td>FRMW</td><td>03/22/2021</td> </tr>
<tr class="odd"><td>Pensando Systems, Inc.</td><td>PNSO</td><td>03/24/2021</td> </tr>
<tr class="even"><td>Dynabook Inc.</td><td>DNBK</td><td>06/01/2021</td> </tr>
<tr class="odd"><td>Dioo Microcircuits Co., Ltd. Jiangsu</td><td>DIOO</td><td>06/04/2021</td> </tr>
<tr class="even"><td>Purism SPC</td><td>PURI</td><td>06/10/2021</td> </tr>
</tbody>
</table>
</body>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
# they are very long but quite repetitive and the parser is not very fast.
# So we don't "test" them.
hwdb_files_notest = files('''
README
20-dmi-id.hwdb
20-pci-vendor-model.hwdb
20-pci-classes.hwdb
@ -29,6 +30,7 @@ hwdb_files_test = files('''
70-mouse.hwdb
70-pointingstick.hwdb
70-touchpad.hwdb
80-ieee1394-unit-function.hwdb
'''.split())
if conf.get('ENABLE_HWDB') == 1
@ -49,8 +51,7 @@ if conf.get('ENABLE_HWDB') == 1
mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
meson.add_install_script('sh', '-c',
'test -n "$DESTDIR" || @0@/systemd-hwdb update'
.format(rootbindir))
'test -n "$DESTDIR" || @0@/systemd-hwdb update'.format(rootbindir))
endif
if want_tests != 'false'

View File

@ -72,6 +72,7 @@ TYPES = {'mouse': ('usb', 'bluetooth', 'ps2', '*'),
'joystick': ('i8042', 'rmi', 'bluetooth', 'usb'),
'keyboard': ('name', ),
'sensor': ('modalias', ),
'ieee1394-unit-function' : ('node', ),
}
# Patterns that are used to set general properties on a device
@ -82,6 +83,7 @@ GENERAL_MATCHES = {'acpi',
'sdio',
'vmbus',
'OUI',
'ieee1394',
}
def upperhex_word(length):
@ -99,7 +101,7 @@ def hwdb_grammar():
matchline = (matchline_typed | matchline_general) + EOL
propertyline = (White(' ', exact=1).suppress() +
Combine(UDEV_TAG - '=' - Optional(Word(alphanums + '_=:@*.!-;, "'))
Combine(UDEV_TAG - '=' - Optional(Word(alphanums + '_=:@*.!-;, "/'))
- Optional(pythonStyleComment)) +
EOL)
propertycomment = White(' ', exact=1) + pythonStyleComment + EOL
@ -122,6 +124,9 @@ def property_grammar():
mount_matrix = Group(mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX')
xkb_setting = Optional(Word(alphanums + '+-/@._'))
# Although this set doesn't cover all of characters in database entries, it's enough for test targets.
name_literal = Word(printables + ' ')
props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))),
('MOUSE_WHEEL_CLICK_ANGLE', INTEGER),
('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER),
@ -153,6 +158,11 @@ def property_grammar():
('ACCEL_MOUNT_MATRIX', mount_matrix),
('ACCEL_LOCATION', Or(('display', 'base'))),
('PROXIMITY_NEAR_LEVEL', INTEGER),
('IEEE1394_UNIT_FUNCTION_MIDI', Or((Literal('0'), Literal('1')))),
('IEEE1394_UNIT_FUNCTION_AUDIO', Or((Literal('0'), Literal('1')))),
('IEEE1394_UNIT_FUNCTION_VIDEO', Or((Literal('0'), Literal('1')))),
('ID_VENDOR_FROM_DATABASE', name_literal),
('ID_MODEL_FROM_DATABASE', name_literal),
)
fixed_props = [Literal(name)('NAME') - Suppress('=') - val('VALUE')
for name, val in props]
@ -291,7 +301,7 @@ def print_summary(fname, groups):
error('{}: no matches or props'.format(fname))
if __name__ == '__main__':
args = sys.argv[1:] or sorted(glob.glob(os.path.dirname(sys.argv[0]) + '/[67][0-9]-*.hwdb'))
args = sys.argv[1:] or sorted(glob.glob(os.path.dirname(sys.argv[0]) + '/[678][0-9]-*.hwdb'))
for fname in args:
groups = parse(fname)

File diff suppressed because it is too large Load Diff

View File

@ -108,9 +108,9 @@
<tr class="even"><td>Alpha Telecom Inc</td><td>ATD</td><td>09/26/1997</td> </tr>
<tr class="odd"><td>Alpha-Top Corporation</td><td>ATP</td><td>12/04/1996</td> </tr>
<tr class="even"><td>AlphaView LCD</td><td>ALV</td><td>11/01/2008</td> </tr>
<tr class="odd"><td>Alpine Electronics, Inc.</td><td>APE</td><td>01/22/2013</td> </tr>
<tr class="even"><td>Alps Electric Company Ltd</td><td>ALP</td><td>11/29/1996</td> </tr>
<tr class="odd"><td>Alps Electric Inc</td><td>AUI</td><td>11/29/1996</td> </tr>
<tr class="odd"><td>ALPS ALPINE CO., LTD.</td><td>APE</td><td>01/22/2013</td> </tr>
<tr class="even"><td>ALPS ALPINE CO., LTD.</td><td>ALP</td><td>11/29/1996</td> </tr>
<tr class="odd"><td>ALPS ALPINE CO., LTD.</td><td>AUI</td><td>11/29/1996</td> </tr>
<tr class="even"><td>Alta Research Corporation</td><td>ARC</td><td>11/29/1996</td> </tr>
<tr class="odd"><td>Altec Corporation</td><td>ALC</td><td>08/04/1998</td> </tr>
<tr class="even"><td>Altec Lansing</td><td>ALJ</td><td>01/13/2000</td> </tr>
@ -2466,6 +2466,31 @@
<tr class="even"><td>NZXT (PNP same EDID)_</td><td>NXT</td><td>07/15/2020</td> </tr>
<tr class="odd"><td>Unicompute Technology Co., Ltd.</td><td>UTC</td><td>10/19/2020</td> </tr>
<tr class="even"><td>TECHNOGYM S.p.A.</td><td>TGW</td><td>01/08/2021</td> </tr>
<tr class="odd"><td>Clover Electronics</td><td>CLR</td><td>02/02/2021</td> </tr>
<tr class="even"><td>Kyokko Communication System Co., Ltd.</td><td>KTS</td><td>02/18/2021</td> </tr>
<tr class="odd"><td>Terumo Corporation</td><td>TMO</td><td>02/02/2021</td> </tr>
<tr class="even"><td>Micro-Star Int&#039;l Co., Ltd.</td><td>CND</td><td>02/17/2021</td> </tr>
<tr class="odd"><td>Newline Interactive Inc.</td><td>NWL</td><td>12/03/2020</td> </tr>
<tr class="even"><td>CORSAIR MEMORY Inc.</td><td>CRM</td><td>02/05/2021</td> </tr>
<tr class="odd"><td>aviica</td><td>VAV</td><td>06/01/2021</td> </tr>
<tr class="even"><td>Monoprice.Inc</td><td>DMG</td><td>06/04/2021</td> </tr>
<tr class="odd"><td>Shenzhen KTC Technology Group</td><td>SKG</td><td>06/01/2021</td> </tr>
<tr class="even"><td>Truly Semiconductors Ltd.</td><td>TLY</td><td>06/01/2021</td> </tr>
<tr class="odd"><td>Hitevision Group</td><td>HHT</td><td>03/08/2021</td> </tr>
<tr class="even"><td>DLOGIC Ltd.</td><td>DLM</td><td>06/10/2021</td> </tr>
<tr class="odd"><td>Fun Technology Innovation INC.</td><td>FUL</td><td>06/10/2021</td> </tr>
<tr class="even"><td>Guangxi Century Innovation Display Electronics Co., Ltd</td><td>IOC</td><td>06/10/2021</td> </tr>
<tr class="odd"><td>ICC Intelligent Platforms GmbH</td><td>EMR</td><td>06/10/2021</td> </tr>
<tr class="even"><td>New H3C Technology Co., Ltd.</td><td>NHC</td><td>06/10/2021</td> </tr>
<tr class="odd"><td>Seco S.p.A.</td><td>SCG</td><td>06/10/2021</td> </tr>
<tr class="even"><td>Silent Power Electronics GmbH</td><td>LCP</td><td>06/10/2021</td> </tr>
<tr class="odd"><td>NAFASAE INDIA Pvt. Ltd</td><td>NAF</td><td>06/18/2021</td> </tr>
<tr class="even"><td>Pico Technology Inc.</td><td>PIR</td><td>06/18/2021</td> </tr>
<tr class="odd"><td>Life is Style Inc.</td><td>LIS</td><td>06/18/2021</td> </tr>
<tr class="even"><td>Hansung Co., Ltd</td><td>HSN</td><td>06/18/2021</td> </tr>
<tr class="odd"><td>Hubei Century Joint Innovation Technology Co.Ltd</td><td>TTR</td><td>06/18/2021</td> </tr>
<tr class="even"><td>Zake IP Holdings LLC (3B tech)</td><td>VIO</td><td>06/18/2021</td> </tr>
<tr class="odd"><td>PreSonus Audio Electronics</td><td>PAE</td><td>06/24/2021</td> </tr>
</tbody>
</table>
</body>

View File

@ -9,8 +9,8 @@
# The latest version can be obtained from
# http://www.linux-usb.org/usb.ids
#
# Version: 2021.01.29
# Date: 2021-01-29 20:34:11
# Version: 2021.06.16
# Date: 2021-06-16 20:34:10
#
# Vendors, devices and interfaces. Please keep sorted.
@ -593,6 +593,7 @@
6217 Color LaserJet 4700
6302 PhotoSmart 318/612
6317 Color LaserJet 4730mfp
632a LaserJet M203-M206
6402 PhotoSmart 715 (ptp)
6411 PhotoSmart C8100 series
6417 LaserJet 5200
@ -781,6 +782,7 @@
5642 Storage Device
5661 M5661 MP3 player
5667 M5667 MP3 player
8841 Newmine Camera
9665 Gateway Webcam
0403 Future Technology Devices International, Ltd
0000 H4SMK 7 Port Hub / Bricked Counterfeit FT232 Serial (UART) IC
@ -798,6 +800,7 @@
6014 FT232H Single HS USB-UART/FIFO IC
6015 Bridge(I2C/SPI/UART/FIFO)
601f Myriad-RF LimeSDR-Mini
6ee0 EZO Carrier Board
6f70 HB-RF-USB
8028 Dev board JTAG (FT232H based)
8040 4 Port Hub
@ -820,8 +823,10 @@
9090 SNAP Stick 200
9132 LCD and Temperature Interface
9133 CallerID
9134 Virtual keyboard
9135 Rotary Pub alarm
9136 Pulsecounter
9137 Ledbutton interface
9e90 Marvell OpenRD Base/Client
9f08 CIB-1894 Conclusion SmartLink Box:
9f80 Ewert Energy Systems CANdapter
@ -925,6 +930,7 @@
f7c0 ZeitControl Cardsystems TagTracer MIFARE
f850 USB-UIRT (Universal Infrared Receiver+Transmitter)
f918 Ant8 Logic Probe
f9d9 Wetterempfanger 147.3kHz
fa00 Matrix Orbital USB Serial
fa01 Matrix Orbital MX2 or MX3
fa02 Matrix Orbital MX4 or MX5
@ -1014,6 +1020,7 @@
00c0 Wireless Remocon
00f7 Smart Display PK-SD10
011d e228 Mobile Phone
0193 RVT-R Writer
0203 HID Audio Controls
021d Aterm WL54SU2 802.11g Wireless Adapter [Atheros AR5523]
0248 Aterm PA-WL54GU
@ -1374,6 +1381,7 @@
3220 Sound Blaster Tactic(3D) Sigma sound card
3232 Sound Blaster Premium HD [SBX]
3237 SB X-Fi Surround 5.1 Pro
3241 Sound Blaster JAM
3263 SB X-Fi Surround 5.1 Pro
3f00 E-Mu Xboard 25 MIDI Controller
3f02 E-Mu 0202
@ -1441,6 +1449,7 @@
4088 Live! Cam Chat HD [VF0700]
4095 Live! Cam Sync HD [VF0770]
4097 Live! Cam Chat HD [VF0700]
4099 Creative VF0800 [RealSense Camera SR300]
4100 Nomad Jukebox 2
4101 Nomad Jukebox 3
4102 NOMAD MuVo^2
@ -2004,6 +2013,7 @@
b651 Ferrari GT Rumble Force Wheel
b653 RGT Force Feedback Clutch Racing Wheel
b654 Ferrari GT Force Feedback Wheel
b677 T150 Racing Wheel
b678 T.Flight Rudder Pedals
b679 T-Rudder
b687 TWCS Throttle
@ -2532,6 +2542,7 @@
09a0 RTL8153B GigE [Surface Ethernet Adapter]
09c0 Surface Type Cover
0a00 Lumia 950 Dual SIM (RM-1118)
0b12 Xbox Wireless Controller (model 1914)
930a ISOUSB.SYS Intel 82930 Isochronous IO Test Board
ffca Catalina
fff8 Keyboard
@ -2683,11 +2694,18 @@
0837 BCC950 ConferenceCam
0840 QuickCam Express
0843 Webcam C930e
0845 ConferenceCam CC3000e Camera
0846 ConferenceCam CC3000e Speakerphone
084b ConferenceCam Connect Video
0850 QuickCam Web
0857 Logi Group Speakerphone
085c C922 Pro Stream Webcam
085e BRIO Ultra HD Webcam
0870 QuickCam Express
0882 Logi Group Speakerphone
0890 QuickCam Traveler
0892 OrbiCam
0892 C920 HD Pro Webcam
0893 StreamCam
0894 CrystalCam
0895 QuickCam for Dell Notebooks
0896 OrbiCam
@ -2796,6 +2814,7 @@
0a5b G933 Wireless Headset Dongle
0a5d G933 Headset Battery Charger
0a66 [G533 Wireless Headset Dongle]
0a8f H390 headset with microphone
0b02 C-UV35 [Bluetooth Mini-Receiver] (HID proxy mode)
8801 Video Camera
b014 Bluetooth Mouse M336/M337/M535
@ -2875,6 +2894,7 @@
c083 G403 Prodigy Gaming Mouse
c084 G203 Gaming Mouse
c08b G502 SE HERO Gaming Mouse
c092 G203 LIGHTSYNC Gaming Mouse
c101 UltraX Media Remote
c110 Harmony 785/880/885 Remote
c111 Harmony 525 Remote
@ -2934,6 +2954,7 @@
c24e G500s Laser Gaming Mouse
c24f G29 Driving Force Racing Wheel [PS3]
c260 G29 Driving Force Racing Wheel [PS4]
c262 G920 Driving Force Racing Wheel
c281 WingMan Force
c283 WingMan Force 3D
c285 WingMan Strike Force 3D
@ -2981,6 +3002,7 @@
c332 G502 Proteus Spectrum Optical Mouse
c335 G910 Orion Spectrum Mechanical Keyboard
c33a G413 Gaming Keyboard
c33f G815 Mechanical Keyboard
c401 TrackMan Marble Wheel
c402 Marble Mouse (2-button)
c403 Turbo TrackMan Marble FX
@ -3021,6 +3043,7 @@
c534 Unifying Receiver
c537 Cordless Mouse Receiver
c53a PowerPlay Wireless Charging System
c53d G631 Keyboard
c603 3Dconnexion Spacemouse Plus XT
c605 3Dconnexion CADman
c606 3Dconnexion Spacemouse Classic
@ -3301,6 +3324,8 @@
5001 Cabo I Camera
5002 VideoCam CABO II
5003 VideoCam
8018 Expert Wireless Trackball Mouse (K72359WW)
8068 Pro Fit Ergo Vertical Wireless Trackball
047e Agere Systems, Inc. (Lucent)
0300 ORiNOCO Card
1001 USS720 Parallel Port
@ -3321,6 +3346,7 @@
c008 Audio 655 DSP
c00e Blackwire C310 headset
c03b HD1
ca01 Calisto 800 Series
da60 DA60
0480 Toshiba America Inc
0001 InTouch Module
@ -3362,6 +3388,7 @@
0408 FS-1320D Printer
0640 ECOSYS M6026cdn
069b ECOSYS M2635dn
06b4 ECOSYS M5526cdw
0483 STMicroelectronics
0137 BeWAN ADSL USB ST (blue or green)
0138 Unicorn II (ST70138B + MTC-20174TQ chipset)
@ -3700,6 +3727,7 @@
04ac Xerox Travel Scanner 100
04bb strobe 400 scanner
04cd Xerox Travel Scanner 150
04ee Duplex Combo Scanner
04a8 Multivideo Labs, Inc.
0101 Hub
0303 Peripheral Switch
@ -3906,6 +3934,7 @@
190d CanoScan 9000F Mark II
190e CanoScan LiDE 120
190f CanoScan LiDE 220
1913 CanoScan LiDE 300
2200 CanoScan LiDE 25
2201 CanoScan FB320U
2202 CanoScan FB620U
@ -4367,6 +4396,7 @@
32b4 EOS Rebel T6
32bb EOS M5
32bf PowerShot SX420 IS
32c0 PowerShot ELPH 190IS
32c1 PowerShot ELPH 180 / IXUS 175
32c2 PowerShot SX720 HS
32c5 EOS M6
@ -4443,6 +4473,8 @@
040e DSC D70s (ptp)
040f D200 (mass storage mode)
0410 D200 (ptp)
0411 D80 (mass storage mode)
0412 D80 (MTP/PTP mode)
0413 D40 (mass storage mode)
041e D60 digital camera (mass storage mode)
0422 D700 (ptp)
@ -4496,6 +4528,7 @@
04b4 Cypress Semiconductor Corp.
0001 Mouse
0002 CY7C63x0x Thermometer
0008 CDC ACM serial port
0033 Mouse
0060 Wireless optical mouse
00f3 FX3 micro-controller (DFU mode)
@ -4505,6 +4538,7 @@
0130 MyIRC Remote Receiver
0306 Telephone Receiver
0407 Optical Skype Mouse
0818 AE-SMKD92-* [Thumb Keyboard]
0bad MetaGeek Wi-Spy
1002 CY7C63001 R100 FM Radio
1006 Human Interface Device
@ -4735,6 +4769,7 @@
0e03 Thermal Receipt Printer [TM-T20]
1114 XP-440 [Expression Home Small-in-One Printer]
1129 ET-4750 [WorkForce ET-4750 EcoTank All-in-One]
1168 Workforce WF-7820/7840 Series
04b9 Rainbow Technologies, Inc.
0300 SafeNet USB SuperPro/UltraPro
1000 iKey 1000 Token
@ -4852,6 +4887,7 @@
11f3 fi-6130Z
125a PalmSecure Sensor Device - MP
132e fi-7160
159f ScanSnap iX1500
200f Sigma DP2 (Mass Storage)
2010 Sigma DP2 (PictBridge)
201d SATA 3.0 6Gbit/s Adaptor [GROOVY]
@ -4971,6 +5007,7 @@
01d3 FinePix A920 (PTP)
01d4 FinePix F50fd (PTP)
01d5 FinePix F47 (PTP)
01e7 Fujifilm A850 Digital Camera
01f7 FinePix J250 (PTP)
01fd A160
023e FinePix AX300
@ -4978,6 +5015,7 @@
0241 FinePix S3200 Digital Camera
0278 FinePix JV300
02c5 FinePix S9900W Digital Camera (PTP)
02e0 X-T200 Digital Camera
5006 ASK-300
04cc ST-Ericsson
1122 Hub
@ -5067,6 +5105,7 @@
0006 Wired Keyboard (78/79 key) [RPI Wired Keyboard 5]
0022 Portable Keyboard
0348 Keyboard
0407 Keyboard [TEX Shinobi]
048e Optical Mouse
0499 Optical Mouse
1135 Mouse [MGK-15BU/MLK-15BU]
@ -5094,9 +5133,15 @@
a09f E-Signal LUOM G10 Mechanical Gaming Mouse
a100 Mouse [HV-MS735]
a11b Mouse [MX-3200]
a153 Optical Gaming Mouse
a29f Microarray fingerprint reader
b534 LGT8F328P Microprocessor
e002 MCU
fc2a Gaming Mouse [Redragon M709]
fc30 Gaming Mouse [Redragon M711]
fc38 Gaming Mouse [Redragon M602-RGB]
fc4d Gaming Mouse [Redragon M908]
fc55 Venus MMO Gaming Mouse
04da Panasonic (Matsushita)
0901 LS-120 Camera
0912 SDR-S10
@ -5602,6 +5647,7 @@
b1ac HP Laptop Integrated Webcam [2 MP Fixed]
b1b4 Lenovo Integrated Camera
b1b9 Asus Integrated Webcam
b1bb 2.0M UVC WebCam
b1cf Lenovo Integrated Camera
b1d6 CNF9055 Toshiba Webcam
b1d8 1.3M Webcam
@ -5630,6 +5676,8 @@
b444 Lenovo Integrated Webcam
b49f Bluetooth (RTL8723BE)
b563 Integrated Camera
b5ab Integrated Camera
b5ac Integrated IR Camera
b5ce Integrated Camera
b5cf Integrated IR Camera
b5db HP Webcam
@ -5651,6 +5699,7 @@
02f4 2.4G Cordless Mouse
0381 Touchscreen
04a0 Dream Cheeky Stress/Panic Button
0c28 fingerprint sensor [FeinTech FPS00200]
2234 Touchscreen
04f4 Harting Elektronik, Inc.
04f5 Fujitsu-ICL Systems, Inc.
@ -5695,6 +5744,8 @@
002b HL-5250DN Printer
002c Printer
002d Printer
0037 HL-3040CN series
0038 HL-3070CW series
0039 HL-5340 series
0041 HL-2250DN Laser Printer
0042 HL-2270DW Laser Printer
@ -5875,6 +5926,7 @@
01eb MFC-7320
01ec MFC-9640CW
01f4 MFC-5890CN
0204 DCP-165C
020a MFC-8670DN
020c DCP-9042CDN
020d MFC-9450CDN
@ -6153,6 +6205,19 @@
03bc MFC-L2700DN
03bd DCP-J762N
03fd ADS-2700W
043f MFC-L3770CDW
0440 MFC-9350CDW
0441 MFC-L3750CDW
0442 MFC-L3745CDW
0443 MFC-L3735CDN
0444 MFC-9150CDN
0445 MFC-L3730CDN
0446 MFC-L3710CW
0447 DCP-9030CDN
0448 DCP-L3550CDW
044a HL-L3290CDW
044b DCP-L3510CDW
044c DCP-L3551CDW
1000 Printer
1002 Printer
2002 PTUSB Printing
@ -6177,6 +6242,7 @@
204d QL-720NW Label Printer (mass storage mode)
2061 PT-P700 P-touch Label Printer
2064 PT-P700 P-touch Label Printer RemovableDisk
2074 PT-D600 P-touch Label Printer
209b QL-800 Label Printer
209c QL-810W Label Printer
209d QL-820NWB Label Printer
@ -6437,12 +6503,14 @@
a4a2 Linux-USB Ethernet/RNDIS Gadget
a4a3 Linux-USB user-mode isochronous source/sink
a4a4 Linux-USB user-mode bulk source/sink
a4a5 Pocketbook Pro 903 / Mobius 2 Action Cam / xDuoo X3 / PocketBook Pro 602
a4a5 Linux-USB File-backed Storage Gadget
a4a6 Linux-USB Serial Gadget
a4a7 Linux-USB Serial Gadget (CDC ACM mode)
a4a8 Linux-USB Printer Gadget
a4a9 Linux-USB OBEX Gadget
a4aa Linux-USB CDC Composite Gadge (Ethernet and ACM)
a4ab Linux-USB Multifunction Composite Gadget
a4ac Linux-USB HID Gadget
0526 Temic MHS S.A.
0527 ALTRA
0528 ATI Technologies, Inc.
@ -6772,9 +6840,11 @@
0689 Walkman NWZ-B173F
06bb WALKMAN NWZ-F805
06c3 RC-S380
07c3 ILCE-6000 (aka Alpha-6000) in Mass Storage mode
07c4 ILCE-6000 (aka Alpha-6000) in Mass Storage mode
082f Walkman NWZW Series
0847 WG-C10 Portable Wireless Server
0877 UP-D898/X898 series
0884 MDR-ZX770BN [Wireless Noise Canceling Stereo Headset]
088c Portable Headphone Amplifier
08b7 ILCE-6000 (aka Alpha-6000) in MTP mode
@ -6786,8 +6856,12 @@
0c02 ILCE-7M3 [A7III] in Mass Storage mode
0c03 ILCE-7M3 [A7III] in MTP mode
0c34 ILCE-7M3 [A7III] in PC Remote mode
0c7f WH-CH700N [Wireless Noise-Canceling Headphones]
0cd3 WH-1000XM3 [Wireless Noise-Canceling Headphones]
0cda PlayStation Classic controller
0ce0 WF-1000XM3 [Wireless Noise-Canceling Headphones]
0cf0 MRW-G1
0d58 WH-1000XM4 [Wireless Noise-Canceling Headphones]
1000 Wireless Buzz! Receiver
054d Try Corp.
054e Proside Corp.
@ -6832,6 +6906,7 @@
2213 CS682 2-Port USB 2.0 DVI KVM Switch
2221 Winbond Hermon
2404 4-port switch
2419 Virtual mouse/keyboard device
2600 IDE Bridge
2701 CE700A KVM Extender
4000 DSB-650 10Mbps Ethernet [klsi]
@ -7162,7 +7237,19 @@
0001 Monitor
0002 HID Monitor Controls
0003 Device Bay Controller
4000 FlexScan EV3237
4001 Monitor
4002 USB HID Monitor
4014 FlexScan EV2750
4026 FlexScan EV2451
4027 FlexScan EV2456
4036 FlexScan EV2785
4037 FlexScan EV3285
4044 FlexScan EV2457
4059 FlexScan EV2760
405b FlexScan EV2460
405f FlexScan EV2795
4065 FlexScan EV3895
056e Elecom Co., Ltd
0002 29UO Mouse
0057 Micro Grast Pop M-PGDL
@ -7930,6 +8017,7 @@
9230 Camera
9320 Camera
9331 Camera
9332 Camera - 1080p
9422 Camera
9520 Camera
05a4 Ortek Technology, Inc.
@ -8150,6 +8238,7 @@
8204 Built-in Bluetooth 2.0+EDR HCI
8205 Bluetooth HCI
8206 Bluetooth HCI
8207 Built-in Bluetooth
820a Bluetooth HID Keyboard
820b Bluetooth HID Mouse
820f Bluetooth HCI
@ -8160,6 +8249,7 @@
8218 Bluetooth Host Controller
821a Bluetooth Host Controller
821f Built-in Bluetooth 2.0+EDR HCI
8233 iBridge
8240 Built-in IR Receiver
8241 Built-in IR Receiver
8242 Built-in IR Receiver
@ -8700,6 +8790,7 @@
f102 VX7012 TV Box
f103 VX7012 TV Box
f104 VX7012 TV Box
f12a Digital Microscope
fd21 3M TL20 Temperature Logger
fe00 Razer Mouse
05e4 Red Wing Corp.
@ -8791,6 +8882,7 @@
0002 Sino Wealth keyboard/mouse 2.4 GHz receiver
00f1 Keyboard (Labtec Ultra Flat Keyboard)
00f2 Keyboard (Labtec Ultra Flat Keyboard)
1002 Mobius actioncam (webcam mode)
6871 Mouse
8611 NTK96550 based camera
0604 Jean Co., Ltd
@ -9492,6 +9584,12 @@
00f7 OKI B4600 Mono Printer
015e OKIPOS 411/412 POS Printer
01c9 OKI B430 Mono Printer
01db MC860 Multifunction Printer
01dc MC860 Multifunction Printer
01dd MC860 Multifunction Printer
01de MC860 Multifunction Printer
01df CX2633 Multifunction Printer
01e0 ES8460 Multifunction Printer
020b OKI ES4140 Mono Printer
02bb OKI PT390 POS Printer
0383 MC563 Multifunction Printer
@ -18079,8 +18177,8 @@
0042 Antec Veris Multimedia Station E-Z IR Receiver
ffda iMON PAD Remote Controller
ffdc iMON PAD Remote Controller
15c5 Advance Multimedia Internet Technology Inc. (AMIT)
0008 WL532U 802.11g Adapter
15c5 Pressure Profile Systems, Inc.
0008 Advance Multimedia Internet Technology Inc. (AMIT) WL532U 802.11g Adapter
15c6 Laboratoires MXM
1000 DigistimSP (cold)
1001 DigistimSP (warm)
@ -20357,6 +20455,12 @@
1101 Generic Display Device (Mass storage mode)
c101 Generic Display Device
1de6 MICRORISC s.r.o.
1df7 SDRplay
2500 RSP1
3000 RSP1a
3010 RSP2/RSP2pro
3020 RSPduo
3030 RSPdx
1e0e Qualcomm / Option
f000 iCON 210 UMTS Surfstick
1e10 Point Grey Research, Inc.
@ -22466,6 +22570,9 @@
ffff Mio DigiWalker Sync
3344 Leaguer Microelectronics (LME)
3744 OEM PC Remote
3384 System76
0000 Thelio Io (thelio-io)
0001 Launch Configurable Keyboard (launch_1)
348f ISY
2322 Wireless Presenter
3504 Micro Star

View File

@ -5,8 +5,8 @@ XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share}"
# add a directory if it exists
if [[ -d /opt/foo/share ]]; then
XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS}
XDG_DATA_DIRS="/opt/foo/share:${XDG_DATA_DIRS}"
fi
# write our output
echo XDG_DATA_DIRS=$XDG_DATA_DIRS
echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}"

View File

@ -34,7 +34,7 @@ def rearrange_bin_sbin(path):
if __name__ == '__main__':
path = os.environ['PATH'] # This should be always set.
# If it's not, we'll just crash, we is OK too.
# If it's not, we'll just crash, which is OK too.
new = rearrange_bin_sbin(path)
if new != path:
print('PATH={}'.format(new))

View File

@ -237,6 +237,29 @@
cannot be written. Currently only applies to random seed operations.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--make-machine-id-directory=yes|no|auto</option></term>
<listitem><para>Control creation and deletion of the top-level machine ID directory on the file
system containing boot loader entries (i.e. beneath the file system returned by
<option>--print-boot-path</option> above) during <option>install</option> and
<option>remove</option>, respectively. <literal>auto</literal> is equivalent to
<literal>yes</literal> if <filename>/etc/machine-id</filename> resides on a filesystem other than
tmpfs and <literal>no</literal> otherwise (in the latter case the machine ID is likely transient and
hence should not be used persistently in the ESP). Defaults to <literal>auto</literal>. See
<citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
details about the machine ID concept and file.</para>
<para>Overriding this may be desirable to hide the machine ID from the (unencrypted) ESP, configure a
<citerefentry><refentrytitle>kernel-install</refentrytitle><manvolnum>8</manvolnum></citerefentry>
script, or, conversely, commit a transient machine ID.</para>
<para>The top-level machine ID directory is useful to allow smooth multi-boot installations: each
installed OS instance will have a different machine ID and thus a separate directory to place its
boot-time resources in. If this feature is turned off with this option, care needs to be taken that
multiple OS instances do not place conflicting files on the shared ESP and Extended Boot Loader
Partitions, or that multiple OS instances are not possible.</para></listitem>
</varlistentry>
<xi:include href="standard-options.xml" xpointer="no-pager"/>
<xi:include href="standard-options.xml" xpointer="help"/>
<xi:include href="standard-options.xml" xpointer="version"/>

View File

@ -122,7 +122,7 @@
<varlistentry>
<term><command>emit</command> <arg choice="plain"><replaceable>OBJECT</replaceable></arg> <arg choice="plain"><replaceable>INTERFACE</replaceable></arg> <arg choice="plain"><replaceable>SIGNAL</replaceable></arg> <arg choice="opt"><replaceable>SIGNATURE</replaceable> <arg choice="opt" rep="repeat"><replaceable>ARGUMENT</replaceable></arg></arg></term>
<listitem><para>Emit a signal. Takes a object path, interface name and method name. If parameters
<listitem><para>Emit a signal. Takes an object path, interface name and method name. If parameters
shall be passed, a signature string is required, followed by the arguments, individually formatted as
strings. For details on the formatting used, see below. To specify the destination of the signal,
use the <option>--destination=</option> option.</para></listitem>

35
man/check-os-release.py Normal file
View File

@ -0,0 +1,35 @@
#!/usr/bin/python
import ast
import re
import sys
def read_os_release():
try:
filename = '/etc/os-release'
f = open(filename)
except FileNotFoundError:
filename = '/usr/lib/os-release'
f = open(filename)
for line_number, line in enumerate(f):
line = line.rstrip()
if not line or line.startswith('#'):
continue
if m := re.match(r'([A-Z][A-Z_0-9]+)=(.*)', line):
name, val = m.groups()
if val and val[0] in '"\'':
val = ast.literal_eval(val)
yield name, val
else:
print(f'{filename}:{line_number + 1}: bad line {line!r}',
file=sys.stderr)
os_release = dict(read_os_release())
pretty_name = os_release.get('PRETTY_NAME', 'Linux')
print(f'Running on {pretty_name}')
if 'debian' in [os_release.get('ID', 'linux'),
*os_release.get('ID_LIKE', '').split()]:
print('Looks like Debian!')

10
man/check-os-release.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh -eu
test -e /etc/os-release && os_release='/etc/os-release' || os_release='/usr/lib/os-release'
. "${os_release}"
echo "Running on ${PRETTY_NAME:-Linux}"
if [ "${ID:-linux}" = "debian" ] || [ "${ID_LIKE#*debian*}" != "${ID_LIKE}" ]; then
echo "Looks like Debian!"
fi

View File

@ -35,7 +35,7 @@
<varlistentry id='log-time'>
<term><varname>$SYSTEMD_LOG_TIME</varname></term>
<listitem><para id='log-time-body'>A boolean. If true, log messages will be prefixed with a
<listitem><para id='log-time-body'>A boolean. If true, console log messages will be prefixed with a
timestamp.</para>
<para>This setting is only useful when messages are written directly to the terminal or a file, because
@ -75,7 +75,7 @@
project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<constant>kmsg</constant> (log to the kernel circular log buffer), <constant>journal</constant> (log to
the journal), <constant>journal-or-kmsg</constant> (log to the journal if available, and to kmsg
otherwise), <constant>auto</constant> (dermine the appropriate log target automatically, the default),
otherwise), <constant>auto</constant> (determine the appropriate log target automatically, the default),
<constant>null</constant> (disable log output).</para>
<!-- <constant>syslog</constant>, <constant>syslog-or-kmsg</constant> are deprecated -->
</listitem>

View File

@ -35,7 +35,7 @@
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
a handler for core dumps invoked by the kernel. Whether <command>systemd-coredump</command> is used
is determined by the kernel's
<varname>kernel.core_pattern</varname> <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
<varname>kernel.core_pattern</varname> <citerefentry project='man-pages'><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
setting. See
<citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>
and
@ -86,7 +86,9 @@
<listitem><para>The maximum size in bytes of a core
which will be processed. Core dumps exceeding this size
may be stored, but the backtrace will not be generated.
</para>
Like other sizes in this same config file, the usual
suffixes to the base of 1024 are allowed (B, K, M,
G, T, P, and E.)</para>
<para>Setting <varname>Storage=none</varname> and <varname>ProcessSizeMax=0</varname>
disables all coredump handling except for a log entry.</para>
@ -97,16 +99,19 @@
<term><varname>ExternalSizeMax=</varname></term>
<term><varname>JournalSizeMax=</varname></term>
<listitem><para>The maximum (uncompressed) size in bytes of a
core to be saved.</para></listitem>
<listitem><para>The maximum (compressed or uncompressed) size in bytes of a
core to be saved. Unit suffixes are allowed just as in
<option>ProcessSizeMax=</option></para></listitem>.
</varlistentry>
<varlistentry>
<term><varname>MaxUse=</varname></term>
<term><varname>KeepFree=</varname></term>
<listitem><para>Enforce limits on the disk space taken up by
externally stored core dumps. <option>MaxUse=</option> makes
<listitem><para>Enforce limits on the disk space, specified
in bytes, taken up by externally stored core dumps.
Unit suffixes are allowed just as in <option>ProcessSizeMax=</option>.
<option>MaxUse=</option> makes
sure that old core dumps are removed as soon as the total disk
space taken up by core dumps grows beyond this limit (defaults
to 10% of the total disk size). <option>KeepFree=</option>

View File

@ -354,10 +354,40 @@ Fri … 552351 1000 1000 SIGSEGV present /usr/lib64/firefox/firefox 28.7M
</example>
<example>
<title>Show information about a process that dumped core,
matching by its PID 6654</title>
<title>Show information about a core dump matched by PID</title>
<programlisting>$ coredumpctl info 6654</programlisting>
<programlisting>$ coredumpctl info 6654
PID: 6654 (bash)
UID: 1000 (user)
GID: 1000 (user)
Signal: 11 (SEGV)
Timestamp: Mon 2021-01-01 00:00:01 CET (20s ago)
Command Line: bash -c $'kill -SEGV $$'
Executable: /usr/bin/bash
Control Group: /user.slice/user-1000.slice/…
Unit: user@1000.service
User Unit: vte-spawn-….scope
Slice: user-1000.slice
Owner UID: 1000 (user)
Boot ID: …
Machine ID: …
Hostname: …
Storage: /var/lib/systemd/coredump/core.bash.1000.….zst (present)
Disk Size: 51.7K
Message: Process 130414 (bash) of user 1000 dumped core.
Stack trace of thread 130414:
#0 0x00007f398142358b kill (libc.so.6 + 0x3d58b)
#1 0x0000558c2c7fda09 kill_builtin (bash + 0xb1a09)
#2 0x0000558c2c79dc59 execute_builtin.lto_priv.0 (bash + 0x51c59)
#3 0x0000558c2c79709c execute_simple_command (bash + 0x4b09c)
#4 0x0000558c2c798408 execute_command_internal (bash + 0x4c408)
#5 0x0000558c2c7f6bdc parse_and_execute (bash + 0xaabdc)
#6 0x0000558c2c85415c run_one_command.isra.0 (bash + 0x10815c)
#7 0x0000558c2c77d040 main (bash + 0x31040)
#8 0x00007f398140db75 __libc_start_main (libc.so.6 + 0x27b75)
#9 0x0000558c2c77dd1e _start (bash + 0x31d1e)
</programlisting>
</example>
<example>

View File

@ -514,6 +514,13 @@
user is queried for a password indefinitely.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>headless=</option></term>
<listitem><para>Takes a boolean argument, defaults to false. If true, never query interactively
for the password/PIN. Useful for headless systems.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>verify</option></term>
@ -521,6 +528,22 @@
prevent typos.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>password-echo=yes|no|masked</option></term>
<listitem><para>Controls whether to echo passwords or security token PINs
that are read from console. Takes a boolean or the special string <literal>masked</literal>.
The default is <option>password-echo=masked</option>.</para>
<para>If enabled, the typed characters are echoed literally. If disabled,
the typed characters are not echoed in any form, the user will not get
feedback on their input. If set to <literal>masked</literal>, an asterisk
(<literal>*</literal>) is echoed for each character typed. Regardless of
which mode is chosen, if the user hits the tabulator key (<literal></literal>)
at any time, or the backspace key (<literal></literal>) before any other
data has been entered, then echo is turned off.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>pkcs11-uri=</option></term>
@ -606,7 +629,7 @@
<term><option>fido2-rp=</option></term>
<listitem><para>Takes a string, configuring the FIDO2 Relying Party (rp) for the FIDO2 unlock
operation. If not specified <literal>io.systemd.cryptsetup</literal> is used, except if the the LUKS2
operation. If not specified <literal>io.systemd.cryptsetup</literal> is used, except if the LUKS2
JSON token header contains a different value. It should normally not be necessary to override
this.</para></listitem>
</varlistentry>
@ -645,9 +668,9 @@
<varlistentry>
<term><option>tpm2-pcrs=</option></term>
<listitem><para>Takes a comma separated list of numeric TPM2 PCR (i.e. "Platform Configuration
Register") indexes to bind the TPM2 volume unlocking to. This option is only useful when TPM2
enrollment metadata is not available in the LUKS2 JSON token header already, the way
<listitem><para>Takes a <literal>+</literal> separated list of numeric TPM2 PCR (i.e. "Platform
Configuration Register") indexes to bind the TPM2 volume unlocking to. This option is only useful
when TPM2 enrollment metadata is not available in the LUKS2 JSON token header already, the way
<command>systemd-cryptenroll</command> writes it there. If not used (and no metadata in the LUKS2
JSON token header defines it), defaults to a list of a single entry: PCR 7. Assign an empty string to
encode a policy that binds the key to no PCRs, making the key accessible to local programs regardless

View File

@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!ENTITY MOUNT_PATH @MOUNT_PATH@>
<!ENTITY UMOUNT_PATH @UMOUNT_PATH@>
<!ENTITY systemgeneratordir @SYSTEM_GENERATOR_DIR@>
<!ENTITY usergeneratordir @USER_GENERATOR_DIR@>
<!ENTITY systemenvgeneratordir @SYSTEM_ENV_GENERATOR_DIR@>
<!ENTITY userenvgeneratordir @USER_ENV_GENERATOR_DIR@>
<!ENTITY CERTIFICATE_ROOT @CERTIFICATE_ROOT@>
<!ENTITY FALLBACK_HOSTNAME @FALLBACK_HOSTNAME@>
<!ENTITY MEMORY_ACCOUNTING_DEFAULT @MEMORY_ACCOUNTING_DEFAULT_YES_NO@>
<!ENTITY KILL_USER_PROCESSES @KILL_USER_PROCESSES_YES_NO@>
<!ENTITY DEBUGTTY @DEBUGTTY@>
<!ENTITY RC_LOCAL_PATH @RC_LOCAL_PATH@>
<!ENTITY fedora_latest_version "33">
<!ENTITY MOUNT_PATH "{{MOUNT_PATH}}">
<!ENTITY UMOUNT_PATH "{{UMOUNT_PATH}}">
<!ENTITY SYSTEM_GENERATOR_DIR "{{SYSTEM_GENERATOR_DIR}}">
<!ENTITY USER_GENERATOR_DIR "{{USER_GENERATOR_DIR}}">
<!ENTITY SYSTEM_ENV_GENERATOR_DIR "{{SYSTEM_ENV_GENERATOR_DIR}}">
<!ENTITY USER_ENV_GENERATOR_DIR "{{USER_ENV_GENERATOR_DIR}}">
<!ENTITY CERTIFICATE_ROOT "{{CERTIFICATE_ROOT}}">
<!ENTITY FALLBACK_HOSTNAME "{{FALLBACK_HOSTNAME}}">
<!ENTITY MEMORY_ACCOUNTING_DEFAULT "{{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }}">
<!ENTITY KILL_USER_PROCESSES "{{ 'yes' if KILL_USER_PROCESSES else 'no' }}">
<!ENTITY DEBUGTTY "{{DEBUGTTY}}">
<!ENTITY RC_LOCAL_PATH "{{RC_LOCAL_PATH}}">
<!ENTITY HIGH_RLIMIT_NOFILE "{{HIGH_RLIMIT_NOFILE}}">
<!ENTITY fedora_latest_version "34">
<!ENTITY fedora_cloud_release "1.2">

View File

@ -132,11 +132,17 @@
<refsect1>
<title>Constants</title>
<para>Various constant used and/or defined by systemd.</para>
<para>Various constants used and/or defined by systemd.</para>
<variablelist id='constants' />
</refsect1>
<refsect1>
<title>DNS resource record types</title>
<variablelist id='dns' />
</refsect1>
<refsect1>
<title>Miscellaneous options and directives</title>

View File

@ -43,12 +43,10 @@
<refsect1>
<title>Positive Trust Anchors</title>
<para>Positive trust anchor configuration files contain DNSKEY and
DS resource record definitions to use as base for DNSSEC integrity
proofs. See <ulink
url="https://tools.ietf.org/html/rfc4035#section-4.4">RFC 4035,
Section 4.4</ulink> for more information about DNSSEC trust
anchors.</para>
<para>Positive trust anchor configuration files contain <constant class='dns'>DNSKEY</constant> and
<constant class='dns'>DS</constant> resource record definitions to use as base for DNSSEC integrity
proofs. See <ulink url="https://tools.ietf.org/html/rfc4035#section-4.4">RFC 4035, Section 4.4</ulink>
for more information about DNSSEC trust anchors.</para>
<para>Positive trust anchors are read from files with the suffix
<filename>.positive</filename> located in
@ -64,13 +62,12 @@
<filename>/run/dnssec-trust-anchors.d/</filename> that is either
empty or a symlink to <filename>/dev/null</filename> ("masked").</para>
<para>Positive trust anchor files are simple text files resembling
DNS zone files, as documented in <ulink
url="https://tools.ietf.org/html/rfc1035#section-5">RFC 1035, Section
5</ulink>. One DS or DNSKEY resource record may be listed per
line. Empty lines and lines starting with a semicolon
(<literal>;</literal>) are ignored and considered comments. A DS
resource record is specified like in the following example:</para>
<para>Positive trust anchor files are simple text files resembling DNS zone files, as documented in
<ulink url="https://tools.ietf.org/html/rfc1035#section-5">RFC 1035, Section 5</ulink>. One <constant
class='dns'>DS</constant> or <constant class='dns'>DNSKEY</constant> resource record may be listed per
line. Empty lines and lines starting with <literal>#</literal> or <literal>;</literal> are ignored, which
may be used for commenting. A <consant class='dns'>DS</consant> resource record is specified like in the
following example:</para>
<programlisting>. IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5</programlisting>
@ -85,24 +82,20 @@
Section 5</ulink> for details about the precise syntax and meaning
of these fields.</para>
<para>Alternatively, DNSKEY resource records may be used to define
trust anchors, like in the following example:</para>
<para>Alternatively, <constant class='dns'>DNSKEY</constant> resource records may be used to define trust
anchors, like in the following example:</para>
<programlisting>. IN DNSKEY 257 3 8 AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjFFVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoXbfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaDX6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpzW5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relSQageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulqQxA+Uk1ihz0=</programlisting>
<para>The first word specifies the domain again, the second word
must be <literal>IN</literal>, followed by
<literal>DNSKEY</literal>. The subsequent words encode the DNSKEY
flags, protocol and algorithm fields, followed by the key data
encoded in Base64. See <ulink
url="https://tools.ietf.org/html/rfc4034#section-2">RFC 4034,
Section 2</ulink> for details about the precise syntax and meaning
of these fields.</para>
<para>The first word specifies the domain again, the second word must be <literal>IN</literal>, followed
by <literal>DNSKEY</literal>. The subsequent words encode the <constant class='dns'>DNSKEY</constant>
flags, protocol and algorithm fields, followed by the key data encoded in Base64. See <ulink
url="https://tools.ietf.org/html/rfc4034#section-2">RFC 4034, Section 2</ulink> for details about the
precise syntax and meaning of these fields.</para>
<para>If multiple DS or DNSKEY records are defined for the same
domain (possibly even in different trust anchor files), all keys
are used and are considered equivalent as base for DNSSEC
proofs.</para>
<para>If multiple <constant class='dns'>DS</constant> or <constant class='dns'>DNSKEY</constant> records
are defined for the same domain (possibly even in different trust anchor files), all keys are used and
are considered equivalent as base for DNSSEC proofs.</para>
<para>Note that <filename>systemd-resolved</filename> will
automatically use a built-in trust anchor key for the Internet
@ -112,17 +105,15 @@
as soon as at least one trust anchor key for the root domain is
defined in trust anchor files.</para>
<para>It is generally recommended to encode trust anchors in DS
resource records, rather than DNSKEY resource records.</para>
<para>It is generally recommended to encode trust anchors in <constant class='dns'>DS</constant> resource
records, rather than <constant class='dns'>DNSKEY</constant> resource records.</para>
<para>If a trust anchor specified via a DS record is found revoked
it is automatically removed from the trust anchor database for the
runtime. See <ulink url="https://tools.ietf.org/html/rfc5011">RFC
5011</ulink> for details about revoked trust anchors. Note that
<filename>systemd-resolved</filename> will not update its trust
anchor database from DNS servers automatically. Instead, it is
recommended to update the resolver software or update the new
trust anchor via adding in new trust anchor files.</para>
<para>If a trust anchor specified via a <constant class='dns'>DS</constant> record is found revoked it is
automatically removed from the trust anchor database for the runtime. See <ulink
url="https://tools.ietf.org/html/rfc5011">RFC 5011</ulink> for details about revoked trust anchors. Note
that <filename>systemd-resolved</filename> will not update its trust anchor database from DNS servers
automatically. Instead, it is recommended to update the resolver software or update the new trust anchor
via adding in new trust anchor files.</para>
<para>The current DNSSEC trust anchor for the Internet's root
domain is available at the <ulink

View File

@ -378,6 +378,35 @@
discussion see above.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--fido2-with-client-pin=</option><replaceable>BOOL</replaceable></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require the user to enter
a PIN when unlocking the account (the FIDO2 <literal>clientPin</literal> feature). Defaults to
<literal>yes</literal>. (Note: this setting is without effect if the security token does not support
the <literal>clientPin</literal> feature at all, or does not allow enabling or disabling
it.)</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--fido2-with-user-presence=</option><replaceable>BOOL</replaceable></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require the user to
verify presence (tap the token, the FIDO2 <literal>up</literal> feature) when unlocking the account.
Defaults to <literal>yes</literal>. (Note: this setting is without effect if the security token does not support
the <literal>up</literal> feature at all, or does not allow enabling or disabling it.)
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--fido2-with-user-verification=</option><replaceable>BOOL</replaceable></term>
<listitem><para>When enrolling a FIDO2 security token, controls whether to require user verification
when unlocking the account (the FIDO2 <literal>uv</literal> feature). Defaults to
<literal>no</literal>. (Note: this setting is without effect if the security token does not support
the <literal>uv</literal> feature at all, or does not allow enabling or disabling it.)</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--recovery-key=</option><replaceable>BOOL</replaceable></term>
@ -846,6 +875,10 @@
<title>Exit status</title>
<para>On success, 0 is returned, a non-zero failure code otherwise.</para>
<para>When a command is invoked with <command>with</command>, the exit status of the child is
propagated. Effectively, <command>homectl</command> will exit without error if the command is
successfully invoked <emphasis>and</emphasis> finishes successfully.</para>
</refsect1>
<xi:include href="common-variables.xml" />

View File

@ -63,14 +63,16 @@
<varlistentry>
<term><command>status</command></term>
<listitem><para>Show current system hostname and related information. If no command is specified,
<listitem><para>Show system hostname and related information. If no command is specified,
this is the implied default.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>set-hostname <replaceable>NAME</replaceable></command></term>
<term><command>hostname</command> [<replaceable>NAME</replaceable>]</term>
<listitem><para>Set the system hostname to <replaceable>NAME</replaceable>. By default, this will alter the
<listitem><para>If no argument is given, print the system hostname. If an
optional argument <replaceable>NAME</replaceable> is provided then the command changes the
system hostname to <replaceable>NAME</replaceable>. By default, this will alter the
pretty, the static, and the transient hostname alike; however, if one or more of <option>--static</option>,
<option>--transient</option>, <option>--pretty</option> are used, only the selected hostnames are changed. If
the pretty hostname is being set, and static or transient are being set as well, the specified hostname will be
@ -82,35 +84,29 @@
<para>The static and transient hostnames must each be either a single DNS label (a string composed of
7-bit ASCII lower-case characters and no spaces or dots, limited to the format allowed for DNS domain
name labels), or a sequence of such labels separated by single dots that forms a valid DNS FQDN. The
hostname must be at most 64 characters, which is a Linux limitation (DNS allows longer names).</para>
<para>Pass the empty string <literal></literal> as the hostname to reset the selected hostnames to
their default (usually <literal>&FALLBACK_HOSTNAME;</literal>).</para></listitem>
hostname must be at most 64 characters, which is a Linux limitation (DNS allows longer names).</para></listitem>
</varlistentry>
<varlistentry>
<term><command>set-icon-name <replaceable>NAME</replaceable></command></term>
<term><command>icon-name</command> [<replaceable>NAME</replaceable>]</term>
<listitem><para>Set the system icon name to
<replaceable>NAME</replaceable>. The icon name is used by some
<listitem><para>If no argument is given, print the icon name of the system. If an
optional argument <replaceable>NAME</replaceable> is provided then the command changes the
icon name to <replaceable>NAME</replaceable>. The icon name is used by some
graphical applications to visualize this host. The icon name
should follow the <ulink
url="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon
Naming Specification</ulink>.</para>
<para>Pass an empty string to reset the icon name to the
default value, which is determined from chassis type (see
below) and possibly other parameters.</para></listitem>
Naming Specification</ulink>.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>set-chassis <replaceable>TYPE</replaceable></command></term>
<term><command>chassis</command> [<replaceable>TYPE</replaceable>]</term>
<listitem><para>Set the chassis type to
<replaceable>TYPE</replaceable>. The chassis type is used by
some graphical applications to visualize the host or alter
user interaction. Currently, the following chassis types are
defined:
<listitem><para>If no argument is given, print the chassis type. If an
optional argument <replaceable>TYPE</replaceable> is provided then the command changes the
chassis type to <replaceable>TYPE</replaceable>. The chassis type is used by
some graphical applications to visualize the host or alter user interaction.
Currently, the following chassis types are defined:
<literal>desktop</literal>,
<literal>laptop</literal>,
<literal>convertible</literal>,
@ -123,43 +119,36 @@
<literal>vm</literal> and
<literal>container</literal> for virtualized systems that lack
an immediate physical chassis.</para>
<para>Pass an empty string to reset the chassis type to the
default value which is determined from the firmware and
possibly other parameters.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>set-deployment <replaceable>ENVIRONMENT</replaceable></command></term>
<term><command>deployment</command> [<replaceable>ENVIRONMENT</replaceable>]</term>
<listitem><para>Set the deployment environment description.
<replaceable>ENVIRONMENT</replaceable> must be a single word
without any control characters. One of the following is
suggested:
<listitem><para>If no argument is given, print the deployment environment. If an
optional argument <replaceable>ENVIRONMENT</replaceable> is provided then the command changes the
deployment environment to <replaceable>ENVIRONMENT</replaceable>.
Argument <replaceable>ENVIRONMENT</replaceable>
must be a single word without any control characters. One of the following is suggested:
<literal>development</literal>,
<literal>integration</literal>,
<literal>staging</literal>,
<literal>production</literal>.
</para>
<para>Pass an empty string to reset to the default empty
value.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>set-location <replaceable>LOCATION</replaceable></command></term>
<term><command>location</command> [<replaceable>LOCATION</replaceable>]</term>
<listitem><para>Set the location string for the system, if it
is known. <replaceable>LOCATION</replaceable> should be a
<listitem><para>If no argument is given, print the location string for the system. If an
optional argument <replaceable>LOCATION</replaceable> is provided then the command changes the
location string for the system to <replaceable>LOCATION</replaceable>.
Argument <replaceable>LOCATION</replaceable> should be a
human-friendly, free-form string describing the physical
location of the system, if it is known and applicable. This
may be as generic as <literal>Berlin, Germany</literal> or as
specific as <literal>Left Rack, 2nd Shelf</literal>.</para>
<para>Pass an empty string to reset to the default empty
value.</para>
</listitem>
</varlistentry>
</variablelist>
@ -195,6 +184,7 @@
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
<xi:include href="standard-options.xml" xpointer="json" />
</variablelist>
</refsect1>

View File

@ -74,6 +74,17 @@
<listitem><para>SSL CA certificate.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>NetworkTimeoutSec=</varname></term>
<listitem><para>When network connectivity to the server is lost, this option
configures the time to wait for the connectivity to get restored. If the server is
not reachable over the network for the configured time, <command>systemd-journal-upload</command>
exits. Takes a value in seconds (or in other time units if suffixed with "ms", "min", "h", etc).
For details, see <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -28,6 +28,9 @@
<para><filename>/run/systemd/journald.conf.d/*.conf</filename></para>
<para><filename>/usr/lib/systemd/journald.conf.d/*.conf</filename></para>
<para><filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf</filename></para>
<para><filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
<para><filename>/run/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
<para><filename>/usr/lib/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf.d/*.conf</filename></para>
</refsynopsisdiv>
<refsect1>
@ -41,8 +44,9 @@
<para>The <command>systemd-journald</command> instance managing the default namespace is configured by
<filename>/etc/systemd/journald.conf</filename> and associated drop-ins. Instances managing other
namespaces read <filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf</filename> with
the namespace identifier filled in. This allows each namespace to carry a distinct configuration. See
namespaces read <filename>/etc/systemd/journald@<replaceable>NAMESPACE</replaceable>.conf</filename>
and associated drop-ins with the namespace identifier filled in. This allows each namespace to carry
a distinct configuration. See
<citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
for details about journal namespaces.</para>
</refsect1>
@ -74,6 +78,11 @@
the kernel log buffer, or a syslog socket will still work). Defaults to <literal>auto</literal> in
the default journal namespace, and <literal>persistent</literal> in all others.</para>
<para>Note that journald will initially use volatile storage, until a call to
<command>journalctl --flush</command> (or sending <constant>SIGUSR1</constant> to journald) will cause
it to switch to persistent logging (under the conditions mentioned above). This is done automatically
on boot via <literal>systemd-journal-flush.service</literal>.</para>
<para>Note that when this option is changed to <literal>volatile</literal>, existing persistent data
is not removed. In the other direction,
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> with

View File

@ -113,18 +113,18 @@
<varlistentry>
<term><command>terminate-session</command> <replaceable>ID</replaceable></term>
<listitem><para>Terminates a session. This kills all processes
of the session and deallocates all resources attached to the
session. </para></listitem>
<listitem><para>Terminates a session. This kills all processes of the session and deallocates all
resources attached to the session. If the argument is specified as empty string the session invoking
the command is terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>kill-session</command> <replaceable>ID</replaceable></term>
<listitem><para>Send a signal to one or more processes of the
session. Use <option>--kill-who=</option> to select which
process to kill. Use <option>--signal=</option> to select the
signal to send.</para></listitem>
<listitem><para>Send a signal to one or more processes of the session. Use
<option>--kill-who=</option> to select which process to kill. Use <option>--signal=</option> to
select the signal to send. If the argument is specified as empty string the signal is sent to the
session invoking the command.</para></listitem>
</varlistentry>
</variablelist></refsect2>
@ -184,17 +184,17 @@
<varlistentry>
<term><command>terminate-user</command> <replaceable>USER</replaceable></term>
<listitem><para>Terminates all sessions of a user. This kills
all processes of all sessions of the user and deallocates all
runtime resources attached to the user.</para></listitem>
<listitem><para>Terminates all sessions of a user. This kills all processes of all sessions of the
user and deallocates all runtime resources attached to the user. If the argument is specified as
empty string the sessions of the user invoking the command are terminated.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>kill-user</command> <replaceable>USER</replaceable></term>
<listitem><para>Send a signal to all processes of a user. Use
<option>--signal=</option> to select the signal to send.
</para></listitem>
<listitem><para>Send a signal to all processes of a user. Use <option>--signal=</option> to select
the signal to send. If the argument is specified as empty string the signal is sent to the sessions
of the user invoking the command.</para></listitem>
</varlistentry>
</variablelist></refsect2>

View File

@ -147,15 +147,13 @@
<refsect1>
<title>Relation to OSF UUIDs</title>
<para>Note that the machine ID historically is not an OSF UUID as
defined by <ulink url="https://tools.ietf.org/html/rfc4122">RFC
4122</ulink>, nor a Microsoft GUID; however, starting with systemd
v30, newly generated machine IDs do qualify as v4 UUIDs.</para>
<para>Note that the machine ID historically is not an OSF UUID as defined by <ulink
url="https://tools.ietf.org/html/rfc4122">RFC 4122</ulink>, nor a Microsoft GUID; however, starting with
systemd v30, newly generated machine IDs do qualify as Variant 1 Version 4 UUIDs, as per RFC 4122.</para>
<para>In order to maintain compatibility with existing
installations, an application requiring a UUID should decode the
machine ID, and then apply the following operations to turn it
into a valid OSF v4 UUID. With <literal>id</literal> being an
<para>In order to maintain compatibility with existing installations, an application requiring a strictly
RFC 4122 compliant UUID should decode the machine ID, and then (non-reversibly) apply the following
operations to turn it into a valid RFC 4122 Variant 1 Version 4 UUID. With <literal>id</literal> being an
unsigned character array:</para>
<programlisting>/* Set UUID version to 4 --- truly random generation */

View File

@ -26,10 +26,12 @@ custom_man_xsl = files('custom-man.xsl')
custom_html_xsl = files('custom-html.xsl')
xslt_cmd = [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags
custom_entities_ent = configure_file(
custom_entities_ent = custom_target(
'custom-entities.ent',
input : 'custom-entities.ent.in',
output : 'custom-entities.ent',
configuration : conf)
command : [meson_render_jinja2, config_h, '@INPUT@'],
capture : true)
man_pages = []
html_pages = []
@ -60,7 +62,7 @@ foreach tuple : xsltproc.found() ? manpages : []
input : xml,
output : [man] + manaliases,
command : xslt_cmd + [custom_man_xsl, '@INPUT@'],
depend_files : custom_entities_ent,
depends : custom_entities_ent,
install : want_man,
install_dir : mandirn)
man_pages += p1
@ -70,7 +72,7 @@ foreach tuple : xsltproc.found() ? manpages : []
link = custom_target(
htmlalias,
output : htmlalias,
command : ['ln', '-fs', html, '@OUTPUT@'])
command : [ln, '-fs', html, '@OUTPUT@'])
if want_html
dst = join_paths(docdir, 'html', htmlalias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
@ -85,8 +87,7 @@ foreach tuple : xsltproc.found() ? manpages : []
input : xml,
output : html,
command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
depend_files : custom_entities_ent,
depends : p2,
depends : [custom_entities_ent, p2],
install : want_html,
install_dir : join_paths(docdir, 'html'))
html_pages += p3
@ -112,6 +113,7 @@ systemd_directives_xml = custom_target(
'systemd.directives.xml',
input : ['directives-template.xml', source_xml_files],
output : 'systemd.directives.xml',
depends : custom_entities_ent,
command : [make_directive_index_py, '@OUTPUT@', '@INPUT@'])
nonindex_xml_files = source_xml_files + [systemd_directives_xml]
@ -148,7 +150,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
htmlalias,
input : p2,
output : htmlalias,
command : ['ln', '-fs', html, '@OUTPUT@'])
command : [ln, '-fs', html, '@OUTPUT@'])
if want_html
dst = join_paths(docdir, 'html', htmlalias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
@ -163,8 +165,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
input : xml,
output : html,
command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
depend_files : custom_entities_ent,
depends : p2,
depends : [custom_entities_ent, p2],
install : want_html and have_lxml,
install_dir : join_paths(docdir, 'html'))
html_pages += p3
@ -176,34 +177,39 @@ man = custom_target(
'man',
output : 'man',
depends : man_pages,
command : ['echo'])
command : [echo])
html = custom_target(
'html',
output : 'html',
depends : html_pages,
command : ['echo'])
command : [echo])
run_target(
'doc-sync',
depends : man_pages + html_pages,
command : ['rsync', '-rlv',
'--delete-excluded',
'--include=man',
'--include=*.html',
'--exclude=*',
'--omit-dir-times',
meson.current_build_dir(),
get_option('www-target')])
if rsync.found()
run_target(
'doc-sync',
depends : man_pages + html_pages,
command : [rsync, '-rlv',
'--delete-excluded',
'--include=man',
'--include=*.html',
'--exclude=*',
'--omit-dir-times',
meson.current_build_dir(),
get_option('www-target')])
endif
############################################################
buildroot_substs = configuration_data()
buildroot_substs.set_quoted('BUILD_ROOT', project_build_root)
configure_file(
input : 'man.in',
output : 'man',
configuration : substs)
configuration : buildroot_substs)
configure_file(
input : 'html.in',
output : 'html',
configuration : substs)
configuration : buildroot_substs)

View File

@ -187,14 +187,46 @@
<para>Produces output similar to:
<programlisting>
● State: routable
Address: 10.193.76.5 on eth0
192.168.122.1 on virbr0
169.254.190.105 on eth0
fe80::5054:aa:bbbb:cccc on eth0
Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
DNS: 8.8.8.8
8.8.4.4</programlisting></para>
● State: routable
Online state: online
Address: 10.193.76.5 on eth0
192.168.122.1 on virbr0
169.254.190.105 on eth0
fe80::5054:aa:bbbb:cccc on eth0
Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
DNS: 8.8.8.8
8.8.4.4</programlisting></para>
<para>In the overall network status, the online state depends on the individual online state of all
required links. Managed links are required for online by default. In this case, the online state is
one of the following:
<variablelist>
<varlistentry>
<term>unknown</term>
<listitem>
<para>all links have unknown online status (i.e. there are no required links)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>offline</term>
<listitem>
<para>all required links are offline</para>
</listitem>
</varlistentry>
<varlistentry>
<term>partial</term>
<listitem>
<para>some, but not all, required links are online</para>
</listitem>
</varlistentry>
<varlistentry>
<term>online</term>
<listitem>
<para>all required links are online</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
@ -367,6 +399,7 @@ s - Service VLAN, m - Two-port MAC Relay (TPMR)
</listitem>
</varlistentry>
<xi:include href="standard-options.xml" xpointer="json" />
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
<xi:include href="standard-options.xml" xpointer="no-legend" />

View File

@ -62,12 +62,24 @@
If <varname>SpeedMeter=no</varname>, the value is ignored. Defaults to 10sec.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ManageForeignRoutingPolicyRules=</varname></term>
<listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove rules
that are not configured in .network files (except for rules with protocol
<literal>kernel</literal>). When false, it will not remove any foreign rules, keeping them even
if they are not configured in a .network file. Defaults to yes.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ManageForeignRoutes=</varname></term>
<listitem><para>A boolean. When true, <command>systemd-networkd</command> will store any routes
configured by other tools in its memory. When false, <command>systemd-networkd</command> will
not manage the foreign routes, thus they are kept even if <varname>KeepConfiguration=</varname>
is false. Defaults to yes.</para></listitem>
<listitem><para>A boolean. When true, <command>systemd-networkd</command> will remove routes
that are not configured in .network files (except for routes with protocol
<literal>kernel</literal>, <literal>dhcp</literal> when <varname>KeepConfiguration=</varname>
is true or <literal>dhcp</literal>, and <literal>static</literal> when
<varname>KeepConfiguration=</varname> is true or <literal>static</literal>). When false, it will
not remove any foreign routes, keeping them even if they are not configured in a .network file.
Defaults to yes.</para></listitem>
</varlistentry>
<varlistentry>
@ -86,15 +98,12 @@
</refsect1>
<refsect1>
<title>[DHCP] Section Options</title>
<title>[DHCPv4] Section Options</title>
<para>This section configures the DHCP Unique Identifier (DUID) value used by DHCP
protocol. DHCPv6 client protocol sends the DHCP Unique Identifier and the interface
Identity Association Identifier (IAID) to a DHCP server when acquiring a dynamic IPv6
address. DHCPv4 client protocol sends IAID and DUID to the DHCP server when acquiring
a dynamic IPv4 address if <option>ClientIdentifier=duid</option>. IAID and DUID allows
a DHCP server to uniquely identify the machine and the interface requesting a DHCP IP.
To configure IAID and ClientIdentifier, see
<para>This section configures the DHCP Unique Identifier (DUID) value used by DHCP protocol. DHCPv4
client protocol sends IAID and DUID to the DHCP server when acquiring a dynamic IPv4 address if
<option>ClientIdentifier=duid</option>. IAID and DUID allows a DHCP server to uniquely identify the
machine and the interface requesting a DHCP IP address. To configure IAID and ClientIdentifier, see
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
@ -176,6 +185,28 @@ DUIDRawData=00:00:ab:11:f9:2a:c2:77:29:f9:5c:00</programlisting>
</variablelist>
</refsect1>
<refsect1>
<title>[DHCPv6] Section Options</title>
<para>This section configures the DHCP Unique Identifier (DUID) value used by DHCPv6 protocol.
DHCPv6 client protocol sends the DHCP Unique Identifier and the interface Identity Association
Identifier (IAID) to a DHCPv6 server when acquiring a dynamic IPv6 address. IAID and DUID allows a
DHCPv6 server to uniquely identify the machine and the interface requesting a DHCP IP address. To
configure IAID, see
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
</para>
<para>The following options are understood:</para>
<variablelist class='network-directives'>
<varlistentry>
<term><varname>DUIDType=</varname></term>
<term><varname>DUIDRawData=</varname></term>
<listitem><para>As in the [DHCPv4] section.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>See Also</title>
<para>

View File

@ -51,6 +51,13 @@
ordered by their metric. This assigns a stable hostname to the
current gateway, useful for referencing it independently of the
current network configuration state.</para></listitem>
<listitem><para>The hostname <literal>_outbound</literal> is resolved to the local IPv4 and IPv6
addresses that are most likely used for communication with other hosts. This is determined by
requesting a routing decision to the configured default gateways from the kernel and then using the
local IP addresses selected by this decision. This hostname is only available if there is at least one
local default gateway configured. This assigns a stable hostname to the local outbound IP addresses,
useful for referencing them independently of the current network configuration state.</para></listitem>
</itemizedlist>
<para>Various software relies on an always-resolvable local
@ -84,7 +91,9 @@
<!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
<programlisting>passwd: compat systemd
group: compat [SUCCESS=merge] systemd
shadow: compat
shadow: compat systemd
gshadow: files systemd
# Either (untrusted network, see above):
hosts: mymachines resolve [!UNAVAIL=return] files <command>myhostname</command> dns

View File

@ -39,6 +39,15 @@
Note that the name that is resolved is the one registered with <command>systemd-machined</command>, which
may be different than the hostname configured inside of the container.</para>
<para>Note that this NSS module only makes available names of the containers running immediately below
the current system context. It does not provide host name resolution for containers running side-by-side
with the invoking system context, or containers further up or down the container hierarchy. Or in other
words, on the host system it provides host name resolution for the containers running immediately below
the host environment. When used inside a container environment however, it will not be able to provide
name resolution for containers running on the host (as those are siblings and not children of the current
container environment), but instead only for nested containers running immediately below its own
container environment.</para>
<para>To activate the NSS module, add <literal>mymachines</literal> to the line starting with
<literal>hosts:</literal> in <filename>/etc/nsswitch.conf</filename>.</para>
@ -57,7 +66,8 @@
<!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
<programlisting>passwd: compat systemd
group: compat [SUCCESS=merge] systemd
shadow: compat
shadow: compat systemd
gshadow: files systemd
hosts: <command>mymachines</command> resolve [!UNAVAIL=return] files myhostname dns
networks: files

View File

@ -63,7 +63,8 @@
<!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
<programlisting>passwd: compat systemd
group: compat [SUCCESS=merge] systemd
shadow: compat
shadow: compat systemd
gshadow: files systemd
hosts: mymachines <command>resolve [!UNAVAIL=return]</command> files myhostname dns
networks: files

View File

@ -47,11 +47,56 @@
for resolving users and groups, but also works without the service running.</para>
<para>To activate the NSS module, add <literal>systemd</literal> to the lines starting with
<literal>passwd:</literal> and <literal>group:</literal> in <filename>/etc/nsswitch.conf</filename>.</para>
<literal>passwd:</literal>, <literal>group:</literal>, <literal>shadow:</literal> and
<literal>gshadow:</literal> in <filename>/etc/nsswitch.conf</filename>.</para>
<para>It is recommended to place <literal>systemd</literal> after the <literal>files</literal> or
<literal>compat</literal> entry of the <filename>/etc/nsswitch.conf</filename> lines so that
<filename>/etc/passwd</filename> and <filename>/etc/group</filename> based mappings take precedence.</para>
<filename>/etc/passwd</filename>, <filename>/etc/group</filename>, <filename>/etc/shadow</filename> and
<filename>/etc/gshadow</filename> based mappings take precedence.</para>
</refsect1>
<refsect1>
<title>Static Drop-In JSON User/Group Records</title>
<para>Besides user/group records acquired via the aforementioned Varlink IPC interfaces and the
synthesized root and nobody accounts, this module also makes user and group accounts available to the
system that are defined in static drop-in files in the <filename>/etc/userdb/</filename>,
<filename>/run/userdb/</filename>, <filename>/run/host/userdb/</filename> and
<filename>/usr/lib/userdb/</filename> directories.</para>
<para>This is a simple mechanism to provide static user and group records via JSON drop-in files. Such
user records should be defined in the format described by the <ulink
url="https://systemd.io/USER_RECORD">JSON User Record</ulink> specification and be placed in one of the
aforementioned directories under a file name composed of the user name suffixed with
<filename>.user</filename>, with a world-readable access mode. A symlink named after the user record's
UID formatted in decimal and suffixed with <filename>.user</filename> pointing to the primary record file
should be created as well, in order to allow both lookups by username and by UID. Privileged user record
data (e.g. hashed UNIX passwords) may optionally be provided as well, in a pair of separate companion
files with the <filename>.user-privileged</filename> suffix. The data should be stored in a regular file
named after the user name, suffixed with <filename>.user-privileged</filename>, and a symlink pointing to
it, named after the used numeric UID formatted in decimal with the same suffix. These companion files
should not be readable to anyone but root. Example:</para>
<programlisting>-rw-r--r--. 1 root root 723 May 10 foobar.user
-rw-------. 1 root root 123 May 10 foobar.user-privileged
lrwxrwxrwx. 1 root root 19 May 10 4711.user -> foobar.user
lrwxrwxrwx. 1 root root 19 May 10 4711.user-privileged -> foobar.user-privileged</programlisting>
<para>Similarly, group records following the format described in <ulink
url="https://systemd.io/GROUP_RECORD">JSON Group Record</ulink> may be defined, using the file suffixes
<filename>.group</filename> and <filename>.group-privileged</filename>.</para>
<para>The primary user/group record files (i.e. those with the <filename>.user</filename> and
<filename>.group</filename> suffixes) should not contain the <literal>privileged</literal> section as
described in the specifications. The privileged user/group record files (i.e. those with the
<filename>.user-privileged</filename> and <filename>.group-privileged</filename> suffixes) should
contain this section, exclusively.</para>
<para>Note that static user/group records generally do not override conflicting records in
<filename>/etc/passwd</filename> or <filename>/etc/group</filename> or other account databases. In fact,
before dropping in these files a reasonable level of care should be taken to avoid user/group name and
UID/GID conflicts.</para>
</refsect1>
<refsect1>
@ -63,7 +108,8 @@
<!-- synchronize with other nss-* man pages and factory/etc/nsswitch.conf -->
<programlisting>passwd: compat <command>systemd</command>
group: compat [SUCCESS=merge] <command>systemd</command>
shadow: compat
shadow: compat <command>systemd</command>
gshadow: files <command>systemd</command>
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
networks: files

View File

@ -50,11 +50,11 @@
<varlistentry>
<term><varname>SwapUsedLimit=</varname></term>
<listitem><para>Sets the limit for swap usage on the system before <command>systemd-oomd</command>
will take action. If the fraction of swap used on the system is more than what is defined here,
<command>systemd-oomd</command> will act on eligible descendant control groups, starting from the
ones with the highest swap usage to the lowest swap usage. Which control groups are monitored and
what action gets taken depends on what the unit has configured for
<listitem><para>Sets the limit for memory and swap usage on the system before <command>systemd-oomd</command>
will take action. If the fraction of memory used and the fraction of swap used on the system are both more than
what is defined here, <command>systemd-oomd</command> will act on eligible descendant control groups with swap
usage greater than 5% of total swap, starting from the ones with the highest swap usage. Which
control groups are monitored and what action gets taken depends on what the unit has configured for
<varname>ManagedOOMSwap=</varname>. Takes a value specified in percent (when suffixed with "%"),
permille ("‰") or permyriad ("‱"), between 0% and 100%, inclusive. Defaults to 90%.</para></listitem>
</varlistentry>
@ -81,7 +81,7 @@
<listitem><para>Sets the amount of time a unit's control group needs to have exceeded memory pressure
limits before <command>systemd-oomd</command> will take action. Memory pressure limits are defined by
<varname>DefaultMemoryPressureLimit=</varname> and <varname>ManagedOOMMemoryPressureLimit=</varname>.
Defaults to 30 seconds when this property is unset or set to 0.</para></listitem>
Must be set to 0, or at least 1 second. Defaults to 30 seconds when unset or 0.</para></listitem>
</varlistentry>
</variablelist>

View File

@ -58,6 +58,7 @@ node /org/freedesktop/hostname1 {
in b interactive);
GetProductUUID(in b interactive,
out ay uuid);
Describe(out s json);
properties:
readonly s Hostname = '...';
readonly s StaticHostname = '...';
@ -118,6 +119,8 @@ node /org/freedesktop/hostname1 {
<variablelist class="dbus-method" generated="True" extra-ref="GetProductUUID()"/>
<variablelist class="dbus-method" generated="True" extra-ref="Describe()"/>
<variablelist class="dbus-property" generated="True" extra-ref="Hostname"/>
<variablelist class="dbus-property" generated="True" extra-ref="StaticHostname"/>
@ -190,7 +193,7 @@ node /org/freedesktop/hostname1 {
<para>The <varname>HostnameSource</varname> property exposes the origin of the currently configured
hostname. One of <literal>static</literal> (set from <filename>/etc/hostname</filename>),
<literal>transient</literal> (a non-permanent hostname from an external source),
<literal>default</literal> (the value from <filename>os-release</filename> or the the compiled-in
<literal>default</literal> (the value from <filename>os-release</filename> or the compiled-in
fallback).</para>
<para>The <varname>IconName</varname> property exposes the <emphasis>icon name</emphasis> following the
@ -232,6 +235,17 @@ node /org/freedesktop/hostname1 {
<citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for that. For more information on these files and syscalls see the respective man pages.</para>
<para><varname>KernelName</varname>, <varname>KernelRelease</varname>, and
<varname>KernelVersion</varname> expose the kernel name (e.g. <literal>Linux</literal>), release
(e.g. <literal>5.0.0-11</literal>), and version (i.e. the build number, e.g. <literal>#11</literal>) as
reported by <citerefentry project="man-pages"><refentrytitle>uname</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
<varname>OperatingSystemPrettyName</varname>, <varname>OperatingSystemCPEName</varname>, and
<varname>HomeURL</varname> expose the <varname>PRETTY_NAME=</varname>, <varname>CPE_NAME=</varname> and
<varname>HOME_URL=</varname> fields from
<citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
purpose of those properties is to allow remote clients to access this information over D-Bus. Local
clients can access the information directly.</para>
<refsect2>
<title>Methods</title>
@ -261,22 +275,12 @@ node /org/freedesktop/hostname1 {
<citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
the semantics of those settings.</para>
<para><function>GetProductUUID()</function> returns the "product uuid" as exposed by the kernel based
<para><function>GetProductUUID()</function> returns the "product UUID" as exposed by the kernel based
on DMI information in <filename>/sys/class/dmi/id/product_uuid</filename>. Reading the file directly
requires root privileges, and this method allows access to unprivileged clients through the polkit
framework.</para>
<para><varname>KernelName</varname>, <varname>KernelRelease</varname>, and
<varname>KernelVersion</varname> expose the kernel name (e.g. <literal>Linux</literal>), release
(e.g. <literal>5.0.0-11</literal>), and version (i.e. the build number, e.g. <literal>#11</literal>) as
reported by
<citerefentry project="man-pages"><refentrytitle>uname</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
<varname>OperatingSystemPrettyName</varname>, <varname>OperatingSystemCPEName</varname>, and
<varname>HomeURL</varname> expose the <varname>PRETTY_NAME=</varname>, <varname>CPE_NAME=</varname> and
<varname>HOME_URL=</varname> fields from
<citerefentry><refentrytitle>os-release</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
purpose of those properties is to allow remote clients to access this information over D-Bus. Local
clients can access the information directly.</para>
<para><function>Describe()</function> returns a JSON representation of all properties in one.</para>
</refsect2>
<refsect2>

View File

@ -555,10 +555,13 @@ node /org/freedesktop/login1 {
extendability, defined as follows:</para>
<programlisting>
#define SD_LOGIND_ROOT_CHECK_INHIBITORS (UINT64_C(1) &lt;&lt; 0)
#define SD_LOGIND_KEXEC_REBOOT (UINT64_C(1) &lt;&lt; 1)
</programlisting>
<para> When the <varname>flags</varname> is 0 then these methods behave just like the versions
without flags. When <constant>SD_LOGIND_ROOT_CHECK_INHIBITORS</constant> (0x01) is set, active
inhibitors are honoured for privileged users too.</para>
inhibitors are honoured for privileged users too. When <constant>SD_LOGIND_KEXEC_REBOOT</constant>
(0x02) is set, then <function>RebootWithFlags()</function> perform kexec reboot if kexec
kernel is loaded.</para>
<para><function>SetRebootParameter()</function> sets a parameter for a subsequent reboot operation.
See the description of <command>reboot</command> in

Some files were not shown because too many files have changed in this diff Show More