Passes the document-root to the Lua handler by placing it in uhttpd.docroot.
It could alternatively be placed in env.DOCUMENT_ROOT which would more closely
resemble the CGI protocol; but would mean that it is not available at the time
when the handler-chunk is loaded but rather not until the handler is called,
without any code savings.
Signed-off-by: David Favro <openwrt@meta-dynamic.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31571 3c298f89-4303-0410-b956-a3cf2f4a3e73
My apologies, the 2nd of those patches had a syntax error -- that's what
I get for making a last-minute edit, even to the comments, without
testing! :-p
Here is the corrected patch.
-- David
From d259cff104d2084455476b82e92a3a27524f4263 Mon Sep 17 00:00:00 2001
From: David Favro <openwrt@meta-dynamic.com>
Date: Fri, 27 Apr 2012 14:17:52 -0400
Subject: [PATCH] uhttpd URL-codec enhancements.
* uh_urlencode() and uh_urldecode() now return an error condition for
buffer-overflow and malformed-encoding rather than normal return with corrupt
or truncated data. As HTTP request processing is currently implemented, this
causes a 404 HTTP status returned to the client, while 400 is more
appropriate.
* Exposed urlencode() to Lua.
* Lua's uhttpd.urlencode() and .urldecode() now raise an error condition for
buffer-overflow and malformed-encoding rather than normal return with
incorrect data.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31570 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Fixed output-buffer-overflow bug in uh_urlencode() and uh_urldecode() [tested
input-buffer index against output-buffer length]. In reality, this would not
typically cause an overflow on decode, where the output string would be
expected to be shorter than the input string; and uh_urlencode() seems to have
been unreferenced in the source.
* Fixed bug: uh_urlencode() and uh_urldecode() both read one extra byte from the
input-string. While this could manifest in C code, the result was most
egregious when called from Lua, where it caused an extra null byte to be
embedded at the end of the output string.
* uh_urlencode() cleanup: removed redundant bitwise-and.
Signed-off-by: David Favro <openwrt@meta-dynamic.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31569 3c298f89-4303-0410-b956-a3cf2f4a3e73
[juhosg: export xt_layer7.h for all kernel versions]
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31566 3c298f89-4303-0410-b956-a3cf2f4a3e73
The existing code is fairly broken. It assumes you're using Legacy IP, and
it assumes that the server is reachable via your default route. Via the
first default route in the 'route -n' output, in fact, regardless of metric.
Fix all those problems by using 'ip route get' to really find the *current*
route to the server, and install a host-specific route to match.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31565 3c298f89-4303-0410-b956-a3cf2f4a3e73
Based on a patch by Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31522 3c298f89-4303-0410-b956-a3cf2f4a3e73
This patch makes several changes to the util-linux(-ng) package:
* rename to util-linux (official name now, util-linux-ng got merged)
* bump to last stable version 2.21.1 (was 2.13.0.1 before)
* add several new packages
* sort packages within Makefile
* remove patches which got merged upstream
This patch makes some changes to the e2fsprogs package:
* bump to last stable version 1.42.2
* libraries moved from e2fsprogs to util-linux - take care of that
Signed-off-by: Luka Perkov <openwrt@lukaperkov.net>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31499 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit fixes build breakage in package/kernel leading to missing
subsequent kmods like kmod-usb-serial, this should fix the missing
packages in ar71xx builds.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31477 3c298f89-4303-0410-b956-a3cf2f4a3e73
Any modifications in target/linux/*/modules.mk would not come into effect for
subsequent "make menuconfig" unless we delete ./tmp.
Signed-off-by: kalyan <kalyanatejaswi@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31442 3c298f89-4303-0410-b956-a3cf2f4a3e73
Without module_pci_driver being defined the pci drivers do not get registered.
Should fix#11332
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31437 3c298f89-4303-0410-b956-a3cf2f4a3e73