]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add test for kinit -C WRONG_REALM response
authorGreg Hudson <ghudson@mit.edu>
Fri, 23 Jan 2015 17:52:31 +0000 (12:52 -0500)
committerTom Yu <tlyu@mit.edu>
Mon, 9 Feb 2015 23:14:50 +0000 (18:14 -0500)
(cherry picked from commit c0778ab2252ece4c3510788d9b72f7f5e3bb05dd)

ticket: 8125
version_fixed: 1.12.3
status: resolved

src/tests/t_general.py

index 98e77a2f7444807fbab54e52ca34e8f60a7648eb..5349b05b5ac146f9ba136fcfc5374d0879792edd 100755 (executable)
@@ -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],