From 7736f53dc446aa109a26a0ccbcd7c039c5b8fb3f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 17 Jan 2017 22:04:58 +0100 Subject: [PATCH] Update LuCI to master branch --- modules | 3 +- .../lua/luci/view/gluon/cbi/config-mode.htm | 1 + .../controller/gluon-config-mode/index.lua | 6 +- .../lib/lua/luci/view/admin/expertmode.htm | 56 -------- .../usr/lib/lua/luci/view/admin/upgrade.htm | 2 +- .../lua/luci/view/admin/upgrade_confirm.htm | 7 +- .../lib/lua/luci/controller/admin/upgrade.lua | 6 + .../lib/lua/luci/model/cbi/admin/remote.lua | 4 +- .../lua/luci/model/cbi/admin/autoupdater.lua | 2 +- .../luci/model/cbi/admin/mesh_vpn_fastd.lua | 1 - .../lib/lua/luci/model/cbi/admin/noderole.lua | 1 - .../lua/luci/model/cbi/admin/portconfig.lua | 1 - .../lua/luci/model/cbi/admin/privatewifi.lua | 1 - .../lua/luci/model/cbi/admin/wifi-config.lua | 1 - .../files/lib/gluon/setup-mode/rc.d/S12rpcd | 5 + .../lib/gluon/upgrade/500-status-page-api | 2 + package/gluon.mk | 2 +- ...ass-STAGING_DIR_HOST-to-Host-Install.patch | 32 +++++ ...ue.html-add-label-that-can-be-styled.patch | 14 -- ....uci-add-add_to_set-remove_from_set.patch} | 8 +- ...none-provided-by-the-browser-matches.patch | 28 ---- ...-non-string-or-number-keys-in-tables.patch | 32 ----- ...lib-jsonc-allow-encoding-empty-lists.patch | 38 ----- ...b-jsonc-Fix-memory-leak-in-stringify.patch | 16 --- ...nc-Add-ltn12-compatible-sink-factory.patch | 133 ------------------ ...ency-from-luci-base-to-luci-mode-rpc.patch | 33 ----- 26 files changed, 63 insertions(+), 372 deletions(-) delete mode 100644 package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/expertmode.htm create mode 100755 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12rpcd create mode 100644 patches/openwrt/0095-build-pass-STAGING_DIR_HOST-to-Host-Install.patch delete mode 100644 patches/packages/luci/0001-fvalue.html-add-label-that-can-be-styled.patch rename patches/packages/luci/{0007-model.uci-add-add_to_set-remove_from_set.patch => 0001-model.uci-add-add_to_set-remove_from_set.patch} (90%) delete mode 100644 patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch delete mode 100644 patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch delete mode 100644 patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch delete mode 100644 patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch delete mode 100644 patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch delete mode 100644 patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch diff --git a/modules b/modules index db6da19f..ca223295 100644 --- a/modules +++ b/modules @@ -15,5 +15,4 @@ PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_COMMIT=d848d49d2443448b147c564c2dd8f64433b5fb9c PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git -PACKAGES_LUCI_COMMIT=70a4d43cc895b7d728b4fc201f2b6fd9f4b8aaec -PACKAGES_LUCI_BRANCH=for-15.05 +PACKAGES_LUCI_COMMIT=d7328360632d7fbf5fd4006b4172a9fe9861d838 diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon/cbi/config-mode.htm b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon/cbi/config-mode.htm index b4aca92e..e608b52c 100644 --- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon/cbi/config-mode.htm +++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon/cbi/config-mode.htm @@ -19,6 +19,7 @@
+
<% end %> diff --git a/package/gluon-config-mode-core/luasrc/usr/lib/lua/luci/controller/gluon-config-mode/index.lua b/package/gluon-config-mode-core/luasrc/usr/lib/lua/luci/controller/gluon-config-mode/index.lua index 0a6a5495..4e1f5232 100644 --- a/package/gluon-config-mode-core/luasrc/usr/lib/lua/luci/controller/gluon-config-mode/index.lua +++ b/package/gluon-config-mode-core/luasrc/usr/lib/lua/luci/controller/gluon-config-mode/index.lua @@ -32,11 +32,11 @@ function index() page.title = _("Wizard") page.target = alias("gluon-config-mode", "wizard") page.order = 5 - page.setuser = "root" - page.setgroup = "root" + page.sysauth = "root" + page.sysauth_authenticator = function() return "root" end page.index = true - entry({"gluon-config-mode", "wizard"}, form("gluon-config-mode/wizard")).index = true + entry({"gluon-config-mode", "wizard"}, cbi("gluon-config-mode/wizard")).index = true entry({"gluon-config-mode", "reboot"}, call("action_reboot")) end end diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/expertmode.htm b/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/expertmode.htm deleted file mode 100644 index 53947f3c..00000000 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/expertmode.htm +++ /dev/null @@ -1,56 +0,0 @@ -<% if not self.embedded then %> - -
- - -
-<% end %> -
- <% if self.title and #self.title > 0 then %>

