core: add %d specifier for the $CREDENTIALS_DIRECTORY

Resolves: #22549
This commit is contained in:
Frantisek Sumsal
2022-03-17 16:31:07 +01:00
parent 598a1d7633
commit 43b9b2053c
5 changed files with 35 additions and 0 deletions

View File

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

View File

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