LINUX.ORG.RU

История изменений

Исправление netcat, (текущая версия) :

И вот еще что заметил:

...Запустилось, вывело кучу фигни...
DEBUG: socket       sent  b'<?xml version=\'1.0\'?>
  <stream:stream xmlns="jabber:client" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" to="jabber.ru" >'
Нажимаем ctrl-C
^CDEBUG: socket       got   b"<?xml version='1.0'?>
  <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1137092790' from='jabber.ru' version='1.0' xml:lang='ru'>
  <stream:features>
  <compression xmlns='http://jabber.org/features/compress'>
  <method>zlib</method>
  </compression>
  <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
  <mechanism>PLAIN</mechanism>
  <mechanism>DIGEST-MD5</mechanism>
  <mechanism>SCRAM-SHA-1</mechanism>
  </mechanisms>
  <c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='rvAR01fKsc40hT0hOLGDuG25y9o='/>
  <register xmlns='http://jabber.org/features/iq-register'/>
  </stream:features>"
DEBUG: dispatcher   warn  Unknown stanza: features
DEBUG: dispatcher   ok    Dispatching unknown stanza with type-> props->['http://jabber.org/features/compress', 'urn:ietf:params:xml:ns:xmpp-sasl', 'http://jabber.org/protocol/caps', 'http://jabber.org/features/iq-register'] id->None
DEBUG: sasl         start Plugging <xmpp.auth.SASL object at 0x7f95c0e4dad0> into <xmpp.client.Client object at 0x7f95c239e890>
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "challenge" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering namespace "urn:ietf:params:xml:ns:xmpp-sasl"
DEBUG: dispatcher   info  Registering protocol "unknown" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering protocol "default" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "challenge" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "failure" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "failure" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "success" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "success" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: socket       sent  b'<auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />'
И еще раз!
^CDEBUG: socket       got   b"<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>bm9uY2U9IjI4ODE0NTQ2NDgiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>"
DEBUG: dispatcher   ok    Got urn:ietf:params:xml:ns:xmpp-sasl/challenge stanza
DEBUG: dispatcher   ok    Dispatching challenge stanza with type-> props->[] id->None
DEBUG: sasl         ok    Got challenge:nonce="2881454648",qop="auth",charset=utf-8,algorithm=md5-sess
Traceback (most recent call last):
  File "linux-daemon/hardinform.py", line 516, in <module>
    main()
  File "linux-daemon/hardinform.py", line 511, in main
    iface.connect()
  File "linux-daemon/hardinform.py", line 170, in connect
    self.client.auth(self.config['xmpp_login'], self.config['xmpp_password'])
  File "/usr/lib64/python3.3/xmpp/client.py", line 226, in auth
    while self.SASL.startsasl=='in-process' and self.Process(1): pass
  File "/usr/lib64/python3.3/xmpp/dispatcher.py", line 125, in Process
    raise _pendingException[0](_pendingException[1]).with_traceback(_pendingException[2])
  File "/usr/lib64/python3.3/xmpp/dispatcher.py", line 303, in dispatch
    handler['func'](session,stanza)
  File "/usr/lib64/python3.3/xmpp/auth.py", line 194, in SASLHandler
    A1 = C([H(C([resp['username'],resp['realm'],self.password])),resp['nonce'],resp['cnonce']])
  File "/usr/lib64/python3.3/xmpp/auth.py", line 29, in C
    def C(some): return ':'.join(some.decode('utf-8'))
AttributeError: 'list' object has no attribute 'decode'
Это нормально? Просто сдохнуть оно должно было после первого ctrl-C как все остальные проги.

Исходная версия netcat, :

И вот еще что заметил:

...Запустилось, вывело кучу фигни...
DEBUG: socket       sent  b'<?xml version=\'1.0\'?>
  <stream:stream xmlns="jabber:client" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" to="jabber.ru" >'
Нажимаем ctrl-C
^CDEBUG: socket       got   b"<?xml version='1.0'?>
  <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='1137092790' from='jabber.ru' version='1.0' xml:lang='ru'>
  <stream:features>
  <compression xmlns='http://jabber.org/features/compress'>
  <method>zlib</method>
  </compression>
  <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
  <mechanism>PLAIN</mechanism>
  <mechanism>DIGEST-MD5</mechanism>
  <mechanism>SCRAM-SHA-1</mechanism>
  </mechanisms>
  <c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='rvAR01fKsc40hT0hOLGDuG25y9o='/>
  <register xmlns='http://jabber.org/features/iq-register'/>
  </stream:features>"
DEBUG: dispatcher   warn  Unknown stanza: features
DEBUG: dispatcher   ok    Dispatching unknown stanza with type-> props->['http://jabber.org/features/compress', 'urn:ietf:params:xml:ns:xmpp-sasl', 'http://jabber.org/protocol/caps', 'http://jabber.org/features/iq-register'] id->None
DEBUG: sasl         start Plugging <xmpp.auth.SASL object at 0x7f95c0e4dad0> into <xmpp.client.Client object at 0x7f95c239e890>
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "challenge" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering namespace "urn:ietf:params:xml:ns:xmpp-sasl"
DEBUG: dispatcher   info  Registering protocol "unknown" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering protocol "default" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "challenge" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "failure" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "failure" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   info  Registering handler <bound method SASL.SASLHandler of <xmpp.auth.SASL object at 0x7f95c0e4dad0>> for "success" type-> ns->(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: dispatcher   warn  Registering protocol "success" as <class 'xmpp.protocol.Protocol'>(urn:ietf:params:xml:ns:xmpp-sasl)
DEBUG: socket       sent  b'<auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />'
И еще раз!
^CDEBUG: socket       got   b"<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>bm9uY2U9IjI4ODE0NTQ2NDgiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>"
DEBUG: dispatcher   ok    Got urn:ietf:params:xml:ns:xmpp-sasl/challenge stanza
DEBUG: dispatcher   ok    Dispatching challenge stanza with type-> props->[] id->None
DEBUG: sasl         ok    Got challenge:nonce="2881454648",qop="auth",charset=utf-8,algorithm=md5-sess
Traceback (most recent call last):
  File "linux-daemon/hardinform.py", line 516, in <module>
    main()
  File "linux-daemon/hardinform.py", line 511, in main
    iface.connect()
  File "linux-daemon/hardinform.py", line 170, in connect
    self.client.auth(self.config['xmpp_login'], self.config['xmpp_password'])
  File "/usr/lib64/python3.3/xmpp/client.py", line 226, in auth
    while self.SASL.startsasl=='in-process' and self.Process(1): pass
  File "/usr/lib64/python3.3/xmpp/dispatcher.py", line 125, in Process
    raise _pendingException[0](_pendingException[1]).with_traceback(_pendingException[2])
  File "/usr/lib64/python3.3/xmpp/dispatcher.py", line 303, in dispatch
    handler['func'](session,stanza)
  File "/usr/lib64/python3.3/xmpp/auth.py", line 194, in SASLHandler
    A1 = C([H(C([resp['username'],resp['realm'],self.password])),resp['nonce'],resp['cnonce']])
  File "/usr/lib64/python3.3/xmpp/auth.py", line 29, in C
    def C(some): return ':'.join(some.decode('utf-8'))
AttributeError: 'list' object has no attribute 'decode'
Это нормально?