From: Bob Campbell Date: Wed, 18 Jan 2017 02:55:49 +0000 (+1300) Subject: torture/ntlm_auth: do not assume a line is less than 2047 bytes X-Git-Tag: talloc-2.1.9~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88e4b71e7856f5f1dc4cebd6d4408c9fd4499178;p=thirdparty%2Fsamba.git 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 Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py index fffeb2696b2..076019c539b 100755 --- a/source3/torture/test_ntlm_auth.py +++ b/source3/torture/test_ntlm_auth.py @@ -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 = buf.find('\n') - if newline == -1: - raise ReadChildError() + newline = -1 + buf = "" + while newline == -1: + more = os.read(pipe, 2047) + buf = buf + more + newline = buf.find('\n') + if more == "": + raise ReadChildError() + return buf[:newline] def writeLine(pipe, buf):