1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

torture/ntlm_auth: do not assume a line is less than 2047 bytes

These tests would fail when ran in our cloud. This was due to lines that
were more than 2047 bytes in length, causing us to fail readLine with a
ReadChildError. This fix lets it read lines of any length, but in 2047
byte segments.

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Bob Campbell 2017-01-18 15:55:49 +13:00 committed by Andrew Bartlett
parent ca961e6a62
commit 88e4b71e78

View File

@ -37,10 +37,15 @@ def readLine(pipe):
Read a line from the child's pipe, returns the string read.
Throws ReadChildError if the read fails.
"""
buf = os.read(pipe, 2047)
newline = -1
buf = ""
while newline == -1:
more = os.read(pipe, 2047)
buf = buf + more
newline = buf.find('\n')
if newline == -1:
if more == "":
raise ReadChildError()
return buf[:newline]
def writeLine(pipe, buf):