krb5 commit: Fix kvno argument order in t_authdata.py

[email protected] Tue, 30 Sep 2025 17:40:10 -0400 (EDT)
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/14b762a41e61c677bd47bc6ced19ce8b05c000f0
commit 14b762a41e61c677bd47bc6ced19ce8b05c000f0
Author: Michael Osipov <[email protected]>
Date:   Sat Sep 27 11:44:25 2025 +0200

    Fix kvno argument order in t_authdata.py
    
    In t_authdata.py, correct a kvno invocation so that it doesn't rely on
    GNU getopt behavior.
    
    In k5test.py, add POSIXLY_CORRECT=1 to the test environment to prevent
    future mistakes in this category.
    
    [[email protected]: added test environment setting; edited commit
    message]

 src/tests/t_authdata.py | 2 +-
 src/util/k5test.py      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tests/t_authdata.py b/src/tests/t_authdata.py
index bde1c3684..72b57b0d7 100644
--- a/src/tests/t_authdata.py
+++ b/src/tests/t_authdata.py
@@ -331,7 +331,7 @@ rb.extract_keytab('user@B', rb.keytab)
 
 usercache = 'FILE:' + os.path.join(rb.testdir, 'usercache')
 rb.kinit(rb.user_princ, None, ['-k', '-f', '-c', usercache])
-rb.run([kvno, '-C', 'impersonator@A', '-c', usercache])
+rb.run([kvno, '-C', '-c', usercache, 'impersonator@A'])
 
 ra.kinit('impersonator@A', None, ['-f', '-k', '-t', ra.keytab])
 ra.run(['./s4u2proxy', usercache, 'resource@A'])
diff --git a/src/util/k5test.py b/src/util/k5test.py
index bef645dd0..fa8a75d15 100644
--- a/src/util/k5test.py
+++ b/src/util/k5test.py
@@ -671,6 +671,8 @@ def _build_env():
     # Make sure we don't get confused by translated messages
     # or localized times.
     env['LC_ALL'] = 'C'
+    # Enforce proper argument order in tests with GNU getopt.
+    env['POSIXLY_CORRECT'] = '1'
     return env