[PATCH v2 07/23] nss: Add __nss_generic_copy and __nss_generic_dup functions

Florian Weimer fweimer@redhat.com
Mon Mar 23 16:48:36 GMT 2026


* 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.

Thanks,
Florian



More information about the Libc-alpha mailing list