Changeset

9455:c62c983b8be3

MUC: Check that a room password is set before verifying password supplied by user
author Michel Le Bihan <michel@lebihan.pl>
date Tue, 09 Oct 2018 18:42:19 +0200
parents 9454:6780049be177
children 9456:d54a0e129af8
files plugins/muc/password.lib.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/password.lib.lua	Tue Oct 09 15:02:44 2018 +0100
+++ b/plugins/muc/password.lib.lua	Tue Oct 09 18:42:19 2018 +0200
@@ -42,6 +42,7 @@
 -- Don't allow anyone to join room unless they provide the password
 module:hook("muc-occupant-pre-join", function(event)
 	local room, stanza = event.room, event.stanza;
+	if not get_password(room) then return end
 	local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc");
 	if not muc_x then return end
 	local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc");