mirror of
https://github.com/aclist/dztui.git
synced 2025-07-24 00:18:48 +02:00
fix: symlink traversal
This commit is contained in:
parent
79b0bae05d
commit
923bac8f76
2 changed files with 15 additions and 9 deletions
helpers
|
@ -735,6 +735,9 @@ dump_servers(){
|
|||
logger INFO "Server context is '$subcontext', reading from file '$file'"
|
||||
filter_servers "$file" "$@"
|
||||
}
|
||||
redact(){
|
||||
sed 's@\(/home/\)\([^/]*\)\(.*\)@\1REDACTED\3@g'
|
||||
}
|
||||
logger(){
|
||||
local date="$(date "+%F %T,%3N")"
|
||||
local tag="$1"
|
||||
|
@ -742,8 +745,8 @@ logger(){
|
|||
local self="${BASH_SOURCE[0]}"
|
||||
local caller="${FUNCNAME[1]}"
|
||||
local line="${BASH_LINENO[0]}"
|
||||
self="$(<<< "$self" sed 's@\(/[^/]*/\)\([^/]*\)\(.*\)@\1REDACTED\3@g')"
|
||||
printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" >> "$debug_log"
|
||||
printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" \
|
||||
| redact >> "$debug_log"
|
||||
}
|
||||
test_ping(){
|
||||
shift
|
||||
|
@ -1243,8 +1246,8 @@ symlinks(){
|
|||
done
|
||||
}
|
||||
|
||||
readarray -t mods < <(find $workshop_dir -mindepth 1 -name meta.cpp | awk -F/ 'NF=NF-1{print $NF}')
|
||||
readarray -t links < <(find $game_dir -type l)
|
||||
readarray -t mods < <(find "$workshop_dir" -mindepth 1 -name meta.cpp | awk -F/ 'NF=NF-1{print $NF}')
|
||||
readarray -t links < <(find "$game_dir" -maxdepth 1 -type l)
|
||||
|
||||
if [[ ${#mods[@]} -eq 0 ]]; then
|
||||
logger INFO "No mods present, aborting"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue