This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: nss buffers?
"Matthias Urlichs" <smurf@noris.de> writes:
> That "of course" causes the breakage.
>
> 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 */
> ...
There shouldn't be any such problem. The various getXXbyYY functions
all get there own local buffer. See nss/getXXbyYY.c. These are
static variables in the functions.
Please try to find out at which point the memory get overwritten.
I cannot reproduce it here.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------