sane-sandboxed: be more strict internally about keeping paths var as absolute-paths

This commit is contained in:
2024-05-12 21:44:33 +00:00
parent f7a25d1421
commit d827235d31

View File

@@ -301,14 +301,14 @@ tryPath() {
if [ "$_how" = "existing" ]; then if [ "$_how" = "existing" ]; then
# the caller wants to access either a file, or a directory (possibly a symlink to such a thing) # the caller wants to access either a file, or a directory (possibly a symlink to such a thing)
if [ -e "$_path" ]; then if [ -e "$_path" ]; then
cliPathArgs+=("$_path") cliPathArgs+=("$(relativeTo "$PWD" "$_path")")
true true
fi fi
false false
elif [ "$_how" = "existingFile" ]; then elif [ "$_how" = "existingFile" ]; then
# the caller wants to access a file, and explicitly *not* a directory (though it could be a symlink *to a file*) # the caller wants to access a file, and explicitly *not* a directory (though it could be a symlink *to a file*)
if [ -f "$_path" ]; then if [ -f "$_path" ]; then
cliPathArgs+=("$_path") cliPathArgs+=("$(relativeTo "$PWD" "$_path")")
true true
fi fi
false false