mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Update helpers/helpers.v2.1.d/utils: use regex matching to check if path is child from a parent path
This commit is contained in:
parent
3b26ccc2a5
commit
75d7042974
1 changed files with 1 additions and 1 deletions
|
@ -241,7 +241,7 @@ _ynh_apply_default_permissions() {
|
||||||
[ -n "$2" ] || return 1
|
[ -n "$2" ] || return 1
|
||||||
local child=$(realpath "$1" 2>/dev/null)
|
local child=$(realpath "$1" 2>/dev/null)
|
||||||
local parent=$(realpath "$2" 2>/dev/null)
|
local parent=$(realpath "$2" 2>/dev/null)
|
||||||
[[ "${child/$parent/}" != "$child" ]]
|
[[ "${child}" =~ ^$parent ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# App files can have files of their own
|
# App files can have files of their own
|
||||||
|
|
Loading…
Add table
Reference in a new issue