tests: add test case for UMask=+BindPaths= combination

Inspired by the test case described in #19899
This commit is contained in:
Lennart Poettering 2021-11-12 13:41:59 +01:00
parent 3044343927
commit 875afa02fa
2 changed files with 17 additions and 0 deletions

View file

@ -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;

View file

@ -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