[PATCH] elf: Implement DT_AUDIT, DT_DEPAUDIT support [BZ #24943]
Florian Weimer
fweimer@redhat.com
Fri Apr 3 11:39:52 GMT 2020
* Adhemerval Zanella:
> On 02/04/2020 05:46, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> On 17/02/2020 13:02, Florian Weimer wrote:
>>>> diff --git a/elf/rtld.c b/elf/rtld.c
>>>> index 51dfaf966a..167da48def 100644
>>>> --- a/elf/rtld.c
>>>> +++ b/elf/rtld.c
>>>> @@ -188,6 +188,15 @@ static struct audit_list
>>>> struct audit_list *next;
>>>> } *audit_list;
>>>>
>>>> +/* State flag for hte struct audit_list_iter iterator. */
>>>> +enum audit_iter_list_state
>>>> + {
>>>> + audit_iter_list_in_string,
>>>> + audit_iter_list_in_dt_audit,
>>>> + audit_iter_list_in_dt_depaudit,
>>>> + audit_iter_list_in_list,
>>>> + };
>>>> +
>>>> /* Iterator for audit_list_string followed by audit_list. */
>>>> struct audit_list_iter
>>>> {
>>>> @@ -198,6 +207,9 @@ struct audit_list_iter
>>>> the first element. */
>>>> struct audit_list *previous;
>>>>
>>>> + /* One of the enum audit_iter_list_state values. */
>>>> + unsigned char state;
>>>
>>> Why not use enum audit_iter_list_state as the type?
>>
>> It avoids increasing the size of struct audit_list_iter.
>
> But do we care for this specific usage?
No, not really.
I looked at this again from a larger view and will use a simple
stack-allocated array for all string lists. It turns out that all list
strings use ':' as a separator, so there is no reason to handle
individual strings differently.
Thanks,
Florian
More information about the Libc-alpha
mailing list