mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
tests: add test case for UMask=+BindPaths= combination
Inspired by the test case described in #19899
This commit is contained in:
parent
3044343927
commit
875afa02fa
@ -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;
|
||||
|
12
test/test-execute/exec-umask-namespace.service
Normal file
12
test/test-execute/exec-umask-namespace.service
Normal 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
|
Loading…
Reference in New Issue
Block a user