commit aa28b92860357f3d445836205f7851c75566da35
Author: Maximilian Wilhelm <max@rfc2324.org>
Date: Fri May 24 14:46:41 2013 +0200
Fix handling of preferred realm command line option.
The current implementation ignores any preferred realm specified on the
command line. Fix this behaviour and make sure the preferred realm is
used as first realm when trying to acquire a keytab entry.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Frederik Moellers <frederik.moellers@upb.de>
@@ -857,6 +857,12 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
*/
i = 0;
realm = realmnames[i];
+
+ if (strcmp (realm, preferred_realm) != 0) {
+ realm = preferred_realm;
+ i = -1;
+ }
+
while (1) {
if (realm == NULL) {
tried_all = 1;