#373 Server won't accept muc#roomconfig without muc#roomconfig_whois
Reporter
AlKorgun
Owner
MattJ
Created
Updated
Stars
★★ (3)
Tags
Priority-Medium
Status-Fixed
Milestone-0.10
Type-Defect
AlKorgun
on
Request:
<iq xmlns="jabber:client" to="26250615_chat#9@conference.localhost" from="26250615@vk.localhost" type="set">
<query xmlns="http://jabber.org/protocol/muc#owner">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/muc#roomconfig</value>
</field>
<field var="muc#roomconfig_membersonly" type="text-single">
<value>1</value>
</field>
</x>
</query>
</iq>
Answer:
<iq xmlns="jabber:component:accept" to="26250615@vk.localhost" type="error" id="4" from="26250615_chat#9@conference.localhost">
<error type="cancel">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Invalid value for 'whois'</text>
</error>
</iq>
When field "muc#roomconfig_whois" added to the request - result is ok.
MattJ
on
Hi, what version of Prosody are you using?
Changes
owner MattJ
AlKorgun
on
MWild1, 0.8.2
MattJ
on
I need to confirm whether this issue occurs in 0.9 (I made some changes to config handling). Adding a milestone so I don't forget.
Changes
tags Milestone-0.9
damencho@sip-communicator.org
on
Confirmed with prosody 0.9.4 and 0.9.1.
alex.marandon
on
Confirmed with 0.9.8.
Having looked the code, the issue seems to remain in more recent branches.
In plugins/muc/muc.lib.lua there's a check on the muc#roomconfig_whois:
if not valid_whois[whois] then
origin.send(st.error_reply(stanza, 'cancel', 'bad-request', "Invalid value for 'whois'"));
return;
end
So this fails when whois is nil (field missing).
Please also note that this would fail if whois was the string "none" because valid_whois is defined like this:
local valid_whois = {
moderators = true,
anyone = true,
}
But XEP-0054 says "The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"), semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here)." So it seems that valid_whois should include a "none" key.
Request: <iq xmlns="jabber:client" to="26250615_chat#9@conference.localhost" from="26250615@vk.localhost" type="set"> <query xmlns="http://jabber.org/protocol/muc#owner"> <x xmlns="jabber:x:data" type="submit"> <field var="FORM_TYPE" type="hidden"> <value>http://jabber.org/protocol/muc#roomconfig</value> </field> <field var="muc#roomconfig_membersonly" type="text-single"> <value>1</value> </field> </x> </query> </iq> Answer: <iq xmlns="jabber:component:accept" to="26250615@vk.localhost" type="error" id="4" from="26250615_chat#9@conference.localhost"> <error type="cancel"> <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /> <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Invalid value for 'whois'</text> </error> </iq> When field "muc#roomconfig_whois" added to the request - result is ok.
Hi, what version of Prosody are you using?
ChangesMWild1, 0.8.2
I need to confirm whether this issue occurs in 0.9 (I made some changes to config handling). Adding a milestone so I don't forget.
ChangesConfirmed with prosody 0.9.4 and 0.9.1.
Confirmed with 0.9.8. Having looked the code, the issue seems to remain in more recent branches. In plugins/muc/muc.lib.lua there's a check on the muc#roomconfig_whois: if not valid_whois[whois] then origin.send(st.error_reply(stanza, 'cancel', 'bad-request', "Invalid value for 'whois'")); return; end So this fails when whois is nil (field missing). Please also note that this would fail if whois was the string "none" because valid_whois is defined like this: local valid_whois = { moderators = true, anyone = true, } But XEP-0054 says "The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"), semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here)." So it seems that valid_whois should include a "none" key.
Is this still the case after #246 was fixed?
ChangesJust checked, this is fixed in 0.10.