httpd symlink problems
Alexander Kriegisch
Alexander at Kriegisch.name
Fri Jun 1 11:18:47 UTC 2007
I use BB on a mipsel-based DSL/LAN/WLAN router (AVM Fritz!Box series).
There is an issue regarding httpd: When running with a home directory
containing symlinked directories, function 'sendCgi' calls 'realpath' in
order to convert a relative path name into an absolute one. So far, so
good. What is bad about 'realpath' is the fact that it resolves symlinks
instead of keeping them in the path. This alters the directory structure
as it is seen by CGI scripts, for example. Thus files cannot be found.
I tested four other web servers, and they all refrain from resolving
symlinks, thus work on AVM's directory structure. I think a user space
program should not try and be smarter than the filesystem by eliminating
symlinks. A behaviour similar to pwd.c (uses 'xgetcwd') would be
desireable here.
I am attaching a patch somebody else created for BB 1.4.2 (but the
behaviour is the same in 1.5.1), not to have it included in BB but to
ask you if there is a more elegant way to solve this problem. If so,
please fix it and publish a patch or at least notify me so I can get the
patch from SVN.
Regards
--
Alexander Kriegisch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: busybox-realpath.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20070601/6f54b986/attachment-0002.diff
More information about the busybox
mailing list