Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-nbxmpp for openSUSE:Factory checked in at 2021-11-13 22:48:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-nbxmpp (Old) and /work/SRC/openSUSE:Factory/.python-nbxmpp.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-nbxmpp" Sat Nov 13 22:48:43 2021 rev:26 rq:931289 version:2.0.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-nbxmpp/python-nbxmpp.changes 2021-10-26 20:14:58.222050268 +0200 +++ /work/SRC/openSUSE:Factory/.python-nbxmpp.new.1890/python-nbxmpp.changes 2021-11-13 22:49:13.757282330 +0100 @@ -1,0 +2,10 @@ +Sat Nov 13 20:27:18 UTC 2021 - Dirk M??ller <dmuel...@suse.com> + +- update to 2.0.4: + * Ignore messages with incorrect id + * AdHoc: Make parsing AdHoc commands more compliant + * Correctly handle RSM count request + * Improve XEP-0050 Compliance + * GSSAPI: Catch OSError + +------------------------------------------------------------------- Old: ---- python-nbxmpp-nbxmpp-2.0.2.tar.bz2 New: ---- python-nbxmpp-nbxmpp-2.0.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-nbxmpp.spec ++++++ --- /var/tmp/diff_new_pack.XOn60p/_old 2021-11-13 22:49:14.069282569 +0100 +++ /var/tmp/diff_new_pack.XOn60p/_new 2021-11-13 22:49:14.073282572 +0100 @@ -21,7 +21,7 @@ %define skip_python36 1 %define _name nbxmpp Name: python-nbxmpp -Version: 2.0.2 +Version: 2.0.4 Release: 0 Summary: XMPP library by Gajim team License: GPL-3.0-or-later ++++++ python-nbxmpp-nbxmpp-2.0.2.tar.bz2 -> python-nbxmpp-nbxmpp-2.0.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/ChangeLog new/python-nbxmpp-nbxmpp-2.0.4/ChangeLog --- old/python-nbxmpp-nbxmpp-2.0.2/ChangeLog 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/ChangeLog 2021-10-09 18:25:18.000000000 +0200 @@ -1,3 +1,18 @@ +python-nbxmpp 2.0.4 (09 October 2021) + + Bugfixes + + * Ignore messages with incorrect id + * AdHoc: Make parsing AdHoc commands more compliant + +python-nbxmpp 2.0.3 (24 July 2021) + + Bugfixes + + * Correctly handle RSM count request + * Improve XEP-0050 Compliance + * GSSAPI: Catch OSError + python-nbxmpp 2.0.2 (18 February 2021) Bugfixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/README.md new/python-nbxmpp-nbxmpp-2.0.4/README.md --- old/python-nbxmpp-nbxmpp-2.0.2/README.md 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/README.md 2021-10-09 18:25:18.000000000 +0200 @@ -13,7 +13,7 @@ ## Optional Runtime Requirements -- python-gssapi (for GSSAPI authentication) +- python-gssapi (for GSSAPI authentication https://pypi.org/project/gssapi/) ## Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/__init__.py new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/__init__.py --- old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/__init__.py 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/__init__.py 2021-10-09 18:25:18.000000000 +0200 @@ -4,4 +4,4 @@ gi.require_version('Soup', '2.4') -__version__ = "2.0.2" +__version__ = "2.0.4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/auth.py new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/auth.py --- old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/auth.py 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/auth.py 2021-10-09 18:25:18.000000000 +0200 @@ -37,7 +37,8 @@ try: gssapi = __import__('gssapi') GSSAPI_AVAILABLE = True -except ImportError: +except (ImportError, OSError) as error: + log.warning('GSSAPI not available: %s', error) GSSAPI_AVAILABLE = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/adhoc.py new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/adhoc.py --- old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/adhoc.py 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/adhoc.py 2021-10-09 18:25:18.000000000 +0200 @@ -66,18 +66,18 @@ yield command_list @iq_request_task - def execute_command(self, command, action=None, dataform=None): + def execute_command(self, cmd, action=None, dataform=None): _task = yield if action is None: action = AdHocAction.EXECUTE - attrs = {'node': command.node, + attrs = {'node': cmd.node, 'xmlns': Namespace.COMMANDS, 'action': action.value} - if command.sessionid is not None: - attrs['sessionid'] = command.sessionid + if cmd.sessionid is not None: + attrs['sessionid'] = cmd.sessionid - response = yield _make_command(command, attrs, dataform) + response = yield _make_command(cmd, attrs, dataform) if response.isError(): raise StanzaError(response) @@ -85,41 +85,44 @@ if command is None: raise MalformedStanzaError('command node missing', response) - attrs = command.getAttrs() - notes = [] - actions = [] + node = command.getAttr('node') + if node is None: + raise MalformedStanzaError('node attribute missing', response) + + status = command.getAttr('status') + if status is None: + raise MalformedStanzaError('status attribute missing', response) + + if status not in ('executing', 'completed', 'canceled'): + raise MalformedStanzaError('invalid status attribute %s' % status, + response) + + status = AdHocStatus(status) + + sessionid = command.getAttr('sessionid') + if sessionid is None and _expect_sessionid(status, cmd.sessionid): + raise MalformedStanzaError('sessionid attribute missing', response) + + try: + notes = _parse_notes(command) + except ValueError as error: + raise MalformedStanzaError(error, response) + try: - for note in command.getTags('note'): - type_ = note.getAttr('type') - if type_ is not None: - type_ = AdHocNoteType(note.getAttr('type')) - notes.append(AdHocCommandNote(text=note.getData(), - type=type_)) - - default = None - actions_ = command.getTag('actions') - if actions_ is not None: - for action_ in actions_.getChildren(): - actions.append(AdHocAction(action_.getName())) - - default = actions_.getAttr('execute') - if default is not None: - default = AdHocAction(default) - if default not in actions: - default = None - - yield AdHocCommand( - jid=str(response.getFrom()), - name=None, - node=attrs['node'], - sessionid=attrs.get('sessionid'), - status=AdHocStatus(attrs['status']), - data=command.getTag('x', namespace=Namespace.DATA), - actions=actions, - default=default, - notes=notes) - except Exception as error: - raise MalformedStanzaError(str(error), response) + actions, default = _parse_actions(command) + except ValueError as error: + raise MalformedStanzaError(error, response) + + yield AdHocCommand( + jid=response.getFrom(), + name=None, + node=node, + sessionid=sessionid, + status=status, + data=command.getTag('x', namespace=Namespace.DATA), + actions=actions, + default=default, + notes=notes) def _make_command(command, attrs, dataform): @@ -129,3 +132,74 @@ iq = Iq('set', to=command.jid) iq.addChild(node=command_node) return iq + + +def _parse_notes(command): + notes = [] + for note in command.getTags('note'): + type_ = note.getAttr('type') + if type_ is None: + type_ = 'info' + + if type_ not in ('info', 'warn', 'error'): + raise ValueError('invalid note type %s' % type_) + + notes.append(AdHocCommandNote(text=note.getData(), + type=AdHocNoteType(type_))) + return notes + + +def _parse_actions(command): + if command.getAttr('status') != 'executing': + return set(), None + + actions_node = command.getTag('actions') + if actions_node is None: + # If there is no <actions/> element, + # the user-agent can use a single-stage dialog or view. + # The action "execute" is equivalent to the action "complete". + return {AdHocAction.CANCEL, AdHocAction.COMPLETE}, AdHocAction.COMPLETE + + default = actions_node.getAttr('execute') + if default is None: + # If the "execute" attribute is absent, it defaults to "next". + default = 'next' + + if default not in ('prev', 'next', 'complete'): + raise ValueError('invalid execute attribute %s' % default) + + default = AdHocAction(default) + + # We use a set because it cannot contain duplicates + actions = set() + for action in actions_node.getChildren(): + name = action.getName() + if name == 'execute': + actions.add(default) + + if name in ('prev', 'next', 'complete'): + actions.add(AdHocAction(name)) + + if not actions: + raise ValueError('actions element without actions') + + # The action "cancel" is always allowed. + actions.add(AdHocAction.CANCEL) + + # A form which has an <actions/> element and an "execute" attribute + # which evaluates (taking the default into account if absent) to an + # action which is not allowed is therefore invalid. + if default not in actions: + # Some implementations don???t respect this rule. + # Take the first action so we don???t fail here. + for act in actions: + default = act + break + + return actions, default + + +def _expect_sessionid(status, sent_sessionid): + # Session id should only be expected for multiple stage commands + # or when we initialize the session (set the session attribute) + return status != status.COMPLETED or sent_sessionid is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/correction.py new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/correction.py --- old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/correction.py 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/correction.py 2021-10-09 18:25:18.000000000 +0200 @@ -44,4 +44,9 @@ self._log.warning(stanza) return + if stanza.getID() == id_: + self._log.warning('correcton id == message id') + self._log.warning(stanza) + return + properties.correction = CorrectionData(id_) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/mam.py new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/mam.py --- old/python-nbxmpp-nbxmpp-2.0.2/nbxmpp/modules/mam.py 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/nbxmpp/modules/mam.py 2021-10-09 18:25:18.000000000 +0200 @@ -66,7 +66,10 @@ raise MalformedStanzaError('rsm set missing', response) complete = fin.getAttr('complete') == 'true' - if not complete: + if max_ != 0 and not complete: + # max_ == 0 is a request for count of the items in a result set + # in this case first and last will be absent + # See: https://xmpp.org/extensions/xep-0059.html#count if rsm.first is None or rsm.last is None: raise MalformedStanzaError('first or last element missing', response) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-nbxmpp-2.0.2/setup.cfg new/python-nbxmpp-nbxmpp-2.0.4/setup.cfg --- old/python-nbxmpp-nbxmpp-2.0.2/setup.cfg 2021-02-18 22:51:55.000000000 +0100 +++ new/python-nbxmpp-nbxmpp-2.0.4/setup.cfg 2021-10-09 18:25:18.000000000 +0200 @@ -1,6 +1,6 @@ [metadata] name = nbxmpp -version = 2.0.2 +version = 2.0.4 description = XMPP Library author = Yann Leboulanger, Philipp Hoerist author_email = gajim-de...@gajim.org