summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2015-09-21 15:45:51 +0200
committerRonny Chevalier <chevalier.ronny@gmail.com>2015-09-21 18:14:44 +0200
commit5bc7452b3219456e07f931e40da30bb94a884293 (patch)
tree6d76fb54e5e74c958f81cb2a86528296ef08395d /test
parenttest-execute: add tests for RuntimeDirectory (diff)
downloadsystemd-5bc7452b3219456e07f931e40da30bb94a884293.tar.xz
systemd-5bc7452b3219456e07f931e40da30bb94a884293.zip
core: fix group ownership when Group is set
When Group is set in the unit, the runtime directories are owned by this group and not the default group of the user (same for cgroup paths and standard outputs) Fix #1231
Diffstat (limited to 'test')
-rw-r--r--test/exec-runtimedirectory-owner.service9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/exec-runtimedirectory-owner.service b/test/exec-runtimedirectory-owner.service
new file mode 100644
index 0000000000..077e08d1c5
--- /dev/null
+++ b/test/exec-runtimedirectory-owner.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set)
+
+[Service]
+ExecStart=/bin/sh -c 'f=/tmp/test-exec_runtimedirectory-owner;g=$(stat -c %G $f); echo "$g"; exit $(test $g = "nobody")'
+Type=oneshot
+Group=nobody
+User=root
+RuntimeDirectory=test-exec_runtimedirectory-owner