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:
@@ -46,7 +46,7 @@ function GetEntries()
|
|||||||
|
|
||||||
for _, wallpaper_dir in ipairs(dirs) do
|
for _, wallpaper_dir in ipairs(dirs) do
|
||||||
local handle = io.popen(
|
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"
|
.. " -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
|
if handle then
|
||||||
|
|||||||
Reference in New Issue
Block a user