bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use getgrouplist where available.


From: James Youngman
Subject: Re: [PATCH] Use getgrouplist where available.
Date: Fri, 22 Feb 2008 10:05:23 +0000

(I have moved the discussion to the gnulib mailing list; bug-coreutils
is BCC'ed)

On Fri, Feb 22, 2008 at 9:27 AM, Jim Meyering <address@hidden> wrote:
>  No.

I note your subsequent mail, and yes, I was indeed thinking about
oversized allocations.

> This function is intended to be usable from a library.
>  I.e., no fair calling exit, which xnrealloc does when it fails.
>
>  Also, the function header comment says what happens
>  when it fails, and "exit" is not mentioned.

While I have read many times on this list people mentioning this
issue, I just didn't think about it when I wrote my previous mail.  I
could easily have written code using xnrealloc, and contributed to the
problem of library code calling exit.

It occurs to me that quite a bit of effort goes into checking for and
fixing that kind of thing.   It strikes me that if gnulib modules had
a "not allowed to call exit" property, we could probably use a
topologically sorted list of gnulib object modules to determine if a
given module could call exit (or _Exit, _exit, abort, ...).  That
property could be verified against the declared property in the module
definition automatically.   Similar approaches could work for related
constraints (for example, one might require modules intended to be
thread-safe not to call chdir(2)).   This sounds like an interesting
project; I may find some time to work on it during March.

James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]