Commit Graph

5 Commits

Author SHA1 Message Date
Jo-Philipp Wich 46d0799c43 cgi-io: support SHA256 checksums for file uploads
Report SHA256 checksums in addition to the MD5 ones to make cgi-io suitable
for sysupgrade image verification.

Also allow stat(), md5sum and/or sha256sum to fail and respond with a JSON
null value instead, leaving it to the frontend to handle errors as needed.

Fixes #4790.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-11-13 17:16:29 +01:00
Jo-Philipp Wich f6f750ad17 cgi-io: fix stray semicolon
Remove an improperly placed semicolon in order to solve the following
compiler error:

.../main.c:144:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (execl("/bin/busybox", "/bin/busybox", "md5sum", file, NULL));
    ^~
    .../main.c:145:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    return NULL;
    ^~~~~~
    cc1: all warnings being treated as errors

Fixes #4723.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-08-18 14:28:33 +02:00
Daniel Golle e7b5bdd9e9 cgi-io: merge changes from luci2-io-helper
luci2-io-helper: bugfix buckup script read timeout

Reading files from stdin will block for ever. The uhttpd is killing the
backup process after script_timeout.

Switching read to non blocking mode and add a waitpid for the slave
process does not end in a script_timeout anymore.

Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-06-19 12:49:59 +02:00
Jo-Philipp Wich 9843f170d7 treewide: replace my defunct email address
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-06-07 12:00:59 +02:00
John Crispin fe31939c0e cgi-io: add a small helper cgi that can be used by RPCD based UIs
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-10-02 14:00:25 +02:00