nss buffers?

Ulrich Drepper drepper@cygnus.com
Tue Feb 16 17:02:00 GMT 1999


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   `------------------------



More information about the Libc-hacker mailing list