* kprop.c, kpropd.c: Use krb5_set_principal_realm() instead of
authorEzra Peisach <epeisach@mit.edu>
Tue, 17 Oct 2000 14:05:08 +0000 (14:05 +0000)
committerEzra Peisach <epeisach@mit.edu>
Tue, 17 Oct 2000 14:05:08 +0000 (14:05 +0000)
freeing library generated memory using the internal krb5_xfree().

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12769 dc483132-0cff-0310-8789-dd5450dbe970

src/slave/ChangeLog
src/slave/kprop.c
src/slave/kpropd.c

index 14fab3359e1946deb129ea294cd45a3b72de0c4d..0d97f09272b7fb56ff1b7acc30b4fe1bf69e99e3 100644 (file)
@@ -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
index ff54eb603eb08f06b58a5980718e7527448c1668..edf8d0f0fe880edf991d895ff13d5d5a7043a7eb 100644 (file)
@@ -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);
+           }
        }
 
        /*
index a5a7c05f4962304fd7000a2e4ca79b6f68809b64..2a7530d596eb37b876d94f577424a03b2425f6a4 100644 (file)
@@ -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.