[Top][All Lists]

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

Re: bugs in idvec-verify.c, almost...

From: Alfred M. Szmidt
Subject: Re: bugs in idvec-verify.c, almost...
Date: Mon, 8 Sep 2003 15:40:58 +0200 (MEST)

   > there are two or possibly three small bugs in idvec-verify.c that
   > use--or abuse--the functions getpwuid_r() and getspnam_r().  It
   > mostly concerns the fact that they don't return (nor does any
   > other NSS related function AFAIK) anything useful, that is they
   > always return 0), nor do they set errno.  So this could apply to
   > _any_ function that is based on the getXXbyYY_r.c (same thing for
   > getXXbyYY.c?) file in libc, I haven't checked this yet--and I
   > don't want to since that code is quite similar to /dev/random.  I
   > also want to double check the code in idvec-verify.c is correct
   > (or wrong) before moving this to libc-alpha, since it could apply
   > to any system that uses the GNU C Library.

   The glibc manual says these function can return an error, so we should check
   for one.  But we should also check for NULL return values, it seems.  The
   POSIX specification is not very clearly worded, but it seems that not
   finding an entry is also a "successful" operation (no error value is defined
   for an unsuccesful lookup if it failed  because the user does not exist).

I think that we should just check if the structure is NULL instead of
checking the return value _and_ the structure, this is simpler, and
cleaner.  As for what the glibc functions are supposed todo (set
errno, or return something of use), thats a topic for libc-alpha.
I'll report it there in a few days.

   You might enter this in the Savannah bug database (please get
   someone to verify that the bug exists first, or test it yourself),
   and then someone (you?) can work on a fix.

The bug exists, and could some nice soul put it into the SV bug
database?  Then assign it to me? My user-name on SV is "ams".

reply via email to

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