Closed FiXXXeR78 closed 1 month ago
Looking at 3.2 Updating One's vCard it mentions:
If a user attempts to perform an IQ set on another user's vCard (i.e., by setting a 'to' address to a JID other than the sending user's bare JID), the server MUST return a stanza error, which SHOULD be
or .
This is not the same case... but not-allowed
looks a reasonable error response:
The recipient or server does not allow any entity to perform the action (e.g., sending to entities at a blacklisted domain); the associated error type SHOULD be "cancel".
The ejabberd response could be like this, right?
<iq xml:lang='es'
to='test6000@localhost/tka1'
from='test6000@localhost'
type='error'
id='30:478714'>
<vCard xmlns='vcard-temp'>
<NICKNAME>my nick</NICKNAME>
</vCard>
<error type='cancel'>
<not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xml:lang='en'
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Updating the vCard is not supported by the storage backend</text>
</error>
</iq>
I'm not a XMPP Guru, but "not-allowed" looks quite reasonable for me. Thank you!
Ah, other possible error condition could be 8.3.3.3. feature-not-implemented
Will this simple patch on mod_vcard.erl fix the issue? mod_vcard.erl.patch
Yes, the implementation generally follows that, thanks! There were two problems that I've solved and committed.
Try it, it should work perfectly now :)
Environment
Configuration
Errors from error.log/crash.log
Bug description
When mod_vcard configured to use LDAP backend, ejabberd processes crashes if user tries to update its VCard info. In mod_vcard.erl function vcard_iq_set calls set_vcard from mod_vcard_ldap.erl which returns not_implemented. vcard_iq_set does not know what to deal with it (it knows only ok and badarg return values), and process crashed. We need to correctry handle not_implemented return value.
In current 24.07 release the code looks the same, so it will behave as tested 21.12 code.