This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Declare set*id with warn_unused_result


On 07/24/2012 07:48 AM, Rich Felker wrote:
> Even if it can't fail on your setup, it means
> your program is dangerously non-portable

Do other operating systems also have this kernel bug?

Even if so, __wur is not about warning developers that their
programs might not be portable to other operating systems.
That would be too ambitious a goal.  Nor is it about
warning developers that there might be kernel bugs -- that'd
be another goal that might expand without limit.  __wur is
about warning developers that their programs are buggy, with
a reasonably large degree of certainty.

Surely it's a more productive use of everybody's time to fix
the kernels, than to write, test, and debug workarounds in all
the applications that use these kernels.

> This kind of code is a fundamental bug.

Not in the gnulib context; the code in question is
only for single-threaded applications.

As it happens, the example code is never used in GNU/Linux,
so if the bug is present only in Linux kernels there won't be
any reason to change Gnulib.  Still, the point is that
using seteuid to bop back and forth between real and effective
UID is not uncommon and there should be no need to warn
about such usage.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]