Commit Graph

29580 Commits

Author SHA1 Message Date
Lennart Poettering 08ef688656 analyze: make testing ConditionPathExistsGlob= work
Fixes: #16439
Alternative-To: #16440
2020-07-14 14:59:18 +02:00
Lennart Poettering 77ee1783eb udevadm: beef up deprecation log warning
Let's add a catalog entry explaining further details.

Most importantly though: talk to PID 1 directly, via the private D-Bus
socket, so that this actually works correctly during early boot, where
D-Bus is not around.
2020-07-14 14:57:19 +02:00
Zbigniew Jędrzejewski-Szmek 46072ae35a repart: include more relevant information in the warning message, fix test
The test would always fail with a long uname. In F33 this is right
now "5.8.0-0.rc2.20200622git625d3449788f.1.fc33.x86_64" which caused the
test to always fail.
2020-07-13 03:43:26 +09:00
Yu Watanabe 5553041a62
Merge pull request #16435 from gaoyi1988/master
fix multi matches when use "||"
2020-07-12 21:46:22 +09:00
Zbigniew Jędrzejewski-Szmek ddcdcac519
Merge pull request #16432 from cgzones/selinux_err_fix
SELlinux followup error/logging fixes
2020-07-12 11:55:44 +02:00
gaoyi 1e67a9c2cd udev: specify the end of value
NULSTR_FOREACH may read the illegal match

Signed-off-by: gaoyi <ymuemc@163.com>
2020-07-12 03:24:42 -04:00
fangxiuning d67b1d18fc bus: use bus_log_parse_error to print message 2020-07-12 06:33:48 +09:00
Christian Göttsche f2df56bfea namespace: unify logging in mount_tmpfs
Fixes: abad72be4d
Follow up: #16426
2020-07-11 21:25:39 +02:00
Christian Göttsche db06c162e8 shared: fix error handling in make_inaccessible_nodes
_label wrappers return -errno on failure instead of returning -1 and
setting global errno.

Fixes: 8d9cbd809d
Follow up: #16426
2020-07-11 21:25:39 +02:00
Zbigniew Jędrzejewski-Szmek b159831b61
Merge pull request #16424 from keszybz/cap-bpf-compat
Handle new capabilities gracefully
2020-07-11 13:35:34 +02:00
Christian Göttsche abad72be4d namespace: fix MAC labels of TemporaryFileSystem=
Reproducible with:
  systemd-run -p TemporaryFileSystem=/root -t /bin/bash
    ls -dZ /root

Prior:
  root:object_r:tmpfs_t:s0 /root
Past:
  root:object_r:user_home_dir_t:s0 /root
2020-07-11 00:09:05 +02:00
Christian Göttsche 8d9cbd809d selinux: create standard user-runtime nodes with default context
Currently systemd-user-runtime-dir does not create the files in
/run/user/$UID/systemd/inaccessible with the default SELinux label.
The user and role part of these labels should be based on the user
related to $UID and not based on the process context of
systemd-user-runtime-dir.

Since v246-rc1 (9664be199a) /run/user/$UID/systemd is also created by
systemd-user-runtime-dir and should also be created with the default
SELinux context.
2020-07-10 21:55:13 +02:00
Christian Göttsche 7a3e4dc38b basic: add helper function mknod_label() 2020-07-10 21:55:13 +02:00
Zbigniew Jędrzejewski-Szmek 5700780389 basic/cap-list: reduce scope of variables 2020-07-10 16:55:24 +02:00
Zbigniew Jędrzejewski-Szmek 864a25d99b basic/capability-util: let cap_last_cap() return unsigned integer
We never return anything higher than 63, so using "long unsigned"
as the type only confused the reader. (We can still use "long unsigned"
and safe_atolu() to parse the kernel file.)
2020-07-10 16:55:24 +02:00
Zbigniew Jędrzejewski-Szmek 417770f303 basic/cap-list: parse/print numerical capabilities
We would refuse to print capabilities which were didn't have a name
for. The kernel adds new capabilities from time to time, most recently
cap_bpf. 'systmectl show -p CapabilityBoundingSet ...' would fail with
"Failed to parse bus message: Invalid argument" because
capability_set_to_string_alloc() would fail with -EINVAL. So let's
print such capabilities in hexadecimal:

CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search
  cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap
  cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin
  cap_net_raw cap_ipc_lock cap_ipc_owner 0x10 0x11 0x12 0x13 0x14 0x15 0x16
  0x17 0x18 0x19 0x1a ...

