This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: nss buffers?
- To: "Matthias Urlichs" <smurf@noris.de>
- Subject: Re: nss buffers?
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 16 Feb 1999 17:02:37 -0800
- Cc: libc-hacker@gnu.org
- References: <77fgqv$276$1@smurf.noris.de> <r2r9t0o56i.fsf@happy.cygnus.com> <19990112171522.A687@noris.de>
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
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 `------------------------