summaryrefslogtreecommitdiff
path: root/source4/torture/krb5
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2015-02-07 20:58:42 +1300
committerAndrew Bartlett <abartlet@samba.org>2015-02-08 08:07:07 +0100
commitd7752757c29d69547b361ed094f04ae4db4c9f8a (patch)
treed7adeee25f759fa8522e15d216936bba3521e9fc /source4/torture/krb5
parent0e89d586b2b7fa6a165a49862d2dce0d13f8b157 (diff)
downloadsamba-d7752757c29d69547b361ed094f04ae4db4c9f8a.tar.gz
torture-krb5: Do not do post-recv checks if the packet recv failed
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>
Diffstat (limited to 'source4/torture/krb5')
-rw-r--r--source4/torture/krb5/kdc-canon.c6
-rw-r--r--source4/torture/krb5/kdc.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/source4/torture/krb5/kdc-canon.c b/source4/torture/krb5/kdc-canon.c
index a0df97b2953..c14be00161d 100644
--- a/source4/torture/krb5/kdc-canon.c
+++ b/source4/torture/krb5/kdc-canon.c
@@ -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) {
diff --git a/source4/torture/krb5/kdc.c b/source4/torture/krb5/kdc.c
index a7b6ac83a3a..a6fcde957d4 100644
--- a/source4/torture/krb5/kdc.c
+++ b/source4/torture/krb5/kdc.c
@@ -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;