* get_krbhst.c (krb5_get_krbhst): look in KRB5_ENV_KDC
authorMark Eichin <eichin@mit.edu>
Wed, 3 May 1995 00:54:34 +0000 (00:54 +0000)
committerMark Eichin <eichin@mit.edu>
Wed, 3 May 1995 00:54:34 +0000 (00:54 +0000)
(KERBEROS_SERVER) for a REALM:SERVER string. This overrides
anything else for that realm and is intended for un-installed
client use, testsuite use, and diagnostic use.

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

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

index 9ee5d941b9df69fa44d1a94101dfd6be7e32e6ce..fd1eaf9084bf89939c0fbfbaa6a01b7602f246af 100644 (file)
@@ -1,3 +1,10 @@
+Tue May  2 20:51:14 1995  Mark Eichin  <eichin@cygnus.com>
+
+       * get_krbhst.c (krb5_get_krbhst): look in KRB5_ENV_KDC
+       (KERBEROS_SERVER) for a REALM:SERVER string. This overrides
+       anything else for that realm and is intended for un-installed
+       client use, testsuite use, and diagnostic use.
+
 Mon May  1 17:05:21 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * init_os_ctx.c (krb5_set_config_files): Added required const to
index 2a0042bbb3936c439461c4909263b33e4ea730b7..ba0f878b0fd49faf6c082e5c5ba1bcdb6815a2e1 100644 (file)
@@ -77,6 +77,24 @@ krb5_get_krbhst(context, realm, hostlist)
                                          * case.
                                          */
 
+    cp = getenv(KRB5_ENV_KDC);
+    /* Format is REALM:SERVER */
+    if (cp != NULL
+        && strncmp (realm->data, cp, realm->length) == 0
+        && cp[realm->length] == ':') {
+        rethlist = (char **)calloc(2, sizeof (*rethlist));
+       if (rethlist == NULL)
+           return ENOMEM;
+       rethlist[0] = strdup(cp + realm->length + 1);
+       if (rethlist[0] == NULL) {
+           krb5_xfree(rethlist);
+           return ENOMEM;
+       }
+       rethlist[1] = NULL;
+       *hostlist = rethlist;
+       return 0;
+    }
+
     krb5_find_config_files();
     if (!(config_file = fopen(krb5_config_file, "r")))
        /* can't open */