You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1997/01/01 00:18:22 UTC
Re: Guess what? suEXEC problems in 1.2b4...
> Jake Buchholz had previously stated:
> > Tracked it down, here's the code snipped from suexec.c:
> >
> > doclen = strlen(dwd);
> > /* above succeeded */
> > if (strncmp(cwd, dwd, doclen) != 0) {
> > free(dwd);
> > /* never gets to this point... */
> > log_err("command not in docroot (%s/%s)\n", cwd, cmd);
> > exit(109);
> > }
> > else
> > free(dwd);
> > /* never gets to this point either... */
> >
> > taking a look at how dwd is defined in suexec.c...
> >
> > char dwd[MAXPATHLEN]; /* docroot working directory */
> >
> > Are you sure you want to free(dwd); anywhere in suexec.c?
>
> BTW, getting rid of those free(dwd);'s did the trick...
You are correct, these need to go away. I just discovered that
FreeBSD-2.2 has a dangerously forgiving malloc and friends. It
happily plowed through these areas that will probably be a SEGV
on any other UNIX.
I'll check in some changes.
Re: Guess what? suEXEC problems in 1.2b4...
Posted by Paul Richards <p....@elsevier.co.uk>.
Randy Terbush <ra...@zyzzyva.com> writes:
> You are correct, these need to go away. I just discovered that
> FreeBSD-2.2 has a dangerously forgiving malloc and friends. It
> happily plowed through these areas that will probably be a SEGV
> on any other UNIX.
For future ref, read FreeBSD's malloc page, you can create a
config file in /etc that turns on some very strict memory checking
that's generally a good idea on a development box, we've found *lots*
of malloc related bugs in the BSD software with the new malloc that
Poul wrote.
--
Paul Richards. Originative Solutions Ltd. (Netcraft Ltd. contractor)
Elsevier Science TIS online journal project.
Email: p.richards@elsevier.co.uk
Phone: 0370 462071 (Mobile), +44 (0)1865 843155