[PATCH] Handle DT_UNKNOWN in gconv-modules.d
Siddhesh Poyarekar
siddhesh@sourceware.org
Wed Jun 9 18:08:16 GMT 2021
On 6/9/21 10:51 PM, Adhemerval Zanella wrote:
>
>
> On 09/06/2021 01:38, Siddhesh Poyarekar via Libc-alpha wrote:
>> On filesystems that do not support dt_type, a regular file shows up as
>> DT_UNKNOWN. Fall back to using lstat64 to read file properties in
>> such cases.
>
> The patch looks ok, but two things raised checking on this code: 1.
> the code is essentially the same on both places and 2. the use of
> alloca() even when it is assured that is bounded and 2.
>
> The former would be nice if could consolidate it (even by adding
> a file where both iconvconfig and iconv could include or even
> by a GLIBC_PRIVATE symbol), but it is not a deal breaker.
I tried to do this but the code came out clumsier because the result
(call to handle_file vs read_conf_file) have different semantics.
> But I think we should move away from alloca, even when we know it
> is bounded (sorry if I didn't catch on the previous patch). For
> this specific usage we can use asprintf to create the path or use
> a static PATH_MAX buffer.
I agree, a static PATH_MAX makes sense, I'll do that.
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list