summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-10-28 03:06:30 +0000
committerKen Raeburn <raeburn@mit.edu>2006-10-28 03:06:30 +0000
commit63cec6a81382e50e5e3e57f8e34bc3b95cdccb57 (patch)
tree5aaa0d0055d7a2037b36685d0a3faef4f3e8409f
parenteb99ac4ae7082472fbf7f125da9cad6e52fab090 (diff)
downloadkrb5-63cec6a81382e50e5e3e57f8e34bc3b95cdccb57.tar.gz
krb5-63cec6a81382e50e5e3e57f8e34bc3b95cdccb57.tar.xz
krb5-63cec6a81382e50e5e3e57f8e34bc3b95cdccb57.zip
don't confuse profile iterator in 425 princ conversion
The profile iterator code hangs onto and uses the list of names passed in. The krb5_425_conv_principal code reuses that array when the iterator may still be used. * conv_princ.c (krb5_425_conv_principal): Use separate name arrays for the iterator and the v4_realm lookup that may be done inside the iteration loop. ticket: new target_version: 1.6 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18748 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/krb/conv_princ.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c
index 67768835f2..5648b28f76 100644
--- a/src/lib/krb5/krb/conv_princ.c
+++ b/src/lib/krb5/krb/conv_princ.c
@@ -253,7 +253,7 @@ krb5_425_conv_principal(krb5_context context, const char *name, const char *inst
krb5_error_code retval;
char *domain, *cp;
char **full_name = 0;
- const char *names[5];
+ const char *names[2], *names2[5];
void* iterator = NULL;
char** v4realms = NULL;
char* realm_name = NULL;
@@ -262,9 +262,9 @@ krb5_425_conv_principal(krb5_context context, const char *name, const char *inst
/* First, convert the realm, since the v4 realm is not necessarily the same as the v5 realm
To do that, iterate over all the realms in the config file, looking for a matching
v4_realm line */
- names [0] = "realms";
- names [1] = NULL;
- retval = profile_iterator_create (context -> profile, names, PROFILE_ITER_LIST_SECTION | PROFILE_ITER_SECTIONS_ONLY, &iterator);
+ names2 [0] = "realms";
+ names2 [1] = NULL;
+ retval = profile_iterator_create (context -> profile, names2, PROFILE_ITER_LIST_SECTION | PROFILE_ITER_SECTIONS_ONLY, &iterator);
while (retval == 0) {
retval = profile_iterator (&iterator, &realm_name, &dummy_value);
if ((retval == 0) && (realm_name != NULL)) {
@@ -340,7 +340,7 @@ krb5_425_conv_principal(krb5_context context, const char *name, const char *inst
}
}
-not_service:
+not_service:
retval = krb5_build_principal(context, princ, strlen(realm), realm, name,
instance, NULL);
if (iterator) profile_iterator_free (&iterator);