1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 00:18:30 +02:00

files: improve 'target not in $HOME' check

Check for prefix instead of inclusion.
This commit is contained in:
Cornelius Mika 2017-12-01 11:15:50 +01:00 committed by Robert Helgesson
parent 8759a5a63e
commit f6900f0689
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

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