2001-07-24 Jeffrey Altman <jaltman@columbia.edu>
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 24 Jul 2001 20:29:38 +0000 (20:29 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 24 Jul 2001 20:29:38 +0000 (20:29 +0000)
        * def_realm.c:
            krb5_get_default_realm() required a profile file
            even when KRB5_DNS_LOOKUP was defined.

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

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/def_realm.c

index 5a4aeec93fe0903d835aa4f15f7e5fb3924782fb..7b09b1bfd93a8064f430c8a6cb8678961d069a10 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-24  Jeffrey Altman <jaltman@columbia.edu>
+
+        * def_realm.c: 
+            krb5_get_default_realm() required a profile file
+            even when KRB5_DNS_LOOKUP was defined.  
+
 2001-07-19  Ken Raeburn  <raeburn@mit.edu>
 
        * hostaddr.c: Include fake-addrinfo.h.
index 65e3902cd04d745c9d4e45cbd2193709f51373b1..82ef8ac32c7ee1a0147c2c0f6f916dd043e2c8af 100644 (file)
@@ -86,23 +86,25 @@ krb5_get_default_realm(context, lrealm)
          * on the host's DNS domain.
          */
         context->default_realm = 0;
-        if (context->profile == 0)
-            return KRB5_CONFIG_CANTOPEN;
-        retval = profile_get_string(context->profile, "libdefaults",
-                                     "default_realm", 0, 0,
-                                     &realm);
-
-        if (!retval && realm) {
-            context->default_realm = malloc(strlen(realm) + 1);
-            if (!context->default_realm) {
+        if (context->profile != 0) {
+            retval = profile_get_string(context->profile, "libdefaults",
+                                        "default_realm", 0, 0,
+                                        &realm);
+
+            if (!retval && realm) {
+                context->default_realm = malloc(strlen(realm) + 1);
+                if (!context->default_realm) {
+                    profile_release_string(realm);
+                    return ENOMEM;
+                }
+                strcpy(context->default_realm, realm);
                 profile_release_string(realm);
-                return ENOMEM;
             }
-            strcpy(context->default_realm, realm);
-            profile_release_string(realm);
         }
-
-#ifdef KRB5_DNS_LOOKUP
+#ifndef KRB5_DNS_LOOKUP
+        else 
+            return KRB5_CONFIG_CANTOPEN;
+#else /* KRB5_DNS_LOOKUP */
         if (context->default_realm == 0) {
             int use_dns =  _krb5_use_dns_realm(context);
             if ( use_dns ) {