luci/libs/luci-lib-nixio
Daniel Dickinson b130ca554f lib-nixio / luci-base: Fix for reading csrf token prevents file upload
The call to http.formvalue in order to read the csrf token causes
_parse_input to be triggered *before* controllers and cbi maps have
been built.  This results in the failure of file uploads because
the file handler is not yet in place when _parse_input gets called,
and it is in _parse_input that POST data is parsed (including files).

To fix this we add the ability to write file fields to temporary
files (using mkstemp and unlink in nixio.file) and use this to
store file data until the filehandler is registered, with a
fallback to reading the file data into memory.

Once the filehandler callback gets registered we iterate
though all previously parsed (saved) files and copy the
data to the file handler, and then close the temporary
file (which finally removes because we unlinked after
creating the file, but didn't close the file so unlink
was deferred).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-15 13:12:29 -05:00
..
axTLS Rework LuCI build system 2015-01-08 16:26:20 +01:00
axtls-config Rework LuCI build system 2015-01-08 16:26:20 +01:00
axtls-root/etc/nixio Rework LuCI build system 2015-01-08 16:26:20 +01:00
docsrc luci-lib-nixio: move CHANGELOG and README into nixio namespace 2015-01-28 22:29:45 +01:00
root luci-lib-nixio: drop "bit" compatibility class 2015-01-15 16:05:31 +01:00
src lib-nixio / luci-base: Fix for reading csrf token prevents file upload 2015-12-15 13:12:29 -05:00
.gitignore Rework LuCI build system 2015-01-08 16:26:20 +01:00
LICENSE Rework LuCI build system 2015-01-08 16:26:20 +01:00
Makefile Rework LuCI build system 2015-01-08 16:26:20 +01:00
nixio-0.3-1.rockspec Rework LuCI build system 2015-01-08 16:26:20 +01:00
NOTICE Update my email addresses in the license headers 2015-01-16 23:49:44 +01:00
README Rework LuCI build system 2015-01-08 16:26:20 +01:00

Building:
	Use GNU Make.
	make or gmake depending on your system.
	
	Special make flags:

	OS		Override Target OS	[Linux|FreeBSD|SunOS|Windows]
	NIXIO_TLS	TLS-Library		[*openssl|axtls]
	NIXIO_CROSS_CC	MinGW CC (Windows)	`which i586-mingw32msvc-cc`
	LUA_CFLAGS	Lua CFLAGS		`pkg-config --cflags lua5.1`
	LUA_TARGET	Lua compile		target	[*source|strip|compile]
	LUA_MODULEDIR	Install LUA_PATH	"/usr/share/lua/5.1"
	LUA_LIBRARYDIR	Install LUA_CPATH	"/usr/lib/lua/5.1"