summaryrefslogtreecommitdiffstats
path: root/test/units/TEST-07-PID1.private-users.sh
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-09-09 12:25:28 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-09-09 18:31:01 +0200
commitfa693fdc7e17618958c505af4b2f39ecd1c3363e (patch)
tree4154eff3f98ab256ec6a3cbaab29ecc3808f45b6 /test/units/TEST-07-PID1.private-users.sh
parentupdate keyboard hwdb to add acer Predator PHN16-72 (diff)
downloadsystemd-fa693fdc7e17618958c505af4b2f39ecd1c3363e.tar.xz
systemd-fa693fdc7e17618958c505af4b2f39ecd1c3363e.zip
core: Add support for PrivateUsers=identity
This configures an indentity mapping similar to systemd-nspawn --private-users=identity.
Diffstat (limited to 'test/units/TEST-07-PID1.private-users.sh')
-rwxr-xr-xtest/units/TEST-07-PID1.private-users.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/units/TEST-07-PID1.private-users.sh b/test/units/TEST-07-PID1.private-users.sh
new file mode 100755
index 0000000000..2475b5d365
--- /dev/null
+++ b/test/units/TEST-07-PID1.private-users.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+# shellcheck disable=SC2016
+set -eux
+set -o pipefail
+
+systemd-run -p PrivateUsers=yes --wait bash -c 'test "$(cat /proc/self/uid_map)" == " 0 0 1"'
+systemd-run -p PrivateUsers=yes --wait bash -c 'test "$(cat /proc/self/gid_map)" == " 0 0 1"'
+systemd-run -p PrivateUsersEx=self --wait bash -c 'test "$(cat /proc/self/uid_map)" == " 0 0 1"'
+systemd-run -p PrivateUsersEx=self --wait bash -c 'test "$(cat /proc/self/gid_map)" == " 0 0 1"'
+systemd-run -p PrivateUsersEx=identity --wait bash -c 'test "$(cat /proc/self/uid_map)" == " 0 0 65536"'
+systemd-run -p PrivateUsersEx=identity --wait bash -c 'test "$(cat /proc/self/gid_map)" == " 0 0 65536"'