mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-08-01 21:49:26 +02:00
Update w/ strict check on config destination path
This commit is contained in:
parent
23597e800d
commit
605486feda
@ -71,8 +71,14 @@ case "$action" in
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$destination")"
|
||||
chown -R "$raspap_user:$raspap_user" "$(dirname "$destination")"
|
||||
dest_dir="$(dirname "$destination")"
|
||||
if [ -z "$dest_dir" ] || [ "$dest_dir" = "/" ]; then
|
||||
echo "Error: Unsafe destination path."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$dest_dir"
|
||||
chown -R "$raspap_user:$raspap_user" "$dest_dir"
|
||||
cp "$source" "$destination"
|
||||
|
||||
echo "OK"
|
||||
|
Loading…
x
Reference in New Issue
Block a user