Commit Graph

45752 Commits

Author SHA1 Message Date
Evgeny Vereshchagin d3e0662c7d Revert "ci: turn off the "upstream-systemd-ci" ppa"
This reverts commit d4ff79bbe1.
2020-07-15 08:59:25 +02:00
Filipe Brandenburger 06bb441102 test: Add "finish" rule to .PHONY 2020-07-15 08:58:46 +02:00
Zbigniew Jędrzejewski-Szmek 76830e2500
Merge pull request #16462 from keszybz/rpm-macro-warnings
Emit better errors for rpm macro misuse
2020-07-15 08:56:28 +02:00
Evgeny Vereshchagin d4ff79bbe1 ci: turn off the "upstream-systemd-ci" ppa
Judging by https://launchpad.net/~upstream-systemd-ci/+archive/ubuntu/systemd-ci/+packages,
it got updated about 15 hours ago and the "build check" action has been
failing with
```
The following packages have unmet dependencies:
 kbd : Depends: console-setup but it is not going to be installed or
E: Unable to correct problems, you have held broken packages.
                console-setup-mini but it is not going to be installed
```
since then
2020-07-14 21:35:33 +03:00
Zbigniew Jędrzejewski-Szmek 6cdc429454
Merge pull request #16340 from keszybz/var-tmp-readonly
Create ro private /var/tmp dir when /var/tmp is read-only
2020-07-14 19:59:48 +02:00
Zbigniew Jędrzejewski-Szmek 56a13a495c pid1: create ro private tmp dirs when /tmp or /var/tmp is read-only
Read-only /var/tmp is more likely, because it's backed by a real device. /tmp
is (by default) backed by tmpfs, but it doesn't have to be. In both cases the
same consideration applies.

If we boot with read-only /var/tmp, any unit with PrivateTmp=yes would fail
because we cannot create the subdir under /var/tmp to mount the private directory.
But many services actually don't require /var/tmp (either because they only use
it occasionally, or because they only use /tmp, or even because they don't use the
temporary directories at all, and PrivateTmp=yes is used to isolate them from
the rest of the system).

To handle both cases let's create a read-only directory under /run/systemd and
mount it as the private /tmp or /var/tmp. (Read-only to not fool the service into
dumping too much data in /run.)

$ sudo systemd-run -t -p PrivateTmp=yes bash
Running as unit: run-u14.service
Press ^] three times within 1s to disconnect TTY.
[root@workstation /]# ls -l /tmp/
total 0
[root@workstation /]# ls -l /var/tmp/
total 0
[root@workstation /]# touch /tmp/f
[root@workstation /]# touch /var/tmp/f
touch: cannot touch '/var/tmp/f': Read-only file system

This commit has more changes than I like to put in one commit, but it's touching all
the same paths so it's hard to split.
exec_runtime_make() was using the wrong cleanup function, so the directory would be
left behind on error.
2020-07-14 19:47:15 +02:00
Zbigniew Jędrzejewski-Szmek 1061fc1c17 rpm: include macro name in errors for two args macros too 2020-07-14 19:22:42 +02:00
Zbigniew Jędrzejewski-Szmek 281014b73e rpm: adjust various macros to print macro name in the error message
Based on initial patch by Jan Engelhardt <jengelh@inai.de>.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1856122.
2020-07-14 19:21:12 +02:00
Zbigniew Jędrzejewski-Szmek 8800df5f71
Merge pull request #16430 from mikhailnov/fix-rpm-create-package-macros
Fix RPM *_create_package macros
2020-07-14 19:02:09 +02:00
Lennart Poettering 16a4a2f8cc update TODO 2020-07-14 15:06:29 +02:00
Lennart Poettering 08ef688656 analyze: make testing ConditionPathExistsGlob= work
Fixes: #16439
Alternative-To: #16440
2020-07-14 14:59:18 +02:00
Lennart Poettering 4519c7c706 update TODO 2020-07-14 14:57:19 +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 a18c7865be meson: do not install testdata when -Dinstall-tests=false
Fixes #16447.
2020-07-14 14:57:04 +02:00
szb512 60b45a80c1 Update .clang-format 2020-07-13 18:08:09 +02:00
szb512 5b72b34708 Make the instructions slightly easier to read 2020-07-13 18:08:09 +02:00
Evgeny Vereshchagin 8ba6c15a82
Merge pull request #16437 from systemd/coverity-gcc-10
coverity: switch back to Fedora 31
2020-07-13 01:42:39 +03:00
Evgeny Vereshchagin b7067c4d87 coverity: install systemd
Apparently systemd is no longer installed in fedora containers
by default

