krb5 commit [krb5-1.12]: Add test for kinit -C WRONG_REALM response

Tom Yu tlyu at mit.edu
Mon Feb 9 18:19:12 EST 2015


https://github.com/krb5/krb5/commit/8b61c2c06b61ede1134f4623ec558ea2a0b3901a
commit 8b61c2c06b61ede1134f4623ec558ea2a0b3901a
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Jan 23 12:52:31 2015 -0500

    Add test for kinit -C WRONG_REALM response
    
    (cherry picked from commit c0778ab2252ece4c3510788d9b72f7f5e3bb05dd)
    
    ticket: 8125
    version_fixed: 1.12.3
    status: resolved

 src/tests/t_general.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/tests/t_general.py b/src/tests/t_general.py
index 98e77a2..5349b05 100755
--- a/src/tests/t_general.py
+++ b/src/tests/t_general.py
@@ -33,6 +33,13 @@ realm.stop()
 
 realm = K5Realm(create_host=False)
 
+# Test that WRONG_REALM responses aren't treated as referrals unless
+# they contain a crealm field pointing to a different realm.
+# (Regression test for #8060.)
+out = realm.run([kinit, '-C', 'notfoundprinc'], expected_code=1)
+if 'not found in Kerberos database' not in out:
+    fail('Expected error message not seen in kinit -C output')
+
 # Spot-check KRB5_TRACE output
 tracefile = os.path.join(realm.testdir, 'trace')
 realm.run(['env', 'KRB5_TRACE=' + tracefile, kinit, realm.user_princ],


More information about the cvs-krb5 mailing list