From f6900f06893e85d13edbb22bab6016de9de841a7 Mon Sep 17 00:00:00 2001 From: Cornelius Mika Date: Fri, 1 Dec 2017 11:15:50 +0100 Subject: [PATCH] files: improve 'target not in $HOME' check Check for prefix instead of inclusion. --- modules/files.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/files.nix b/modules/files.nix index b32fd54c5..78554230e 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -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