mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
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:
commit
a82bbcb225
1 changed files with 5 additions and 0 deletions
|
@ -348,6 +348,11 @@ ynh_secure_remove () {
|
||||||
/var/www \
|
/var/www \
|
||||||
/home/yunohost.app"
|
/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" \
|
if [[ "$forbidden_path" =~ "$path_to_remove" \
|
||||||
# Match all paths or subpaths in $forbidden_path
|
# Match all paths or subpaths in $forbidden_path
|
||||||
|| "$path_to_remove" =~ ^/[[:alnum:]]+$ \
|
|| "$path_to_remove" =~ ^/[[:alnum:]]+$ \
|
||||||
|
|
Loading…
Add table
Reference in a new issue