This is the mail archive of the libc-hacker@cygnus.com 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]

Re: nss buffers?


Found this old mail:

"Matthias Urlichs" <smurf@noris.de> writes:

> > > I just noticed that a getspnam() call will trash the buffer used by a
> > > previous getpwnam(). This caused wu-ftpd to break.
> > [...]
> Actual code, paraphrased of course, found in more than one program:
> ...
> 	pw = getpwnam("foo");
> 	if(!pw) die();
> 	sp = getspnam(pw->pw_name);
> 	if(!check_password(sp ? sp->sp_pwdp ? pw->pw_passwd)) die();
> 	chdir(pw->pw_dir); /* Garbage */

I can't believe there is such a problem.  The various getXXbyYY
functions all use separate buffers and the backends also don't share
buffers.  Somebody will have to investigate this more closely.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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