mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
samba: use readlink -f before forcing the /mnt/ prefix
When checknig that path starts with /mnt/, path should not include softlinks, "." or "..". This prevents the obvoius case of sharing the "/mnt/../" path, which will jump out of the restricted /mnt/.
This commit is contained in:
parent
203e252bae
commit
4e8f08aa8b
1 changed files with 1 additions and 0 deletions
|
|
@ -128,6 +128,7 @@ smb_add_share() {
|
|||
[ -z "$name" -o -z "$path" ] && return
|
||||
|
||||
path="$path/$dirpath"
|
||||
path=$(readlink -f $path)
|
||||
|
||||
# restrict the shared paths to always be under /mnt/ tree
|
||||
[ "${path:0:4}" == "/mnt" ] || path="/mnt/"$path
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue