Fix: read files from symlink directory in background selector menu (#5524)

* Fix: read files from symlink directory in background selector menu

* safely parse the path to avoid option injection

* Simply use -L flag with find to resolve symlinks
This commit is contained in:
Tushar Chauhan
2026-05-01 16:31:02 +02:00
committed by GitHub
parent bb0adde652
commit 21f712c325
@@ -46,7 +46,7 @@ function GetEntries()
for _, wallpaper_dir in ipairs(dirs) do
local handle = io.popen(
"find " .. ShellEscape(wallpaper_dir)
"find -L " .. ShellEscape(wallpaper_dir)
.. " -maxdepth 1 -type f \\( -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' -o -name '*.bmp' -o -name '*.webp' \\) 2>/dev/null | sort"
)
if handle then