]> andersk Git - moira.git/commitdiff
get the kerberos server's name from /etc/krb.conf, and format it
authormar <mar>
Tue, 2 Aug 1988 21:09:53 +0000 (21:09 +0000)
committermar <mar>
Tue, 2 Aug 1988 21:09:53 +0000 (21:09 +0000)
appropriately for use as an instance name

reg_svr/admin_call.c

index ecbcc2c7e7359c9d7a1aabcfb2befc9d4c954e22..d0650e86be100e19223c4acadd25bcdde4c92404 100644 (file)
@@ -25,6 +25,7 @@ static char *rcsid_admin_call_c = "$Header$";
 
 #include <netdb.h>
 #include <strings.h>
+#include <ctype.h>
 #include <stdio.h>
 
 #include "admin_err.h"
@@ -91,6 +92,16 @@ int admin_call_init()
        bcopy((char *)hp->h_addr, (char *)&admin_addr.sin_addr, hp->h_length);
        admin_addr.sin_port = sp->s_port;
 
+       /* lowercase & truncate hostname becuase it will be used as an
+        * instance name.
+        */
+        {
+           char *s;
+           for (s = krbhost; *s && *s != '.'; s++)
+               if (isupper(*s))
+                   *s = tolower(*s);
+           *s = 0;
+       }
        inited = 1;
     }
     return 0;
@@ -182,7 +193,7 @@ admin_call(opcode, pname, old_passwd, new_passwd, crypt_passwd)
      * find our session key.
      */
 
-    if (status = krb_get_cred("changepw", "kerberos", krbrlm, &cred)) {
+    if (status = krb_get_cred("changepw", krbhost, krbrlm, &cred)) {
        status += krb_err_base;
        goto bad;
     }
@@ -252,7 +263,7 @@ admin_call(opcode, pname, old_passwd, new_passwd, crypt_passwd)
      * and know who we are.
      */
 
-    if (status = krb_mk_req(&authent, "changepw", "kerberos", krbrlm,
+    if (status = krb_mk_req(&authent, "changepw", krbhost, krbrlm,
                           checksum)) {
        status += krb_err_base;
        goto bad;
This page took 0.041711 seconds and 5 git commands to generate.