mirror of
https://github.com/Jeffrey-Sardina/liberated-systemd.git
synced 2026-10-21 10:39:53 -05:00
Stop warning on extra spaces in BindPaths= and BindReadOnlyPaths=. Keep bind path parsing and serialization consistent. Fixes: #43214
31 lines
1.9 KiB
Desktop File
31 lines
1.9 KiB
Desktop File
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
[Unit]
|
|
Description=Test for BindPaths= and BindReadOnlyPaths=
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
# Create a file in /tmp/test-exec-bindpaths
|
|
ExecStart=touch /tmp/test-exec-bindpaths/thisisasimpletest
|
|
# Then, the file can be access through /tmp
|
|
ExecStart=test -f /tmp/thisisasimpletest
|
|
# Also, through /tmp/test-exec-bindreadonlypaths
|
|
ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest
|
|
# The file cannot modify through /tmp/test-exec-bindreadonlypaths
|
|
ExecStart=bash -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
|
|
ExecStart=bash -x -c 'touch "/tmp/test-exec-bindpaths destination/space test"'
|
|
ExecStart=bash -x -c 'test -f "/tmp/test-exec-bindpaths source/space test"'
|
|
ExecStart=bash -x -c 'touch "/tmp/test-exec-bindpaths:destination/colon-test"'
|
|
ExecStart=bash -x -c 'test -f "/tmp/test-exec-bindpaths:source/colon-test"'
|
|
ExecStart=bash -x -c 'touch "/tmp/test-exec-bindreadonlypaths source/space test"'
|
|
ExecStart=bash -x -c 'test -f "/tmp/test-exec-bindreadonlypaths destination/space test"'
|
|
ExecStart=bash -x -c '! touch "/tmp/test-exec-bindreadonlypaths destination/space test forbidden"'
|
|
ExecStart=bash -x -c 'touch "/tmp/test-exec-bindreadonlypaths:source/colon-test"'
|
|
ExecStart=bash -x -c 'test -f "/tmp/test-exec-bindreadonlypaths:destination/colon-test"'
|
|
ExecStart=bash -x -c '! touch "/tmp/test-exec-bindreadonlypaths:destination/colon-test-forbidden"'
|
|
# Cleanup
|
|
ExecStart=rm /tmp/thisisasimpletest
|
|
BindPaths=/tmp:/tmp/test-exec-bindpaths
|
|
BindPaths="/tmp/test-exec-bindpaths source:/tmp/test-exec-bindpaths destination" /tmp/test-exec-bindpaths\:source:/tmp/test-exec-bindpaths\:destination
|
|
BindReadOnlyPaths=/tmp:/tmp/test-exec-bindreadonlypaths
|
|
BindReadOnlyPaths="/tmp/test-exec-bindreadonlypaths source:/tmp/test-exec-bindreadonlypaths destination" /tmp/test-exec-bindreadonlypaths\:source:/tmp/test-exec-bindreadonlypaths\:destination
|