For symmetry, also allow capabilities that we don't know to be specified.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1853736.
2020-07-10 16:55:24 +02:00
fangxiuning 76fb53c94a install: fix wrong data type 2020-07-10 10:05:39 +02:00
Zbigniew Jędrzejewski-Szmek a127c6208f userdb: fix dlopen call
The call would always fail with:
systemd-userwork[780]: Failed to dlopen(libnss_systemd.so.2), ignoring: /usr/lib64libnss_systemd.so.2: cannot open shared object file: No such file or directory
2020-07-09 07:55:56 +02:00
Zbigniew Jędrzejewski-Szmek 55aacd502b
Merge pull request #15891 from bluca/host_os_release
Container Interface: expose the host's os-release metadata to nspawn and portable guests
2020-07-08 23:52:13 +02:00
Zbigniew Jędrzejewski-Szmek 48c190822b Merge pull request #16405 from sipraga/master 2020-07-08 22:32:04 +02:00
Zbigniew Jędrzejewski-Szmek 02b0109af5
Merge pull request #15955 from anitazha/nullorempty
core: check null_or_empty_path for masked units instead of /dev/null
2020-07-08 22:18:17 +02:00
Alvin Šipraga 0d0de133f0 network: add support for MACVLAN source mode
Add support for creating a MACVLAN interface in "source" mode by
specifying Mode=source in the [MACVLAN] section of a .netdev file.

A list of allowed MAC addresses for the corresponding MACVLAN can also
be specified with the SourceMACAddress= option of the [MACVLAN] section.

An example .netdev file:

    [NetDev]
    Name=macvlan0
    Kind=macvlan
    MACAddress=02:DE:AD:BE:EF:00

    [MACVLAN]
    Mode=source
    SourceMACAddress=02:AB:AB:AB:AB:01 02:CD:CD:CD:CD:01
    SourceMACAddress=02:EF:EF:EF:EF:01

The same keys can also be specified in [MACVTAP] for MACVTAP kinds of
interfaces, with the same semantics.
2020-07-08 18:01:52 +02:00
Lennart Poettering 24e2494407
Merge pull request #16385 from JackFangXN/master
table add table_log_xx_error()
2020-07-08 12:12:29 +02:00
Yu Watanabe 43b24a0716 sd-device: use log_device_debug_errno() 2020-07-08 12:11:19 +02:00
fangxiuning 4b6607d949 table use table_log_print_error() instead of table_log_show_error 2020-07-08 15:16:52 +08:00
fangxiuning df83eb546b table add table_log_sort_error() 2020-07-08 10:53:57 +08:00
fangxiuning d836018a73 table add table_log_show_error() 2020-07-08 10:50:59 +08:00
Yu Watanabe c253a95bca
Merge pull request #16379 from yuwata/network-dhcp6-delegated-prefix-address-handler
network: fix assertion in assigning dhcp6 delegated prefix
2020-07-08 10:22:08 +09:00
Zbigniew Jędrzejewski-Szmek 2e2f6a01a0
Merge pull request #16143 from fbuihuu/fstab-generator-fix
fstab-generator: make sure explicit deps configured via mount options apply to .mount, not .automount unit
2020-07-07 20:06:18 +02:00
Alan Perry 5dc60faae5 add error message when bind mount src missing 2020-07-07 20:04:19 +02:00
Yu Watanabe 3650173fec network: make address_handler() static 2020-07-07 19:48:38 +02:00
Yu Watanabe a211ff4b84 network: introduce own address handler for dhcp6 delegated prefix
Fixes #16365.
2020-07-07 19:48:26 +02:00
Zbigniew Jędrzejewski-Szmek 2b0bf3ccf8
Merge pull request #16301 from poettering/firstboot-image
Add --image= switch to firstboot, similar to --root= but with support for operating on disk image
2020-07-07 19:44:12 +02:00
Zbigniew Jędrzejewski-Szmek 9870cfdf7f
Merge pull request #16388 from keszybz/xdg-desktop-fuzz-case
xdg-desktop fuzz case
2020-07-07 19:41:31 +02:00
Zbigniew Jędrzejewski-Szmek dea7f5cc87 xdg-autostart: ignore all empty entries in multi-string entries
The desktop file specification allows entries like ";;;;;;", full of empty strings.
But looking at the actual list of supported keys [1], empty entries are meaningless
(unless we would allow e.g. the desktop name to be the empty string. But that doesn't
seem very useful either). So let's just simplify our life and skip any empty substrings
entirely.

