fall back on realm name as a default domain name
authorTom Yu <tlyu@mit.edu>
Fri, 10 Jun 1994 20:06:43 +0000 (20:06 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 10 Jun 1994 20:06:43 +0000 (20:06 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3732 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/realm_dom.c

index e7142b1d942bab2472aae3476c9c3067ee1214b0..42f93ce3afed123b840350fc47f40e93f61f8e39 100644 (file)
@@ -98,7 +98,12 @@ krb5_get_realm_domain(realm, domain)
                    krb5_xfree(realmlist[0]);
                    krb5_xfree(realmlist);
                }
-               *domain = NULL;
+               if ((retdomain = malloc(strlen(realm) + 2)) == NULL)
+                   return ENOMEM;
+               strcpy(retdomain, ".");
+               strcat(retdomain, realm); /* return the realm as the domain
+                                            if lookup fails */
+               *domain = retdomain;
                return 0;
            }
            continue;