summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slave/ChangeLog5
-rw-r--r--src/slave/kprop.c18
-rw-r--r--src/slave/kpropd.c9
3 files changed, 23 insertions, 9 deletions
diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog
index 14fab3359..0d97f0927 100644
--- a/src/slave/ChangeLog
+++ b/src/slave/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 17 08:11:56 2000 Ezra Peisach <epeisach@mit.edu>
+
+ * kprop.c, kpropd.c: Use krb5_set_principal_realm() instead of
+ freeing library generated memory using the internal krb5_xfree().
+
Sat Oct 14 14:16:20 2000 Ezra Peisach <epeisach@mit.edu>
* kpropd.c, kprop.c: Ensure size of database sent OTW as 4 bytes
diff --git a/src/slave/kprop.c b/src/slave/kprop.c
index ff54eb603..edf8d0f0f 100644
--- a/src/slave/kprop.c
+++ b/src/slave/kprop.c
@@ -222,9 +222,12 @@ void get_tickets(context)
exit(1);
}
if (realm) {
- (void) krb5_xfree(krb5_princ_realm(context, my_principal)->data);
- krb5_princ_set_realm_length(context, my_principal, strlen(realm));
- krb5_princ_set_realm_data(context, my_principal, strdup(realm));
+ retval = krb5_set_principal_realm(context, my_principal, realm);
+ if (retval) {
+ com_err(progname, errno,
+ "while setting client principal realm");
+ exit(1);
+ }
}
#if 0
krb5_princ_type(context, my_principal) = KRB5_NT_PRINCIPAL;
@@ -265,9 +268,12 @@ void get_tickets(context)
exit(1);
}
if (realm) {
- (void) krb5_xfree(krb5_princ_realm(context, creds.server)->data);
- krb5_princ_set_realm_length(context, creds.server, strlen(realm));
- krb5_princ_set_realm_data(context, creds.server, strdup(realm));
+ retval = krb5_set_principal_realm(context, creds.server, realm);
+ if (retval) {
+ com_err(progname, errno,
+ "while setting server principal realm");
+ exit(1);
+ }
}
/*
diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c
index a5a7c05f4..2a7530d59 100644
--- a/src/slave/kpropd.c
+++ b/src/slave/kpropd.c
@@ -504,9 +504,12 @@ void PRS(argv)
exit(1);
}
if (realm) {
- (void) krb5_xfree(krb5_princ_realm(context, server)->data);
- krb5_princ_set_realm_length(context, server, strlen(realm));
- krb5_princ_set_realm_data(context, server, strdup(realm));
+ retval = krb5_set_principal_realm(kpropd_context, server, realm);
+ if (retval) {
+ com_err(progname, errno,
+ "while constructing my service realm");
+ exit(1);
+ }
}
/*
* Construct the name of the temporary file.