s3-selftest: make ntlm_auth test more robust to bad input
authorAndrew Bartlett <abartlet@samba.org>
Thu, 1 Mar 2012 06:44:48 +0000 (17:44 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Mar 2012 11:04:46 +0000 (22:04 +1100)
If we do not know the helper protocol, make sure to error.

Andrew Bartlett

source3/torture/test_ntlm_auth.py

index 386bfb7..1ee5b83 100755 (executable)
@@ -212,7 +212,7 @@ def main():
                        sys.exit(4)
 
        
-       if opts.client_helper == "ntlmssp-client-1" and opts.server_helper == "gss-spnego":
+       elif opts.client_helper == "ntlmssp-client-1" and opts.server_helper == "gss-spnego":
                # We're in the parent
                writeLine(client_out, "YR")
                buf = readLine(client_in)
@@ -242,7 +242,7 @@ def main():
                        sys.exit(4)
 
 
-       if opts.client_helper == "gss-spnego-client" and opts.server_helper == "gss-spnego":
+       elif opts.client_helper == "gss-spnego-client" and opts.server_helper == "gss-spnego":
                # We're in the parent
                writeLine(server_out, "YR")
                buf = readLine(server_in)
@@ -266,6 +266,9 @@ def main():
                        if buf.count("AF * ", 0, 5) == 1:
                                break
 
+       else:
+               sys.exit(5)
+
        if opts.client_helper == "ntlmssp-client-1":
                writeLine(client_out, "GK")
                buf = readLine(client_in)