diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-03-17 16:31:07 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-03-17 17:45:01 +0100 |
commit | 43b9b2053c68c0bd95fb73430349e970b41beec3 (patch) | |
tree | d7069216c258b8427326168fe9c74a78fafc2be5 /test/test-execute | |
parent | 598a1d763394bdeb4d264e3f15e00cd875777403 (diff) | |
download | systemd-43b9b2053c68c0bd95fb73430349e970b41beec3.tar.gz |
core: add %d specifier for the $CREDENTIALS_DIRECTORY
Resolves: #22549
Diffstat (limited to 'test/test-execute')
-rw-r--r-- | test/test-execute/exec-specifier-credentials-dir.service | 12 | ||||
-rw-r--r-- | test/test-execute/exec-specifier.service | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/test-execute/exec-specifier-credentials-dir.service b/test/test-execute/exec-specifier-credentials-dir.service new file mode 100644 index 0000000000..818619acaa --- /dev/null +++ b/test/test-execute/exec-specifier-credentials-dir.service @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for specifiers + +[Service] +Type=oneshot +Environment=TOP_SECRET=%d/very_top_secret +# Test if the specifier is resolved correctly both before and after LoadCredential= +ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" +LoadCredential=very_top_secret +ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" +ExecStart=sh -c 'test %d/very_top_secret = "$TOP_SECRET"' diff --git a/test/test-execute/exec-specifier.service b/test/test-execute/exec-specifier.service index 190ebe93e6..ae8b2428bc 100644 --- a/test/test-execute/exec-specifier.service +++ b/test/test-execute/exec-specifier.service @@ -20,6 +20,7 @@ ExecStart=test %L = /var/log ExecStart=test %E = /etc ExecStart=test %T = /tmp ExecStart=test %V = /var/tmp +ExecStart=test %d = %t/credentials/%n ExecStart=sh -c 'test %u = $$(id -un)' ExecStart=sh -c 'test %U = $$(id -u)' ExecStart=sh -c 'test %g = $$(id -gn)' |