<%=self.title%>

<% end %> - <%- if self.message then %> -

<%=self.message%>

- <%- end %> - <%- if self.errmessage then %> -

<%=self.errmessage%>

- <%- end %> - <% if self.description and #self.description > 0 then %>
<%=self.description%>
<% end %> - <% self:render_children() %> -
-<% if not self.embedded then %> -
-<%- - if type(self.hidden) == "table" then - for k, v in pairs(self.hidden) do --%> - -<%- - end - end -%> -<% if redirect then %> -
- -
-<% end %> -<%- if self.flow and self.flow.skip then %> - -<% end %> -<%- if self.submit ~= false then %> - -<% end %> -<%- if self.reset ~= false then %> - -<% end %> -<%- if self.cancel ~= false and self.on_cancel then %> - -<% end %> - -
-
-<% end %> diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade.htm b/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade.htm index a2b82235..87702918 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade.htm +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade.htm @@ -48,8 +48,8 @@ $Id$
+
<%+footer%> - diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade_confirm.htm b/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade_confirm.htm index 5618728f..d77f6c95 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade_confirm.htm +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/view/admin/upgrade_confirm.htm @@ -52,16 +52,17 @@ $Id$

-
+ " /> +
-
+ " /> +
<%+footer%> - diff --git a/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/controller/admin/upgrade.lua b/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/controller/admin/upgrade.lua index 2365f02c..1930e9ec 100644 --- a/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/controller/admin/upgrade.lua +++ b/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/controller/admin/upgrade.lua @@ -44,6 +44,12 @@ function action_upgrade() -- Determine state local step = tonumber(luci.http.formvalue("step") or 1) + + if step ~= 1 and not luci.dispatcher.test_post_security() then + nixio.fs.unlink(tmpfile) + return + end + local has_image = nixio.fs.access(tmpfile) local has_support = image_supported(tmpfile) diff --git a/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/model/cbi/admin/remote.lua b/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/model/cbi/admin/remote.lua index c79c0195..da0bf063 100644 --- a/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/model/cbi/admin/remote.lua +++ b/package/gluon-luci-admin/luasrc/usr/lib/lua/luci/model/cbi/admin/remote.lua @@ -18,7 +18,7 @@ local fs = require "nixio.fs" local m = Map("system", translate("SSH keys")) m.pageaction = false -m.template = "admin/expertmode" +m.template = "cbi/simpleform" if fs.access("/etc/config/dropbear") then local s = m:section(TypedSection, "_dummy1", nil, @@ -58,7 +58,7 @@ end local m2 = Map("system", translate("Password")) m2.reset = false m2.pageaction = false -m2.template = "admin/expertmode" +m2.template = "cbi/simpleform" local s = m2:section(TypedSection, "_dummy2", nil, translate( "Alternatively, you can set a password to access you node. Please choose a secure password you don't use anywhere else.

" diff --git a/package/gluon-luci-autoupdater/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua b/package/gluon-luci-autoupdater/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua index a8f9d3b3..5c1d81a0 100644 --- a/package/gluon-luci-autoupdater/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua +++ b/package/gluon-luci-autoupdater/luasrc/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua @@ -14,7 +14,7 @@ $Id$ m = Map("autoupdater", translate("Automatic updates")) m.pageaction = false -m.template = "admin/expertmode" +m.template = "cbi/simpleform" s = m:section(TypedSection, "autoupdater", nil) s.addremove = false diff --git a/package/gluon-luci-mesh-vpn-fastd/luasrc/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua b/package/gluon-luci-mesh-vpn-fastd/luasrc/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua index 14bb5783..1e918936 100644 --- a/package/gluon-luci-mesh-vpn-fastd/luasrc/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua +++ b/package/gluon-luci-mesh-vpn-fastd/luasrc/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua @@ -2,7 +2,6 @@ local uci = luci.model.uci.cursor() local util = luci.util local f = SimpleForm('mesh_vpn', translate('Mesh VPN')) -f.template = "admin/expertmode" local s = f:section(SimpleSection) diff --git a/package/gluon-luci-node-role/luasrc/usr/lib/lua/luci/model/cbi/admin/noderole.lua b/package/gluon-luci-node-role/luasrc/usr/lib/lua/luci/model/cbi/admin/noderole.lua index e7832ad9..8450a39c 100644 --- a/package/gluon-luci-node-role/luasrc/usr/lib/lua/luci/model/cbi/admin/noderole.lua +++ b/package/gluon-luci-node-role/luasrc/usr/lib/lua/luci/model/cbi/admin/noderole.lua @@ -8,7 +8,6 @@ local config = 'gluon-node-info' local role = uci:get(config, uci:get_first(config, "system"), "role") f = SimpleForm("role", i18n.translate("Node role")) -f.template = "admin/expertmode" s = f:section(SimpleSection, nil, i18n.translate( "If this node has a special role within the freifunk network you can specify this role here. " diff --git a/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index c3be0e7a..0e3458f5 100644 --- a/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/luasrc/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -21,7 +21,6 @@ local wan6 = uci:get_all("network", "wan6") local dns = uci:get_first("gluon-wan-dnsmasq", "static") local f = SimpleForm("portconfig", translate("WAN connection")) -f.template = "admin/expertmode" local s local o diff --git a/package/gluon-luci-private-wifi/luasrc/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua b/package/gluon-luci-private-wifi/luasrc/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua index 46a1a9d7..c4ff78d9 100644 --- a/package/gluon-luci-private-wifi/luasrc/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua +++ b/package/gluon-luci-private-wifi/luasrc/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua @@ -8,7 +8,6 @@ local primary_iface = 'wan_radio0' local ssid = uci:get('wireless', primary_iface, "ssid") f = SimpleForm("wifi", translate("Private WLAN")) -f.template = "admin/expertmode" s = f:section(SimpleSection, nil, translate( 'Your node can additionally extend your private network by bridging the WAN interface ' diff --git a/package/gluon-luci-wifi-config/luasrc/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua b/package/gluon-luci-wifi-config/luasrc/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua index efff8657..4f280de1 100644 --- a/package/gluon-luci-wifi-config/luasrc/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua +++ b/package/gluon-luci-wifi-config/luasrc/usr/lib/lua/luci/model/cbi/admin/wifi-config.lua @@ -41,7 +41,6 @@ end local f = SimpleForm("wifi", translate("WLAN")) -f.template = "admin/expertmode" local s = f:section(SimpleSection, nil, translate( "You can enable or disable your node's client and mesh network " diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12rpcd b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12rpcd new file mode 100755 index 00000000..3791a8ce --- /dev/null +++ b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12rpcd @@ -0,0 +1,5 @@ +#!/bin/sh /etc/rc.common + +if [ -x /etc/init.d/rpcd ]; then + . /etc/init.d/rpcd +fi diff --git a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api index ce1bf06e..854d1d26 100755 --- a/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api +++ b/package/gluon-status-page-api/files/lib/gluon/upgrade/500-status-page-api @@ -11,3 +11,5 @@ uci -q batch <<-EOF set uhttpd.main.max_requests=32 EOF + +/etc/init.d/rpcd disable diff --git a/package/gluon.mk b/package/gluon.mk index 9d35ad3c..05875a44 100644 --- a/package/gluon.mk +++ b/package/gluon.mk @@ -11,7 +11,7 @@ END__GLUON__CHECK__SITE endef # Languages supported by LuCi -GLUON_SUPPORTED_LANGS := ca zh_cn en fr de el he hu it ja ms no pl pt_br pt ro ru es sv uk vi +GLUON_SUPPORTED_LANGS := ca cs de el en es fr he hu it ja ms no pl pt-br pt ro ru sk sv tr uk vi zh-cn zh-tw GLUON_I18N_PACKAGES := $(foreach lang,$(GLUON_SUPPORTED_LANGS),+LUCI_LANG_$(lang):luci-i18n-base-$(lang)) GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_LUCI_LANG_$(lang)) diff --git a/patches/openwrt/0095-build-pass-STAGING_DIR_HOST-to-Host-Install.patch b/patches/openwrt/0095-build-pass-STAGING_DIR_HOST-to-Host-Install.patch new file mode 100644 index 00000000..cec0454f --- /dev/null +++ b/patches/openwrt/0095-build-pass-STAGING_DIR_HOST-to-Host-Install.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Tue, 23 Aug 2016 10:58:00 +0200 +Subject: build: pass $(STAGING_DIR_HOST) to Host/Install + +makes it more consistent with package builds + +Signed-off-by: Felix Fietkau + +Backport of LEDE 4170267f5a794eb3fa6bb1718a665e3395077434 + +diff --git a/include/host-build.mk b/include/host-build.mk +index 44401b866a4d637648bb093470a5e66b4a3e38fc..82d5361e30e897e18f5c9f9c57334c07bb74c490 100644 +--- a/include/host-build.mk ++++ b/include/host-build.mk +@@ -110,7 +110,7 @@ define Host/Install/Default + endef + + define Host/Install +- $(call Host/Install/Default) ++ $(call Host/Install/Default,$(STAGING_DIR_HOST)) + endef + + +@@ -171,7 +171,7 @@ ifndef DUMP + touch $$@ + + $(HOST_STAMP_INSTALLED): $(HOST_STAMP_BUILT) $(if $(FORCE_HOST_INSTALL),FORCE) +- $(call Host/Install) ++ $(call Host/Install,$(STAGING_DIR_HOST)) + $(foreach hook,$(Hooks/HostInstall/Post),$(call $(hook))$(sep)) + mkdir -p $$(shell dirname $$@) + touch $(HOST_STAMP_BUILT) diff --git a/patches/packages/luci/0001-fvalue.html-add-label-that-can-be-styled.patch b/patches/packages/luci/0001-fvalue.html-add-label-that-can-be-styled.patch deleted file mode 100644 index 49884984..00000000 --- a/patches/packages/luci/0001-fvalue.html-add-label-that-can-be-styled.patch +++ /dev/null @@ -1,14 +0,0 @@ -From: Nils Schneider -Date: Sat, 9 Aug 2014 09:33:21 +0200 -Subject: fvalue.html: add label that can be styled - -diff --git a/modules/luci-base/luasrc/view/cbi/fvalue.htm b/modules/luci-base/luasrc/view/cbi/fvalue.htm -index a1e0808e8d3e8bf1845d4838b244ed6bb0b605f2..a324ab258a86b080f9bf285aa62ee4db43468a81 100644 ---- a/modules/luci-base/luasrc/view/cbi/fvalue.htm -+++ b/modules/luci-base/luasrc/view/cbi/fvalue.htm -@@ -6,4 +6,5 @@ - attr("id", cbid) .. attr("name", cbid) .. attr("value", self.enabled or 1) .. - ifattr((self:cfgvalue(section) or self.default) == self.enabled, "checked", "checked") - %> /> -+ > - <%+cbi/valuefooter%> diff --git a/patches/packages/luci/0007-model.uci-add-add_to_set-remove_from_set.patch b/patches/packages/luci/0001-model.uci-add-add_to_set-remove_from_set.patch similarity index 90% rename from patches/packages/luci/0007-model.uci-add-add_to_set-remove_from_set.patch rename to patches/packages/luci/0001-model.uci-add-add_to_set-remove_from_set.patch index 37abb91c..b0adfc1e 100644 --- a/patches/packages/luci/0007-model.uci-add-add_to_set-remove_from_set.patch +++ b/patches/packages/luci/0001-model.uci-add-add_to_set-remove_from_set.patch @@ -13,7 +13,7 @@ i.e. duplicated values will be removed. Also, order is not preserved. Signed-off-by: Nils Schneider diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua -index 1659137742940ea0621e2b57e98232f393dc7efa..d35b9d70e27913c9da302c6975a97888774de535 100644 +index 577c6cde08eaa6e10887c97b26fed000f3289070..e77cacec5dfeb447085b13d6275edfe873beb3c4 100644 --- a/modules/luci-base/luasrc/model/uci.lua +++ b/modules/luci-base/luasrc/model/uci.lua @@ -9,7 +9,7 @@ local table = require "table" @@ -25,7 +25,7 @@ index 1659137742940ea0621e2b57e98232f393dc7efa..d35b9d70e27913c9da302c6975a97888 local type, tostring, tonumber, unpack = type, tostring, tonumber, unpack -- The typical workflow for UCI is: Get a cursor instance from the -@@ -147,6 +147,40 @@ function Cursor.set_list(self, config, section, option, value) +@@ -150,6 +150,40 @@ function Cursor.set_list(self, config, section, option, value) return false end @@ -67,10 +67,10 @@ index 1659137742940ea0621e2b57e98232f393dc7efa..d35b9d70e27913c9da302c6975a97888 function Cursor._affected(self, configlist) configlist = type(configlist) == "table" and configlist or {configlist} diff --git a/modules/luci-base/luasrc/model/uci.luadoc b/modules/luci-base/luasrc/model/uci.luadoc -index 1c208669d17f24d2d1de99bbbf1cefe878649014..281bdb2953ee1888ee41d8d0fb1cc40e9345b3e0 100644 +index 49093c7930128f1e6de6f739662b96adcc43fe74..cfec9eea7922da551cb8d2a4f2c540d479b8ccbe 100644 --- a/modules/luci-base/luasrc/model/uci.luadoc +++ b/modules/luci-base/luasrc/model/uci.luadoc -@@ -116,6 +116,30 @@ Set given values as list. +@@ -118,6 +118,30 @@ has the same effect as deleting the option. ]] ---[[ diff --git a/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch b/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch deleted file mode 100644 index d1ad5944..00000000 --- a/patches/packages/luci/0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Matthias Schiffer -Date: Thu, 19 Mar 2015 18:44:52 +0100 -Subject: modules/base: dispatcher: set default language if none provided by the browser matches - -diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua -index 25269501068dd26efe5b85706b555996d63b0f6d..be2fc3453f528853519649e4b64ecb3fd14d80be 100644 ---- a/modules/luci-base/luasrc/dispatcher.lua -+++ b/modules/luci-base/luasrc/dispatcher.lua -@@ -182,6 +182,7 @@ function dispatch(request) - assert(conf.main, - "/etc/config/luci seems to be corrupt, unable to find section 'main'") - -+ local i18n = require "luci.i18n" - local lang = conf.main.lang or "auto" - if lang == "auto" then - local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or "" -@@ -193,7 +194,10 @@ function dispatch(request) - end - end - end -- require "luci.i18n".setlanguage(lang) -+ if lang == "auto" then -+ lang = i18n.default -+ end -+ i18n.setlanguage(lang) - - local c = ctx.tree - local stat diff --git a/patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch b/patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch deleted file mode 100644 index c1fc1438..00000000 --- a/patches/packages/luci/0003-luci-lib-jsonc-Ignore-non-string-or-number-keys-in-tables.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Jan-Philipp Litza -Date: Sun, 30 Aug 2015 15:42:52 +0200 -Subject: luci-lib-jsonc: Ignore non-string-or-number keys in tables - -Previously, the following caused a segmentation fault: - - json.stringify({[{}] = true}) - -This was caused by lua_tostring() returning NULL for anything but -strings and numbers, letting json_object_object_add crash. - -This patch makes jsonc ignore all keys which have no string -representation altogether. - -Signed-off-by: Jan-Philipp Litza - -diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c -index 49cb21f5bcb2817792d0eef8dc5cd567bc6d86bc..827fde8843082e956b0c89b5855feeabd790e880 100644 ---- a/libs/luci-lib-jsonc/src/jsonc.c -+++ b/libs/luci-lib-jsonc/src/jsonc.c -@@ -286,8 +286,9 @@ static struct json_object * _lua_to_json(lua_State *L, int index) - lua_pushvalue(L, -2); - key = lua_tostring(L, -1); - -- json_object_object_add(obj, key, -- _lua_to_json(L, lua_gettop(L) - 1)); -+ if (key) -+ json_object_object_add(obj, key, -+ _lua_to_json(L, lua_gettop(L) - 1)); - - lua_pop(L, 2); - } diff --git a/patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch b/patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch deleted file mode 100644 index 55184774..00000000 --- a/patches/packages/luci/0004-luci-lib-jsonc-allow-encoding-empty-lists.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Jan-Philipp Litza -Date: Sun, 30 Aug 2015 15:45:49 +0200 -Subject: luci-lib-jsonc: allow encoding empty lists - -To be consistent with the behavior of luci-lib-json, an empty Lua table -should be encoded to an empty JSON list, not an empty JSON object. - -To still allow encoding empty JSON objects, the usage of anything other -than a number or a string as a key (for example an empty table or a -function) can be used to force encoding as an object: - - json.stringify({}) -- "[]" - json.stringify({[{}] = true}) -- "{}" - -Signed-off-by: Jan-Philipp Litza - -diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c -index 827fde8843082e956b0c89b5855feeabd790e880..971fb122f7655b379e717ef78a5417032ead9a57 100644 ---- a/libs/luci-lib-jsonc/src/jsonc.c -+++ b/libs/luci-lib-jsonc/src/jsonc.c -@@ -222,7 +222,7 @@ static int _lua_test_array(lua_State *L, int index) - - out: - lua_pop(L, 2); -- return 0; -+ return -1; - } - - /* check for holes */ -@@ -254,7 +254,7 @@ static struct json_object * _lua_to_json(lua_State *L, int index) - case LUA_TTABLE: - max = _lua_test_array(L, index); - -- if (max > 0) -+ if (max >= 0) - { - obj = json_object_new_array(); - diff --git a/patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch b/patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch deleted file mode 100644 index 473a1f9e..00000000 --- a/patches/packages/luci/0005-luci-lib-jsonc-Fix-memory-leak-in-stringify.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Jan-Philipp Litza -Date: Mon, 31 Aug 2015 19:52:36 +0200 -Subject: luci-lib-jsonc: Fix memory leak in stringify() - -diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c -index 971fb122f7655b379e717ef78a5417032ead9a57..b857c979e93bec395bca164a4f144c7c69005bec 100644 ---- a/libs/luci-lib-jsonc/src/jsonc.c -+++ b/libs/luci-lib-jsonc/src/jsonc.c -@@ -106,6 +106,7 @@ static int json_stringify(lua_State *L) - flags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED; - - lua_pushstring(L, json_object_to_json_string_ext(obj, flags)); -+ json_object_put(obj); - return 1; - } - diff --git a/patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch b/patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch deleted file mode 100644 index 86ccc9cb..00000000 --- a/patches/packages/luci/0006-luci-lib-jsonc-Add-ltn12-compatible-sink-factory.patch +++ /dev/null @@ -1,133 +0,0 @@ -From: Jan-Philipp Litza -Date: Tue, 1 Sep 2015 16:17:23 +0200 -Subject: luci-lib-jsonc: Add ltn12-compatible sink factory - -To use the luci-lib-jsonc parser as sink for an ltn12 pump (for example -from stdin), the following code will now do: - - require 'luci.ltn12' - require 'luci.jsonc' - - local parser = luci.jsonc.new() - luci.ltn12.pump.all(luci.ltn12.source.file(io.input()), parser:sink()) - print(parser:get()) - -Signed-off-by: Jan-Philipp Litza - -diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c -index b857c979e93bec395bca164a4f144c7c69005bec..ef1110166055a78bf32cf1a6fbbd3e356b2bce3f 100644 ---- a/libs/luci-lib-jsonc/src/jsonc.c -+++ b/libs/luci-lib-jsonc/src/jsonc.c -@@ -328,6 +328,76 @@ static int json_parse_set(lua_State *L) - return 0; - } - -+static int json_parse_sink_closure(lua_State *L) -+{ -+ bool finished = lua_toboolean(L, lua_upvalueindex(2)); -+ if (lua_isnil(L, 1)) -+ { -+ // no more data available -+ if (finished) -+ { -+ // we were finished parsing -+ lua_pushboolean(L, true); -+ return 1; -+ } -+ else -+ { -+ lua_pushnil(L); -+ lua_pushstring(L, "Incomplete JSON data"); -+ return 2; -+ } -+ } -+ else -+ { -+ if (finished) -+ { -+ lua_pushnil(L); -+ lua_pushstring(L, "Unexpected data after complete JSON object"); -+ return 2; -+ } -+ else -+ { -+ // luci.jsonc.parser.chunk() -+ lua_pushcfunction(L, json_parse_chunk); -+ // parser object from closure -+ lua_pushvalue(L, lua_upvalueindex(1)); -+ // chunk -+ lua_pushvalue(L, 1); -+ lua_call(L, 2, 2); -+ -+ if (lua_isnil(L, -2)) -+ { -+ // an error occurred, leave (nil, errmsg) on the stack and return it -+ return 2; -+ } -+ else if (lua_toboolean(L, -2)) -+ { -+ // finished reading, set finished=true and return nil to prevent further input -+ lua_pop(L, 2); -+ lua_pushboolean(L, true); -+ lua_replace(L, lua_upvalueindex(2)); -+ lua_pushnil(L); -+ return 1; -+ } -+ else -+ { -+ // not finished reading, return true -+ lua_pop(L, 2); -+ lua_pushboolean(L, true); -+ return 1; -+ } -+ } -+ } -+} -+ -+static int json_parse_sink(lua_State *L) -+{ -+ luaL_checkudata(L, 1, LUCI_JSONC_PARSER); -+ lua_pushboolean(L, false); -+ lua_pushcclosure(L, json_parse_sink_closure, 2); -+ return 1; -+} -+ - static int json_tostring(lua_State *L) - { - struct json_state *s = luaL_checkudata(L, 1, LUCI_JSONC_PARSER); -@@ -367,6 +437,7 @@ static const luaL_reg jsonc_parser_methods[] = { - { "parse", json_parse_chunk }, - { "get", json_parse_get }, - { "set", json_parse_set }, -+ { "sink", json_parse_sink }, - { "stringify", json_tostring }, - - { "__gc", json_gc }, -diff --git a/libs/luci-lib-jsonc/src/jsonc.luadoc b/libs/luci-lib-jsonc/src/jsonc.luadoc -index 2ee9cebdc889242595f5281228783df15b9b8dcd..720b17d1eb76d8eb9a8b47939ac724891cfb3886 100644 ---- a/libs/luci-lib-jsonc/src/jsonc.luadoc -+++ b/libs/luci-lib-jsonc/src/jsonc.luadoc -@@ -121,10 +121,22 @@ parser:set({ "some", "data" })` - ]] - - ---[[ --Serialize current parser state as JSON. -+Generate an ltn12-compatible sink. - - @class function - @sort 4 -+@name parser.sink -+@return Returns a function that can be used as an ltn12 sink. -+@usage `parser = luci.jsonc.new() -+ltn12.pump.all(ltn12.source.file(io.input()), parser:sink()) -+print(parser:get())` -+]] -+ -+---[[ -+Serialize current parser state as JSON. -+ -+@class function -+@sort 5 - @name parser.stringify - @param pretty A boolean value indicating whether the resulting JSON should be pretty printed. - @return Returns the serialized JSON data of this parser instance. diff --git a/patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch b/patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch deleted file mode 100644 index 6376d6a2..00000000 --- a/patches/packages/luci/0008-Move-rpcd-dependency-from-luci-base-to-luci-mode-rpc.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 6 Sep 2015 01:27:06 +0200 -Subject: Move rpcd dependency from luci-base to luci-mode-rpc - -LuCI's authentication won't work without rpcd, but we aren't using the -authentication anyways. Users who need it can just install rpcd explicitly. - -diff --git a/modules/luci-base/Makefile b/modules/luci-base/Makefile -index 54506b023a728e071b8fb4983ef614897363c0ec..4457034ada02972908a68f7c9c54352e7ac3c054 100644 ---- a/modules/luci-base/Makefile -+++ b/modules/luci-base/Makefile -@@ -12,7 +12,7 @@ LUCI_TYPE:=mod - LUCI_BASENAME:=base - - LUCI_TITLE:=LuCI core libraries --LUCI_DEPENDS:=+lua +libuci-lua +luci-lib-nixio +luci-lib-ip +rpcd +libubus-lua -+LUCI_DEPENDS:=+lua +libuci-lua +luci-lib-nixio +luci-lib-ip +libubus-lua - - PKG_SOURCE:=LuaSrcDiet-0.12.1.tar.bz2 - PKG_SOURCE_URL:=https://luasrcdiet.googlecode.com/files -diff --git a/modules/luci-mod-rpc/Makefile b/modules/luci-mod-rpc/Makefile -index e64c86c6283a5a7d1181816e9f148d78d15c7dd8..5f64a14d48ef1f74435e151bc03a2377239be1f8 100644 ---- a/modules/luci-mod-rpc/Makefile -+++ b/modules/luci-mod-rpc/Makefile -@@ -7,7 +7,7 @@ - include $(TOPDIR)/rules.mk - - LUCI_TITLE:=LuCI RPC - JSON-RPC API --LUCI_DEPENDS:=+luci-lib-json -+LUCI_DEPENDS:=+luci-lib-json +rpcd - - include ../../luci.mk -