subprocess bencoded stream is fragile re multiline strings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QBzr |
Fix Released
|
Critical
|
Alexander Belchenko |
Bug Description
Steps to reproduce:
Run qpush, push to lp without ssh-agent running (or without ssh key loaded into agent, e.g. pageant). Push will fail with error about publickey and qpush produce following traceback:
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "C:\work\
File "_bencode_pyx.pyx", line 225, in bzrlib.
File "_bencode_pyx.pyx", line 90, in bzrlib.
File "_bencode_pyx.pyx", line 112, in bzrlib.
File "_bencode_pyx.pyx", line 193, in bzrlib.
File "_bencode_pyx.pyx", line 118, in bzrlib.
File "_bencode_pyx.pyx", line 217, in bzrlib.
File "_bencode_pyx.pyx", line 109, in bzrlib.
File "_bencode_pyx.pyx", line 171, in bzrlib.
ValueError: stream underflow
bzr 2.1.1 on python 2.5.4 (win32)
arguments: ['C:\\Program Files\\
encoding: 'cp1251', fsenc: 'mbcs', lang: None
plugins:
acad C:\work\
bzrtools C:\Program Files\Bazaar\
colo C:\work\
explorer C:\work\
format1 C:\work\
launchpad C:\Program Files\Bazaar\
qbzr C:\work\
rebase C:\Program Files\Bazaar\
scmproj C:\work\
svn C:\Program Files\Bazaar\
x_bit C:\work\
The problem here is bzr produce multiline error message:
bzr: ERROR: Connection error: Unable to authenticate to SSH host as
<email address hidden>
supported auth types: ['publickey']
But we send this as one string and put into bencode container (to allow status window process it differently).
Our bencode streams all affected by this problem. I've fixed some edge cases in the past, but we have to redesign this streams entirely: either encode \n somehow, so pipe won't break it into separate lines, or split them into separate lines and send them as multiple bencoded lines. I think the former is preferable way because it could be a password prompt or something similar (look for bzr-git password prompt issue bug #dont-remeber-
Related branches
Changed in qbzr: | |
milestone: | none → 0.19b2 |
Changed in qbzr: | |
importance: | High → Critical |
Changed in qbzr: | |
assignee: | nobody → Alexander Belchenko (bialix) |
Changed in qbzr: | |
status: | Confirmed → Fix Released |
To debug:
bzr qsubprocess pull >stdout 2>stderr
stdout:
Using saved parent location: bzr+ssh: //bazaar. launchpad. net/~qbzr- dev/qbzr/ trunk2a/ l15:ConnectionE rrord3: msg103: Unable to authenticate to SSH host as ]10:orig_ error0: ee
qbzr:ERROR:
<email address hidden>
supported auth types: ['publickey'