summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Another round of path handling fixesHEADmasterJo-Philipp Wich2014-09-231-4/+7
| | | | | | | | | | | | | | | * In canonpath(): * Make sure the internal path_copy buffer is zero initialized, this guarantees a trailing \0 when copying the input to the buffer * Handle failing getcwd() * Copy path argument to the correct offset when converting relative to absolute paths * In uh_realpath(): * Fix off-by-one in strncpy() - usually the callers buffer is zero-initialized so the trailing \0 is present nonetheless but this makes the function safer to use Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Use safe uh_realpath()Jo-Philipp Wich2014-09-221-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Fix possible buffer overruns in uh_file_dirlist()Jo-Philipp Wich2014-09-221-5/+5
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Fix possible buffer overruns in path handlingJo-Philipp Wich2014-09-222-7/+31
| | | | | | | | * Implement safe uh_realpath() wrapper * Fix possible buffer overrun in canonpath() * Fix possible buffer overrun in uh_path_lookup() Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* back out early if the first client socket read doesn't yield a valid HTTP ↵Jo-Philipp Wich2012-10-301-0/+21
| | | | method signature
* re-add limits.h, required for PATH_MAX on certain libc implementationsJo-Philipp Wich2012-10-191-1/+2
|
* move plugin initialization into separate functionsJo-Philipp Wich2012-10-151-61/+96
|
* support multiple index files in the configuration and the command line argsJo-Philipp Wich2012-10-154-24/+48
|
* fix libcrypt availability checkFelix Fietkau2012-10-051-3/+3
|
* file: fix two enum vs. float comparisationsJo-Philipp Wich2012-10-041-2/+2
|
* ubus: add clock_gettime fallback for mac os x (untested)Felix Fietkau2012-10-041-0/+24
|
* include strings.h globally for strcasecmp and strncasecmpFelix Fietkau2012-10-041-0/+1
|
* add a missing definition for timegm() on mac os xFelix Fietkau2012-10-041-0/+3
|
* provide a clearenv() fallback for mac os xFelix Fietkau2012-10-041-0/+7
|
* #ifdef linux-specific tcp keepalive optionsFelix Fietkau2012-10-041-4/+11
|
* define _XOPEN_SOURCE and _BSD_SOURCE globally, increase _XOPEN_SOURCE to ↵Felix Fietkau2012-10-044-8/+3
| | | | include strdup et al on mac os x
* only link against libcrypt on linuxFelix Fietkau2012-10-041-1/+5
|
* do not include linux/limits.hFelix Fietkau2012-10-043-3/+0
|
* add .gitignoreFelix Fietkau2012-10-041-0/+9
|
* replace the makefile with a cmake fileFelix Fietkau2012-10-042-89/+110
|
* lua: add explicit typecasts to fix compiler warningsFelix Fietkau2012-10-041-2/+2
|
* add more missing ifdefsFelix Fietkau2012-10-041-0/+4
|
* add an ifdef around a potentially unused variableFelix Fietkau2012-10-041-0/+2
|
* [package] uhttpd: various changesjow2012-07-137-139/+126
| | | | | | | | | - remove unused variables - simply ignore command line args which belong to not enabled features - resolve peer address at accept() time, should solve (#11850) - remove floating point operations where possible git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32704 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: retry parsing the CGI header until the buffer space is ↵jow2012-07-113-10/+22
| | | | | | exhausted git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32662 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: various fixesjow2012-07-098-141/+152
| | | | | | | | | - avoid closing descriptors before removing them from uloop (#11755, #11830) - do not auto-initialize ubus if no prefix is set (#11832) - remove extraneous client context pointer from cgi and lua states - code cleanups and debug message changes git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32651 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: do not dispatch pipe error events, fixes use after free ↵jow2012-07-071-2/+6
| | | | | | for cgi and lua scripts git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32644 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: do not subscribe to epoll write eventsjow2012-07-065-3/+26
| | | | | | | | Watch child read pipe end for data instead of relying on socket write notification to process cgi data, should lower cpu consumption during requests on weaker devices. git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32640 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: finish inherited uloop in forked childs, fixes ↵jow2012-06-182-0/+6
| | | | | | misdispatched events leading to race conditions and bad memory accesses git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32419 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: remove some dead codejow2012-06-022-14/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32028 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: add explicit stdin eof notification for Lua and CGI childsjow2012-06-022-1/+9
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32027 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: fix wrongly applied sizeof() leading to writing beyound ↵jow2012-05-301-2/+2
| | | | | | end of buffer and subsequent data corruption (#11557) git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32005 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd:jow2012-05-2815-1308/+2519
| | | | | | | | | | | - rewrite large parts of the server, use uloop event driven structure - support concurrent requests and make the upper limit configurable - implement initial version of HTTP-to-ubus JSON proxy and session.* namespace - add compile time support for debug information - code style changes - bump package revision git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@31931 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: display errors in init script, code formatting changes, ↵jow2012-05-035-495/+529
| | | | | | bump package version git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@31572 3c298f89-4303-0410-b956-a3cf2f4a3e73
* uhttpd: added uhttpd.docrootjow2012-05-034-5/+13
| | | | | | | | | | | | | 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/package/uhttpd/src@31571 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Fixed: [PATCH 2/3] uhttpd URL-codec enhancements.jow2012-05-033-21/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/package/uhttpd/src@31570 3c298f89-4303-0410-b956-a3cf2f4a3e73
* uhttpd URL-codec bug fixes.jow2012-05-031-5/+11
| | | | | | | | | | | | | | | | | | | * 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/package/uhttpd/src@31569 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: reorder compiler flags to fix native build on Ubuntu 11.xjow2012-03-131-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@30936 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: cope with variable number of spaces in header lines (#11079)jow2012-03-041-3/+6
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@30806 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: cope with DES crypted passwd entries by not relying on a ↵jow2011-11-091-5/+2
| | | | | | leading dollar sign to indicate a cipher git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28886 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: fix Makefiles and linking of tls pluginjow2011-11-051-6/+6
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28769 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: rework CyaSSL and OpenSSL integration; move protected ↵jow2011-11-054-50/+207
| | | | | | recv() and send() operations below the ssl layer - fixes hangs when accessing via https git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28761 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: fix bad pointer use in previous commitjow2011-09-181-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28257 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: fix possible CGI header line parsing beyound the empty ↵jow2011-09-181-4/+4
| | | | | | line, thanks Linus Luessing for spotting it git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28254 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: properly match mimetype entries which cover the whole ↵jow2011-09-041-2/+2
| | | | | | filename (#8236) git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28160 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: add "application/x-ns-proxy-autoconfig" mime type (#8236)jow2011-09-021-0/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@28149 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: support building against openssl instead of cyassl, minor ↵jow2011-07-185-20/+65
| | | | | | cleanups (#7827) git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@27686 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: unblock signals in CGI childs, solves hanging ssh logout ↵jow2011-07-172-1/+11
| | | | | | after server restart from within LuCI and similar problems git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@27628 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: substitute "+" with space when using the -d flag, lazyload ↵jow2011-01-281-40/+60
| | | | | | tls support git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@25220 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] uhttpd: protect tcp receive operations with select, make tcp ↵jow2011-01-093-21/+45
| | | | | | keep-alive optional (#8272) git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@24952 3c298f89-4303-0410-b956-a3cf2f4a3e73