]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix input race condition in t_skew.py
authorGreg Hudson <ghudson@mit.edu>
Wed, 5 Nov 2014 19:12:35 +0000 (14:12 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 5 Nov 2014 19:34:58 +0000 (14:34 -0500)
In two of the kinit tests run by t_skew.py, we expect kinit to exit
before reading the password.  If we supply a password input for those
commands, we can fail with a broken pipe exception if the master
process tries to write the password after the slave process exits.

Also correctly check the output of the last kinit invocation.

ticket: 8034 (new)
target_version: 1.13.1
tags: pullup

src/tests/t_skew.py

index aa91471428663137f932f6e3a4043ac19e5fa4eb..17649fcd4ba407e6fe8ec94714e80224e07ef277 100644 (file)
@@ -40,7 +40,7 @@ realm.kinit(realm.user_princ, password('user'),
 out = realm.kinit(realm.user_princ, password('user'), expected_code=1)
 if 'Clock skew too great in KDC reply' not in out:
     fail('Expected error message not seen in kinit skew case')
-out = realm.kinit(realm.user_princ, password('user'), flags=['-T', fast_cache],
+out = realm.kinit(realm.user_princ, None, flags=['-T', fast_cache],
                   expected_code=1)
 if 'Clock skew too great while' not in out:
     fail('Expected error message not seen in kinit FAST skew case')
@@ -50,8 +50,8 @@ realm.run_kadminl('modprinc +requires_preauth user')
 out = realm.kinit(realm.user_princ, password('user'), expected_code=1)
 if 'Clock skew too great while' not in out:
     fail('Expected error message not seen in kinit skew case (preauth)')
-realm.kinit(realm.user_princ, password('user'), flags=['-T', fast_cache],
-            expected_code=1)
+out = realm.kinit(realm.user_princ, None, flags=['-T', fast_cache],
+                  expected_code=1)
 if 'Clock skew too great while' not in out:
     fail('Expected error message not seen in kinit FAST skew case (preauth)')