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

2003-10-26 Thread Roland McGrath
You should not remove the checking of the return value of get*_r. When these return nonzero, that value (also in errno) should be returned. If it returns zero that means "nothing went wrong", in which case the result being null means "not found" and that case is what we need to handle differently

[ams@kemisten.nu: Re: bugs in idvec-verify.c, almost...]

2003-10-26 Thread Alfred M. Szmidt
Ping pong... --- Start of forwarded message --- Date: Tue, 16 Sep 2003 15:06:18 +0200 (MEST) From: "Alfred M. Szmidt" <[EMAIL PROTECTED]> To: "Alfred M. Szmidt" <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: bugs in idvec-verify.c, almost... Sin

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

2003-09-17 Thread Alfred M. Szmidt
> 2003-09-15 Alfred M. Szmidt <[EMAIL PROTECTED]> > >* idvec-verify.c (verify_passwd,verify_id): Check if the spwd and >passwd structures are NULL, and return an error if so. >(sys_encrypt): Check if NULL, return an error if so. >* ugids-argp.c (parse_opt): Che

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

2003-09-16 Thread Johan Rydberg
Marco Gerards <[EMAIL PROTECTED]> wrote: : > 2003-09-15 Alfred M. Szmidt <[EMAIL PROTECTED]> : > : > * idvec-verify.c (verify_passwd,verify_id): Check if the spwd and : > passwd structures are NULL, and return an error if so. : > (sys_encrypt): Check if NULL, return an error if so.

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

2003-09-16 Thread Marco Gerards
"Alfred M. Szmidt" <[EMAIL PROTECTED]> writes: > A patch is applied at the end, with ChangeLog (search for the string > "*** Patch ***"), and it has been tested. If someone could be nice > enough to comment about the ChangeLog entry then that would be nice, > since I don't really like it. Thanks

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

2003-09-16 Thread Alfred M. Szmidt
Since there are quite a few bugs of the same nature here, it makes for quite a long read. So to ease for the reader, here is the list of bugs that I have found so far (the gdb output is at the end somewhere). All of them segfault in either ugids-argp.c or idvec-verify.c, and they do it for the sa

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

2003-09-08 Thread Marcus Brinkmann
On Mon, Sep 08, 2003 at 03:40:58PM +0200, Alfred M. Szmidt wrote: >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 n

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

2003-09-08 Thread Alfred M. Szmidt
> 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),

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

2003-09-07 Thread Roland McGrath
> > if (getpwuid_r (id, &_pw, id_lookup_buf, sizeof id_lookup_buf, &pw) > > == 0) > > That code is ugly anyway, we should do function calls outside of if > conditions. So this could be cleaned up along with the semantic fix. There is nothing wrong with this kind of conditional. _

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

2003-09-07 Thread Marcus Brinkmann
On Sat, Sep 06, 2003 at 03:40:34PM -0400, Roland McGrath wrote: > > > if (getpwuid_r (id, &_pw, id_lookup_buf, sizeof id_lookup_buf, &pw) > > > == 0) > > > > That code is ugly anyway, we should do function calls outside of if > > conditions. So this could be cleaned up along with the semant

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

2003-09-06 Thread Marcus Brinkmann
On Sat, Sep 06, 2003 at 10:56:09AM +0200, Alfred M. Szmidt wrote: > 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)

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

2003-09-06 Thread Alfred M. Szmidt
Hi, 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 errn