diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-09-09 12:25:28 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-09-09 18:31:01 +0200 |
commit | fa693fdc7e17618958c505af4b2f39ecd1c3363e (patch) | |
tree | 4154eff3f98ab256ec6a3cbaab29ecc3808f45b6 /test/units/TEST-07-PID1.private-users.sh | |
parent | update keyboard hwdb to add acer Predator PHN16-72 (diff) | |
download | systemd-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-x | test/units/TEST-07-PID1.private-users.sh | 12 |
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"' |