From: Lennart Poettering Date: Fri, 12 Nov 2021 12:41:59 +0000 (+0100) Subject: tests: add test case for UMask=+BindPaths= combination X-Git-Tag: v250-rc1~290^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=875afa02fabe1dad5aa3d1e9bff89d493a369fd0;p=thirdparty%2Fsystemd.git tests: add test case for UMask=+BindPaths= combination Inspired by the test case described in #19899 --- diff --git a/src/test/test-execute.c b/src/test/test-execute.c index c81842a0d01..5818adbb552 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -1109,6 +1109,10 @@ static void test_exec_condition(Manager *m) { test_service(m, "exec-condition-skip.service", SERVICE_SKIP_CONDITION); } +static void test_exec_umask_namespace(Manager *m) { + test(m, "exec-umask-namespace.service", can_unshare ? 0 : EXIT_NAMESPACE, CLD_EXITED); +} + typedef struct test_entry { test_function_t f; const char *name; @@ -1191,6 +1195,7 @@ int main(int argc, char *argv[]) { entry(test_exec_specifier), entry(test_exec_execsearchpath_specifier), entry(test_exec_systemcallfilter_system), + entry(test_exec_umask_namespace), {}, }; int r; diff --git a/test/test-execute/exec-umask-namespace.service b/test/test-execute/exec-umask-namespace.service new file mode 100644 index 00000000000..8419c86c9ab --- /dev/null +++ b/test/test-execute/exec-umask-namespace.service @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for UMask= + namespacing + +[Service] +ExecStart=/bin/ls -lahd /tmp/subdir +Type=oneshot +User=65534 +Group=65534 +TemporaryFileSystem=/tmp:ro +BindPaths=/etc:/tmp/subdir/subsub +UMask=0007