summaryrefslogtreecommitdiffstats
path: root/test/units/TEST-22-TMPFILES.17.sh
blob: f43aba5ad9ecc178fa9d157b91470c50c6b807bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Test for C-style escapes in file names and contents
set -eux
set -o pipefail

data="\x20foo\nbar"
dst="/tmp/x/\x20a\nb"

systemd-tmpfiles --create - <<EOF
f     "$dst" 0644 0 0 - $data
EOF

diff "$(printf "/tmp/x/\x20a\nb")" <(printf "\x20foo\nbar")