]> git.ipfire.org Git - thirdparty/glibc.git/commit
iconv: Fix iconv functions not following symlinks [BZ #32339]
authorAvinal Kumar <avinal.xlvii@gmail.com>
Mon, 14 Jul 2025 16:04:27 +0000 (21:34 +0530)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 5 Aug 2025 17:15:33 +0000 (14:15 -0300)
commit25258aef78ec301d25f61d8e5758eb28d3254d94
treed1213278d3d181c29c5d36b1b2fdd967d5236af7
parent9a2aceb076b8aa6ffa8edb4adcc9f43a2d3a352d
iconv: Fix iconv functions not following symlinks [BZ #32339]

On some file systems iconv do not follow symlinks.  This happens because
read_conf_file() function's directory traversal loop reject symbolic
links and then lstat64() call do not follow symlinks.

This commit fixes the directory traversal loop to accept symbolic links
and then follow the link using stat64().

The test works by creating a temporary directory and placing a symbolic
link inside it that points to a configuration file.  It then runs
iconvconfig on this directory.

The test passes if iconvconfig successfully follows the symlink and
generates the cache correctly, confirming that the directory traversal
logic now properly handles symbolic links.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
iconv/Makefile
iconv/gconv_parseconfdir.h
iconv/tst-iconvconfig.sh [new file with mode: 0755]