1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

core: do not prepare a SELinux context for dummy files for devicenode bind-mounting

Let systemd create the dummy file where a device node will be mounted on with the default label for the parent directory (e.g. /tmp/namespace-dev-yTMwAe/dev/).

Fixes: #13762
This commit is contained in:
Christian Göttsche 2020-02-04 18:07:07 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent d5d5b3f4a7
commit 1acf344dfa

View File

@ -629,10 +629,9 @@ static int clone_device_node(
}
/* We're about to fallback to bind-mounting the device
* node. So create a dummy bind-mount target. */
mac_selinux_create_file_prepare(d, 0);
* node. So create a dummy bind-mount target.
* Do not prepare device-node SELinux label (see issue 13762) */
r = mknod(dn, S_IFREG, 0);
mac_selinux_create_file_clear();
if (r < 0 && errno != EEXIST)
return log_debug_errno(errno, "mknod() fallback failed for '%s': %m", d);