summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2002-06-04 23:57:09 +0000
committerKen Raeburn <raeburn@mit.edu>2002-06-04 23:57:09 +0000
commitbcc6b3c8263d1e8ba40a862d7ed676ef596d9503 (patch)
tree67f9f318e58262b332a68d21409d92d562fadfa1 /src
parent3f8af67edf1ec832ae48c3496dc7827c98a74beb (diff)
downloadkrb5-bcc6b3c8263d1e8ba40a862d7ed676ef596d9503.tar.gz
krb5-bcc6b3c8263d1e8ba40a862d7ed676ef596d9503.tar.xz
krb5-bcc6b3c8263d1e8ba40a862d7ed676ef596d9503.zip
* get_admhst.c: Deleted
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14472 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/kadm5/ChangeLog4
-rw-r--r--src/lib/kadm5/get_admhst.c89
2 files changed, 4 insertions, 89 deletions
diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog
index 47fa2a034c..1594e35aef 100644
--- a/src/lib/kadm5/ChangeLog
+++ b/src/lib/kadm5/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-04 Ken Raeburn <raeburn@mit.edu>
+
+ * get_admhst.c: Deleted.
+
2001-11-05 Ezra Peisach <epeisach@mit.edu>
* alt_prof.c (krb5_aprof_get_boolean): Return krb5_boolean *
diff --git a/src/lib/kadm5/get_admhst.c b/src/lib/kadm5/get_admhst.c
deleted file mode 100644
index a398997d6c..0000000000
--- a/src/lib/kadm5/get_admhst.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#ifndef lint
-static char *rcsid =
-"$Header$";
-#endif /* lint */
-
-#include <stdio.h>
-#include <krb5/osconf.h>
-#include <string.h>
-
-/*
- * Given a Kerberos realm, find a host on which the Kerberos database
- * administration server can be found.
- *
- * krb5_get_admhst takes a pointer to be filled in, a pointer to the name
- * of the realm for which a server is desired, and an integer n, and
- * returns (in h) the nth administrative host entry from the configuration
- * file DEFAULT_CONFIG_FILENAME.
- *
- * If the realm is NULL, the default realm is used.
- *
- * On error, get_admhst returns 0. If all goes well, the routine
- * returns 1.
- *
- * This is a temporary hack to allow us to find the nearest system running
- * a Kerberos admin server. In the long run, this functionality will be
- * provided by a nameserver.
- */
-int
-krb5_get_admhst(char *h, char *r, int n)
-{
- FILE *cnffile;
- char *realm = NULL;
- char tr[BUFSIZ];
- char linebuf[BUFSIZ];
- char scratch[64];
- register int i;
- int ret;
-
- if(r == NULL) {
- if((ret = krb5_get_default_realm(&realm)) != 0)
- return ret;
- r = realm;
- }
- if ((cnffile = fopen(DEFAULT_CONFIG_FILENAME, "r")) == NULL) {
- return(0);
- }
- if (fgets(linebuf, BUFSIZ, cnffile) == NULL) {
- /* error reading */
- (void) fclose(cnffile);
- return(0);
- }
- if (!strchr(linebuf, '\n')) {
- /* didn't all fit into buffer, punt */
- (void) fclose(cnffile);
- if(realm)
- free(realm);
- return(0);
- }
- for (i = 0; i < n; ) {
- /* run through the file, looking for admin host */
- if (fgets(linebuf, BUFSIZ, cnffile) == NULL) {
- (void) fclose(cnffile);
- if(realm)
- free(realm);
- return(0);
- }
- /* need to scan for a token after 'admin' to make sure that
- admin matched correctly */
- if (sscanf(linebuf, "%s %s admin %s", tr, h, scratch) != 3)
- continue;
- if (!strcmp(tr,r))
- i++;
- }
- (void) fclose(cnffile);
- if(realm)
- free(realm);
- return(1);
-}