Fix to check if internally sourced file is under user home

This commit is contained in:
iliajie
2022-11-12 10:56:55 +02:00
parent 825842267a
commit ab00e4c7df

View File

@@ -97,7 +97,10 @@ if ($shinit) {
$sourced_file =~ s/\s+$//;
$sourced_file =~ s/^\~\///;
push(@{$shfiles}, $sourced_file)
if (!grep(/^$sourced_file$/, @{$shfiles}));
if (!grep(/^$sourced_file$/, @{$shfiles}) &&
($sourced_file !~ /^\// ||
$sourced_file =~ /^\// &&
&is_under_directory($uinfo[7], $sourced_file)));
}
}
}