This would also resolve the fuzzer case:
$ valgrind build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812
test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812... ok
==2899241== HEAP SUMMARY:
==2899241==     in use at exit: 0 bytes in 0 blocks
==2899241==   total heap usage: 484,385 allocs, 484,385 frees, 12,411,330 bytes allocated
↓
==2899650== HEAP SUMMARY:
==2899650==     in use at exit: 0 bytes in 0 blocks
==2899650==   total heap usage: 1,325 allocs, 1,325 frees, 1,463,602 bytes allocated
2020-07-07 14:02:16 +02:00
Zbigniew Jędrzejewski-Szmek d1ca1f7c2a xdg-autostart: avoid quadratic behaviour in strv parsing
The fuzzer test case has a giant line with ";;;;;;;;;;;..." which is turned into
a strv of empty strings. Unfortunately, when pushing each string, strv_push() needs
to walk the whole array, which leads to quadratic behaviour. So let's use
greedy_allocation here and also keep location in the string to avoid iterating.

build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812  51.10s user 0.01s system 99% cpu 51.295 total
↓
build/fuzz-xdg-desktop test/fuzz/fuzz-xdg-desktop/oss-fuzz-22812  0.07s user 0.01s system 96% cpu 0.083 total

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22812.

Other minor changes:
- say "was already defined" instead of "defined multiple times" to make it
  clear that we're ignoring this second definition, and not all definitions
  of the key
- unescaping needs to be done also for the last entry
2020-07-07 12:20:43 +02:00
Zbigniew Jędrzejewski-Szmek a53f024d71 journald: minor wording tweak in message
For a user "from the kernel" might be rather unclear.
2020-07-07 12:14:41 +02:00
Zbigniew Jędrzejewski-Szmek cd990847b9 tree-wide: more repeated words 2020-07-07 12:08:22 +02:00
Zbigniew Jędrzejewski-Szmek 0da425df65 networkd: use capitalized "IP" and "TOS" in messages 2020-07-07 12:06:26 +02:00
Zbigniew Jędrzejewski-Szmek 8ab0f03266 journal/compress: drop "future" code in zstd compression
We generally don't include stuff that is not used. This can be
easily ressurected if ever needed.

Fixes CID#1430210.
2020-07-07 12:06:26 +02:00
Yuri Chornoivan d7b34e3841 all: fix minor typos
[thaller@redhat.com: original patch by Yuri, extracted from [1]]

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/565
2020-07-07 18:52:49 +09:00
Lennart Poettering a122502077 firstboot: add option to turn off welcome text display 2020-07-07 11:20:42 +02:00
Lennart Poettering 3ff9fa591e firstboot: add --image= switch
This is like --root=, but takes an image file path or device node path
and dissects the image directly, mounting it internally.
2020-07-07 11:20:42 +02:00
Lennart Poettering 827ea52125 mount-util: use UMOUNT_NOFOLLOW in recursive umounter
When we only want to unmount mount points below some path then it is
against our interest to follow symlinks. Hence don't.
2020-07-07 11:20:42 +02:00
Lennart Poettering e49ee28522 mount-util: add destructor helper that umounts + rmdirs a path 2020-07-07 11:20:42 +02:00
Lennart Poettering e2ec9c4d3a namespace-util: introduce helper for combining unshare() + MS_SLAVE remount
We have multiple places we do these two non-trivial operations together,
let's introduce a unified helper for doing both at once.
2020-07-07 11:20:42 +02:00
Luca Boccassi cda667722c core: refresh unit cache when building a transaction if UNIT_NOT_FOUND
When a command asks to load a unit directly and it is in state
UNIT_NOT_FOUND, and the cache is outdated, we refresh it and
attempto to load again.
Use the same logic when building up a transaction and a dependency in
UNIT_NOT_FOUND state is encountered.
Update the unit test to exercise this code path.
2020-07-07 10:09:24 +02:00
Zbigniew Jędrzejewski-Szmek 3f2e15abc5 sleep: one spelling unification
We use "writable" everywhere else.
2020-07-07 10:02:02 +02:00
Zbigniew Jędrzejewski-Szmek 77ecc1aaa5
Merge pull request #16380 from yuwata/network-dhcp6-update-prefix-route
Network: update acquired dhcp6 prefix routes
2020-07-07 09:05:08 +02:00
Zbigniew Jędrzejewski-Szmek 9389a271b7
Merge pull request #16381 from yuwata/dhcp4-renewing
dhcp4: fixes around renewing address
2020-07-07 08:59:35 +02:00