```
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348:
starting container process caused "exec: \"/sbin/init\": stat /sbin/init: no such file or directory": unknown.
The command "$CI_MANAGERS/fedora.sh SETUP" failed and exited with 127 during .
```
2020-07-12 22:26:19 +00:00
Evgeny Vereshchagin 1374448add coverity: switch back to Fedora 31
Apparently 6 days ago fedora:latest started to point to fedora:32,
which comes with gcc-10. Coverity doesn't support it yet.
2020-07-12 22:00:16 +00: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
Yu Watanabe 6b949d2605 NEWS: mention source mode for MACVLAN or MACVTAP 2020-07-12 11:57:53 +02: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 0d3a8bc7eb test: add test case for multi matches when use "||"
Signed-off-by: gaoyi <ymuemc@163.com>
2020-07-12 03:27:45 -04: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
Mikhail Novosyolov 3e6e0856cd rpm: avoid hiding errors and output in *_create_package macros
Commit b0ca726585 "rpm: avoid hiding errors from systemd commands" remove hiding errors and output
for other macros, but did not do that for %sysusers_create_package and %tmpfiles_create_package.

This change syncs their behaviour with %sysusers_create and %tmpfiles_create

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2020-07-11 17:20:23 +03:00
Mikhail Novosyolov 93406fd379 rpm: avoid odd symbols in EOF indicator
The last line in this macros was actually "SYSTEMD_INLINE_EOF " with a space at the end,
but the shell was instructed to look for a line without space.

Macros %sysusers_create_inline and %tmpfiles_create_inline did not have this mistake.

An example:
[root@rosa-2019 bind-server]# cat /etc/passwd | grep named
[root@rosa-2019 bind-server]# cat /tmp/bs
systemd-sysusers --replace=/usr/lib/sysusers.d/named.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || :
u named - "BIND DNS Server" /var/lib/named
g named - -
m named named
SYSTEMD_INLINE_EOF
[root@rosa-2019 bind-server]# sh /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash --version
GNU bash, version 5.0.17(1)-release (x86_64-openmandriva-linux-gnu)

The user and group named were NOT created!

Now I remove the trailing space after "SYSTEMD_INLINE_EOF" and rerun:
[root@rosa-2019 bind-server]# sh /tmp/bs
[root@rosa-2019 bind-server]# tail -n 1 /etc/group
named485:named
[root@rosa-2019 bind-server]#

The user and group have been created correctly.

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2020-07-11 17:20:16 +03: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
Zbigniew Jędrzejewski-Szmek b0ff0eaa01
Merge pull request #16426 from cgzones/run_user_label
selinux: create standard user-runtime nodes with default context
2020-07-11 13:32:00 +02:00
Anita Zhang 675fa6ea28 man: fix some manvolnum 2020-07-11 13:26:52 +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
Clinton Roy 5149990e1f
NEWS: grammar improvements (#16413) 2020-07-10 18:58:30 +02:00
Filippo Falezza 5c53766f28 Added MSI Prestige15 A10SC specific keycodes
This commit enables the microphone mute button and the screen rotate button, even if the latter is improperly linked. I have documented how to achieve this in https://wiki.archlinux.org/index.php/MSI_P15#Fn_Keys .
2020-07-10 18:55:30 +02:00
Surhud More d0571b758b Add support for HP Elitebook x360 1040 G6 micmute button 2020-07-10 18:53:32 +02:00
Florian Mayer ed1de7108e Explain how to determine hierarchy type from shell
This makes it easier for people than just recommending the syscall.
2020-07-10 18:52:22 +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
Lennart Poettering a38c68a18a NEWS: drop duplicate entry, add --image= entry 2020-07-10 10:04:37 +02:00
Zbigniew Jędrzejewski-Szmek 976efe1b80 NEWS: add date 2020-07-09 08:35:37 +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
Yu Watanabe 5157d719f0
Merge pull request #16411 from ddstreet/bridge_without_carrier_fails
Bridge without carrier fails
2020-07-09 14:01:45 +09:00
Zbigniew Jędrzejewski-Szmek 5961d35a5b NEWS: add blurb about os-release and $container_host_* 2020-07-09 00:02:55 +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