From fd1042f5ee3f1a3164ef231cb062578c0b4d4370 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Wed, 4 Feb 2015 18:50:36 +0200 Subject: Timezone data: Update to 2015a Timezone information is updated to 2015a, released on 30 Jan 15. I used build/zoneinfo2lua.pl to pull data from my Ubuntu 14.10. Changes are rather small: http://mm.icann.org/pipermail/tz-announce/2015-January/000028.html The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST. Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. Ps. I manually edited headers to have the shorter new copyright, instead of the long one generated buy the script. Signed-off-by: Hannu Nyman --- modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua | 8 ++++---- modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua index 6337496692..97a3608ea7 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua @@ -86,7 +86,7 @@ TZ = { { 'America/Boise', 'MST7MDT,M3.2.0,M11.1.0' }, { 'America/Cambridge Bay', 'MST7MDT,M3.2.0,M11.1.0' }, { 'America/Campo Grande', 'AMT4AMST,M10.3.0/0,M2.3.0/0' }, - { 'America/Cancun', 'CST6CDT,M4.1.0,M10.5.0' }, + { 'America/Cancun', 'EST5' }, { 'America/Caracas', 'VET4:30' }, { 'America/Cayenne', 'GFT3' }, { 'America/Cayman', 'EST5' }, @@ -178,7 +178,7 @@ TZ = { { 'America/Rio Branco', 'ACT5' }, { 'America/Santa Isabel', 'PST8PDT,M4.1.0,M10.5.0' }, { 'America/Santarem', 'BRT3' }, - { 'America/Santiago', 'CLT4CLST,M9.1.6/24,M4.4.6/24' }, + { 'America/Santiago', 'CLT3' }, { 'America/Santo Domingo', 'AST4' }, { 'America/Sao Paulo', 'BRT3BRST,M10.3.0/0,M2.3.0/0' }, { 'America/Scoresbysund', 'EGT1EGST,M3.5.0/0,M10.5.0/1' }, @@ -207,7 +207,7 @@ TZ = { { 'Antarctica/Macquarie', 'MIST-11' }, { 'Antarctica/Mawson', 'MAWT-5' }, { 'Antarctica/McMurdo', 'NZST-12NZDT,M9.5.0,M4.1.0/3' }, - { 'Antarctica/Palmer', 'CLT4CLST,M9.1.6/24,M4.4.6/24' }, + { 'Antarctica/Palmer', 'CLT3' }, { 'Antarctica/Rothera', 'ROTT3' }, { 'Antarctica/Syowa', 'SYOT-3' }, { 'Antarctica/Troll', 'UTC0CEST-2,M3.5.0/1,M10.5.0/3' }, @@ -384,7 +384,7 @@ TZ = { { 'Pacific/Bougainville', 'BST-11' }, { 'Pacific/Chatham', 'CHAST-12:45CHADT,M9.5.0/2:45,M4.1.0/3:45' }, { 'Pacific/Chuuk', 'CHUT-10' }, - { 'Pacific/Easter', 'EAST6EASST,M9.1.6/22,M4.4.6/22' }, + { 'Pacific/Easter', 'EAST5' }, { 'Pacific/Efate', 'VUT-11' }, { 'Pacific/Enderbury', 'PHOT-13' }, { 'Pacific/Fakaofo', 'TKT-13' }, diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua index facfd0c8bf..c8c908b6ea 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua @@ -45,8 +45,7 @@ OFFSET = { uyst = -7200, -- UYST fnt = -7200, -- FNT srt = -10800, -- SRT - clt = -14400, -- CLT - clst = -10800, -- CLST + clt = -10800, -- CLT egt = -3600, -- EGT egst = 0, -- EGST nst = -12600, -- NST @@ -135,8 +134,7 @@ OFFSET = { chast = 45900, -- CHAST chadt = 49500, -- CHADT chut = 36000, -- CHUT - east = -21600, -- EAST - easst = -18000, -- EASST + east = -18000, -- EAST vut = 39600, -- VUT phot = 46800, -- PHOT tkt = 46800, -- TKT -- cgit v1.2.3 From 993cf1222998a7e3e78ed8e81efb91eaf2313d00 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 9 Feb 2015 12:14:20 +0100 Subject: luci-base: establish ubus connection before dropping privileges (#310) Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/dispatcher.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 795b62bedb..a80dd706e0 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -371,6 +371,9 @@ function dispatch(request) end if track.setuser then + -- trigger ubus connection before dropping root privs + util.ubus() + sys.process.setuser(track.setuser) end -- cgit v1.2.3 From ec90cd69ed80ea4dfe8a9d44a42b155470c47b6b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 9 Feb 2015 13:03:44 +0100 Subject: luci-base: pass session timeout as integer Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/dispatcher.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index a80dd706e0..f92af528e1 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -333,7 +333,7 @@ function dispatch(request) return else if not sess then - local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime }) + local sdat = util.ubus("session", "create", { timeout = tonumber(luci.config.sauth.sessiontime) }) if sdat then local token = sys.uniqueid(16) util.ubus("session", "set", { -- cgit v1.2.3 From ec1a86977b1dc5cfc1c24ab1d54205531404087b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 9 Feb 2015 16:30:11 +0100 Subject: Avoid setting duplicate cookies Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/dispatcher.lua | 24 ++++++++++++++++------ .../luasrc/controller/admin/index.lua | 14 ++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index f92af528e1..8b8d1fa349 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -114,7 +114,14 @@ function authenticator.htmlauth(validator, accs, default) if context.urltoken.stok then context.urltoken.stok = nil - http.header("Set-Cookie", "sysauth=; path="..build_url()) + + local cookie = 'sysauth=%s; expires=%s; path=%s/' %{ + http.getcookie('sysauth') or 'x', + 'Thu, 01 Jan 1970 01:00:00 GMT', + build_url() + } + + http.header("Set-Cookie", cookie) http.redirect(build_url()) else require("luci.i18n") @@ -329,13 +336,14 @@ function dispatch(request) if not util.contains(accs, user) then if authen then local user, sess = authen(sys.user.checkpasswd, accs, def) + local token if not user or not util.contains(accs, user) then return else if not sess then local sdat = util.ubus("session", "create", { timeout = tonumber(luci.config.sauth.sessiontime) }) if sdat then - local token = sys.uniqueid(16) + token = sys.uniqueid(16) util.ubus("session", "set", { ubus_rpc_session = sdat.ubus_rpc_session, values = { @@ -345,15 +353,19 @@ function dispatch(request) } }) sess = sdat.ubus_rpc_session - ctx.urltoken.stok = token end end - if sess then - http.header("Set-Cookie", "sysauth=" .. sess.."; path="..build_url()) - http.redirect(build_url(unpack(ctx.requestpath))) + if sess and token then + http.header("Set-Cookie", 'sysauth=%s; path=%s/' %{ + sess, build_url() + }) + + ctx.urltoken.stok = token ctx.authsession = sess ctx.authuser = user + + http.redirect(build_url(unpack(ctx.requestpath))) end end else diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua index 74a3fd9adc..d00d546b64 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua @@ -28,13 +28,17 @@ end function action_logout() local dsp = require "luci.dispatcher" local utl = require "luci.util" - if dsp.context.authsession then - utl.ubus("session", "destroy", { - ubus_rpc_session = dsp.context.authsession - }) + local sid = dsp.context.authsession + + if sid then + utl.ubus("session", "destroy", { ubus_rpc_session = sid }) + dsp.context.urltoken.stok = nil + + luci.http.header("Set-Cookie", "sysauth=%s; expires=%s; path=%s/" %{ + sid, 'Thu, 01 Jan 1970 01:00:00 GMT', dsp.build_url() + }) end - luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url()) luci.http.redirect(luci.dispatcher.build_url()) end -- cgit v1.2.3 From d79f5da13f0ad2a50dc7f589371a9c4327ff6b42 Mon Sep 17 00:00:00 2001 From: Legend Tang Date: Sun, 1 Mar 2015 03:03:08 +0800 Subject: luci-base: fix wrong pattern of urlencode() (encode '+' properly) #182 --- modules/luci-base/luasrc/http/protocol.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/http/protocol.lua b/modules/luci-base/luasrc/http/protocol.lua index e9efb44cfa..61d7b802fe 100644 --- a/modules/luci-base/luasrc/http/protocol.lua +++ b/modules/luci-base/luasrc/http/protocol.lua @@ -72,7 +72,7 @@ function urlencode( str ) if type(str) == "string" then str = str:gsub( - "([^a-zA-Z0-9$_%-%.%+!*'(),])", + "([^a-zA-Z0-9$_%-%.!*'(),])", __chrenc ) end -- cgit v1.2.3 From 6160a53ab992e998adcda7119e49096a65a7f5de Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Mar 2015 12:43:29 +0100 Subject: luci-base: fix backslash escaping in luci.util.serialize_json() Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua index 8b28b1752d..dcf8230b3e 100644 --- a/modules/luci-base/luasrc/util.lua +++ b/modules/luci-base/luasrc/util.lua @@ -643,7 +643,7 @@ function serialize_json(x, cb) push(tostring(x)) end else - push('"%s"' % tostring(x):gsub('["%z\1-\31]', + push('"%s"' % tostring(x):gsub('["%z\1-\31\\]', function(c) return '\\u%04x' % c:byte(1) end)) end -- cgit v1.2.3 From 4d18e09e05db35782e38450cd149e3a4d44e53b4 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 19 Apr 2015 10:48:03 +0300 Subject: Timezone data: Update to 2015c Timezone information is updated to 2015c, released on 14 Apr 2015. I used build/zoneinfo2lua.pl to pull data from my Ubuntu 14.10. Changes in 2015b and 2015c are rather small: http://mm.icann.org/pipermail/tz-announce/2015-March/000029.html http://mm.icann.org/pipermail/tz-announce/2015-April/000030.html Mongolia will start observing DST again this year, from the last Saturday in March at 02:00 to the last Saturday in September at 00:00. Palestine will start DST on March 28, not March 27. Also, correct the fall 2014 transition from September 26 to October 24. Adjust future predictions accordingly. Egypt's spring-forward transition is at 24:00 on April's last Thursday, not 00:00 on April's last Friday. 2015's transition will therefore be on Thursday, April 30 at 24:00, not Friday, April 24 at 00:00. Similar fixes apply to 2026, 2037, 2043, etc. Signed-off-by: Hannu Nyman --- modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua | 12 ++++++------ modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/luci-base/luasrc') diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua index 97a3608ea7..148bdcbfc5 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua @@ -15,7 +15,7 @@ TZ = { { 'Africa/Blantyre', 'CAT-2' }, { 'Africa/Brazzaville', 'WAT-1' }, { 'Africa/Bujumbura', 'CAT-2' }, - { 'Africa/Cairo', 'EET-2EEST,M4.5.5/0,M9.5.4/24' }, + { 'Africa/Cairo', 'EET-2EEST,M4.5.4/24,M9.5.4/24' }, { 'Africa/Casablanca', 'WET0WEST,M3.5.0,M10.5.0/3' }, { 'Africa/Ceuta', 'CET-1CEST,M3.5.0,M10.5.0/3' }, { 'Africa/Conakry', 'GMT0' }, @@ -228,18 +228,18 @@ TZ = { { 'Asia/Bishkek', 'KGT-6' }, { 'Asia/Brunei', 'BNT-8' }, { 'Asia/Chita', 'IRKT-8' }, - { 'Asia/Choibalsan', 'CHOT-8' }, + { 'Asia/Choibalsan', 'CHOT-8CHOST,M3.5.6,M9.5.6/0' }, { 'Asia/Colombo', 'IST-5:30' }, { 'Asia/Damascus', 'EET-2EEST,M3.5.5/0,M10.5.5/0' }, { 'Asia/Dhaka', 'BDT-6' }, { 'Asia/Dili', 'TLT-9' }, { 'Asia/Dubai', 'GST-4' }, { 'Asia/Dushanbe', 'TJT-5' }, - { 'Asia/Gaza', 'EET-2EEST,M3.5.4/24,M9.3.6/144' }, - { 'Asia/Hebron', 'EET-2EEST,M3.5.4/24,M9.3.6/144' }, + { 'Asia/Gaza', 'EET-2EEST,M3.5.5/24,M10.3.6/144' }, + { 'Asia/Hebron', 'EET-2EEST,M3.5.5/24,M10.3.6/144' }, { 'Asia/Ho Chi Minh', 'ICT-7' }, { 'Asia/Hong Kong', 'HKT-8' }, - { 'Asia/Hovd', 'HOVT-7' }, + { 'Asia/Hovd', 'HOVT-7HOVST,M3.5.6,M9.5.6/0' }, { 'Asia/Irkutsk', 'IRKT-8' }, { 'Asia/Jakarta', 'WIB-7' }, { 'Asia/Jayapura', 'WIT-9' }, @@ -282,7 +282,7 @@ TZ = { { 'Asia/Tbilisi', 'GET-4' }, { 'Asia/Thimphu', 'BTT-6' }, { 'Asia/Tokyo', 'JST-9' }, - { 'Asia/Ulaanbaatar', 'ULAT-8' }, + { 'Asia/Ulaanbaatar', 'ULAT-8ULAST,M3.5.6,M9.5.6/0' }, { 'Asia/Urumqi', 'XJT-6' }, { 'Asia/Ust-Nera', 'VLAT-10' }, { 'Asia/Vientiane', 'ICT-7' }, diff --git a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua index c8c908b6ea..fe3f860977 100644 --- a/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua +++ b/modules/luci-base/luasrc/sys/zoneinfo/tzoffset.lua @@ -72,6 +72,7 @@ OFFSET = { bnt = 28800, -- BNT irkt = 28800, -- IRKT chot = 28800, -- CHOT + chost = 32400, -- CHOST ist = 19800, -- IST bdt = 21600, -- BDT tlt = 32400, -- TLT @@ -79,6 +80,7 @@ OFFSET = { tjt = 18000, -- TJT hkt = 28800, -- HKT hovt = 25200, -- HOVT + hovst = 28800, -- HOVST wib = 25200, -- WIB wit = 32400, -- WIT aft = 16200, -- AFT @@ -105,6 +107,7 @@ OFFSET = { btt = 21600, -- BTT jst = 32400, -- JST ulat = 28800, -- ULAT + ulast = 32400, -- ULAST xjt = 21600, -- XJT vlat = 36000, -- VLAT yekt = 18000, -- YEKT -- cgit v1.2.3