torture-krb5: Do not do post-recv checks if the packet recv failed
authorAndrew Bartlett <abartlet@samba.org>
Sat, 7 Feb 2015 07:58:42 +0000 (20:58 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 8 Feb 2015 07:07:07 +0000 (08:07 +0100)
This may be the cause of the flapping tests in this code previously,
as the recv_buf would be 0 length.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
source4/torture/krb5/kdc-canon.c
source4/torture/krb5/kdc.c

index a0df97b295353b50fced237fa60c488595569c03..c14be00161d9dee3afc77655eaf5c4822defa014 100644 (file)
@@ -212,7 +212,11 @@ static krb5_error_code smb_krb5_send_and_recv_func_canon_override(krb5_context c
        }
        
        k5ret = smb_krb5_send_and_recv_func_forced(context, test_context->server,
-                                                   hi, timeout, &modified_send_buf, recv_buf);
+                                                  hi, timeout, &modified_send_buf, 
+                                                  recv_buf);
+       if (k5ret != 0) {
+               return k5ret;
+       }
 
        ok = torture_krb5_post_recv_test(test_context, recv_buf);
        if (ok == false) {
index a7b6ac83a3a8437ba5a6b682e7c1ae25b3fd2e83..a6fcde957d4ed18d3c3d2c49908403ac8146ad2c 100644 (file)
@@ -267,7 +267,9 @@ static krb5_error_code smb_krb5_send_and_recv_func_override(krb5_context context
        
        k5ret = smb_krb5_send_and_recv_func_forced(context, test_context->server,
                                                    hi, timeout, send_buf, recv_buf);
-
+       if (k5ret != 0) {
+               return k5ret;
+       }
        ok = torture_krb5_post_recv_test(test_context, recv_buf);
        if (ok == false) {
                return EINVAL;