httpd translates %xx and generates a false QUERY_STRING for cgi scripts.

Rob Landley rob at landley.net
Mon Sep 5 16:44:52 UTC 2005


On Monday 05 September 2005 05:04, Bernhard Fischer wrote:

> What's the deal with MAXPATHLEN?

Presumably defined in /usr/include/sys/param.h

> If i try to avoid pulling in linux/autoconf.h (which defines
> CONFIG_SYSCTL) from busybox.h, i end with MAXPATHLEN undefined in a few
> applets (httpd is umong them).

Our code having a conflict with the standard headers is a problem we'll 
eventually have to fix rather than just work around.

This is one (minor) reason I'm slowly trying to switch stuff over to the 
ENABLE_ stuff.  You can "#if ENABLE_*" just as easily as "#ifdef CONFIG_*", 
although being able to use if() instead of #if is the main reason...

I believe Maszur's headers for 2.6 don't pollute the global namespace like 
that, but that's not what's deployed on current glibc-based systems, it 
seems...

> Current svn, which includes sys/param.h unconditionally, fails on a
> fresh checkout in applets.[ch] because autoconf.h defines CONFIG_SYSCTL.
> To reproduce, try:
> svn co busybox;make defconfig;make
>
> I thought about doing this in busybox.h to procrastinate cleaning up the
> config-namespace mess a bit:
> @@ -113,7 +113,9 @@ extern const struct BB_applet applets[];
>  #include <limits.h>
>
>  /* for PATH_MAX on systems that don't have it in limits.h */
> +#ifndef PATH_MAX
>  #include <sys/param.h>
> +#endif
>  #ifndef PATH_MAX
>  #define  PATH_MAX         256
>  #endif

Except under 2.6 PATH_MAX is 4096...

> and use pathconf("/",PATH_MAX); to set MAXPATHLEN. But i'm not sure if
> this is a good idea.

If the real bug is the header conflict.

> What do you think?

For right now, if CONFIG_SYSCTL is the only conflict, why not rename ours 
CONFIG_USE_SYSCTL?

> thank you,
> Bernhard

Rob



More information about the busybox mailing list