Comparison

core/sessionmanager.lua @ 10378:04c4750ff8d2

core.sessionmanager: Require that client-requested resources pass strict resourceprep
author Kim Alvefur <zash@zash.se>
date Sat, 02 Nov 2019 15:39:01 +0100
parent 10372:5482f21a18a2
child 10642:de90b2f5da8c
comparison
equal deleted inserted replaced
10377:4c36bc28b99e 10378:04c4750ff8d2
148 else 148 else
149 -- In case a plugin wants to poke at it 149 -- In case a plugin wants to poke at it
150 resource = event_payload.resource; 150 resource = event_payload.resource;
151 end 151 end
152 152
153 resource = resourceprep(resource or ""); 153 resource = resourceprep(resource or "", true);
154 resource = resource ~= "" and resource or generate_identifier(); 154 resource = resource ~= "" and resource or generate_identifier();
155 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing 155 --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing
156 156
157 if not hosts[session.host].sessions[session.username] then 157 if not hosts[session.host].sessions[session.username] then
158 local sessions = { sessions = {} }; 158 local sessions = { sessions = {} };