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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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] Fix error handling in getlogin_r


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/02/2010 04:42 AM, Andreas Schwab wrote:
> 2010-06-02  Andreas Schwab  <schwab@redhat.com>
> 
> 	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid):
> 	Fix error handling.  Properly resize buffer.  Don't set errno.
> 	(getlogin_r): Only use fallback if __getlogin_r_loginuid returns -1.

This patch is changing the way the code works.

The current tries to use the old method whenever the new one fails.
Particularly if the name lookup fails.  Imagine the user account is
removed.  After your change a call always returns an error while the
utmp database can still contain a valid record.

What are you trying to fix?  Perhaps ENOMEM errors could be handled
differently but the patch as-is isn't what should be used.

- -- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkwWzuAACgkQ2ijCOnn/RHSgQQCeKc8C+kFACp/J2TFG/GepytmF
CIoAoK3Rbi414e4Fid/NbqJ8d1OyiJah
=JyOF
-----END PGP SIGNATURE-----


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