mirror of
https://github.com/zoriya/home-manager.git
synced 2026-06-04 19:16:34 +00:00
files: improve 'target not in $HOME' check
Check for prefix instead of inclusion.
This commit is contained in:
committed by
Robert Helgesson
parent
8759a5a63e
commit
f6900f0689
+1
-1
@@ -217,7 +217,7 @@ in
|
||||
target="$(realpath -m "$out/$relTarget")"
|
||||
|
||||
# Target path must be within $HOME.
|
||||
if [[ ! $target =~ $out ]] ; then
|
||||
if [[ ! $target == $out* ]] ; then
|
||||
echo "Error installing file '$relTarget' outside \$HOME" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user