[BusyBox] httpd patches

Glenn Engel at Home glenne at engel.org
Wed Apr 2 15:37:07 UTC 2003


Vladimir,

> > > -static const char home[] = "/www";
> > > +static const char home[] = "./";
> > >
> > > Why?
> >
> > This was mainly for compatibility with the first release so it wouldn't
> > break when folks upgrade.
>
> Initial versions is full broken. I think, folks can`t usagibg this.
> Also, usaging as
>
> $ cd wwwroot; httpd
> very strange for initscripts...

init scripts are free to use the -h option to specify the directory if they
choose.  I have found use of the current directory to be very handy for
testing as well as for occasional need to easily export files.  cd and run
'httpd -p9999'

>
> > > I found restore old algorithms for addEnvCgi(), base64ToBin[] and many
> > > others :(

I didn't restore the old addEnvCgi() algorithm.  I added an additional CGI
variable CGI_VARNAMES_ that is a list of all the cgi argument names.  This
simplifies scripting use of cgi as the script can simply step thru the args:

for name in ${CGI_VARNAMES_}
do
  # interesting stuff
done

>
> > base64ToBin() was broken for certain combinations of input.
>
> Please get to me your test. I think, you testing not last cvs version!
>

See attached test.  The case that failed was toor2:PaSsWd2

> > Rather than
> > debug the new version I put in the old one.  The old one was smaller
code
> > size
>
> Its FALSE!

On my system compiled with -Os it was smaller.

>
> > and many times faster.
>
> Its true, but busybox politics for size vs speed is to smallest size.
> Base64tobin don`t require strong CPU usaging.

Agreed.  Since it's smaller (-Os) and faster it's a win-win.  I kept your
change to the signature of the function.

>
> > The sorting is still there and should behave the same as your version.
I
> > wrote my regression test before I made changes so I could insure it
> > behaved the same before and after.  To simplify the sorting, I impose a
> > slight trick - D: rules are converted to d:, a:/A: is converted to A:
and
> > D:* is converted to X:.  This results in a simple search that keys off
the
> > first letter but results in the desired order of ./dAX.  As a result
much
> > of the special checking is not needed so I just insert items into an
> > ordered list as they are read.
>
> Hmm.
> You removed
>
> -A shortes path and D:from[^*] automaticaly sorting to top.
> -All longest path can`t reset user:password if shorted protect setted.
>
> I added this for up security. This "checks" don`t have addition code size.

If you're referrnig to the comment, then it's likely I removed it as I
didn't understand what it said.

I believe it still behaves the way it did before.  I'd be interested in a
test case.

--
Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpd_test.sh
Type: application/octet-stream
Size: 5466 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20030402/0890425e/attachment.obj 


More information about the busybox mailing list