Merge pull request #635 from YunoHost/ynh-secure-remove-has-only-one-arg

Warn the user that ynh_secure_remove should be used with only one arg…
This commit is contained in:
Alexandre Aubin 2019-02-05 17:50:56 +01:00 committed by GitHub
commit a82bbcb225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,6 +348,11 @@ ynh_secure_remove () {
/var/www \
/home/yunohost.app"
if [[ -n "$2" ]]
then
echo "/!\ Packager ! You provided a second argument to ynh_secure_remove but it will be ignored... Use this helper with one argument at time." >&2
fi
if [[ "$forbidden_path" =~ "$path_to_remove" \
# Match all paths or subpaths in $forbidden_path
|| "$path_to_remove" =~ ^/[[:alnum:]]+$ \