get local realm from master_princ instead of from krb5_get_default_realm()
authorTom Yu <tlyu@mit.edu>
Sat, 26 Mar 1994 06:23:56 +0000 (06:23 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 26 Mar 1994 06:23:56 +0000 (06:23 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3475 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/kerberos_v4.c

index 83a7434a4ce28768b44024f357c8c883d9b1010d..d605a4167b6418724c039ef03548398ddd5914f8 100644 (file)
@@ -384,6 +384,7 @@ main(argc, argv)
 #include <krb5/wordsize.h>
 #include <krb5/mit-des.h>
 #include <krb5/kdb.h>
+#include "extern.h"            /* to pick up master_princ */
 
 static krb5_error_code retval; 
 static krb5_data *response;
@@ -419,18 +420,12 @@ krb5_data **resp;
         return(retval);
 
     if (!*local_realm) {               /* local-realm name already set up */
-       retval = krb5_get_default_realm(&lrealm);
-       if (!retval) {
-           if (strlen(lrealm) < sizeof(local_realm))
-               strcpy(local_realm, lrealm);
-           else
-               retval = KRB5_CONFIG_NOTENUFSPACE;
-        }
-       if (retval) {
-           com_err("KRBV4KDC", retval,
-                   "while attempting to get default realm");
-           exit(1);
-        }
+       /* XXX assumes realm is null-terminated! */
+       lrealm = master_princ->realm.data;
+       if (strlen(lrealm) < sizeof(local_realm))
+           strcpy(local_realm, lrealm);
+       else
+           retval = KRB5_CONFIG_NOTENUFSPACE;
     }
     /* convert client_fulladdr to client_sockaddr:
      */