[PATCH v2 07/23] nss: Add __nss_generic_copy and __nss_generic_dup functions
Carlos O'Donell
carlos@redhat.com
Mon Mar 23 17:54:21 GMT 2026
On 3/23/26 12:48 PM, Florian Weimer wrote:
> * Carlos O'Donell:
>
>> On 3/20/26 4:41 PM, Florian Weimer wrote:
>>> So far for struct group and struct passwd only.
>>
>> LGTM. Nice design. The need for a semantic difference between copy and
>> dup wasn't initially apparent to me, but I see that we need it for a
>> "caller allocated" buffer versus one we allocate ourselves.
>>
>> I have one question, which is not a blocker for accepting this change,
>> but there is an assert in __nss_generic_dup which might go away when
>> built with -NDEBUG (noted by Claude Code v2.1.81 with Sonnet 4.5).
>> Do we care about that? Should we make it a runtime abort?
>
> I think removing such run-time aborts is the purpose of building with
> -DNDEBUG, at least in glibc's case.
>
> Our asserts are generally intended for production use, not for
> development builds only. People targeting special (typically embedded)
> use cases may want to disable them, but it's not the default build
> configuration.
If your opinion is that in this particular case we keep the assert then
I'm happy with that. I just wanted to call it out, talk about it, make
sure it wasn't an oversight, and agree to keep the assert.
My review still stands as accepting the patch.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list