summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/getrealm.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1997-12-12 05:30:35 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1997-12-12 05:30:35 +0000
commiteaf036b10d59d4a3ed4c0374ecd429610c80b2f9 (patch)
tree7e5f616bc347f6e420e75a57b6720fb0cbdcde1c /kerberosIV/krb/getrealm.c
parent38e69210c9cb774ff8ff883f1c83317a96ef9203 (diff)
Another upgrade of kth-krb + many fixes of strcpys and unchecked pointers.
Diffstat (limited to 'kerberosIV/krb/getrealm.c')
-rw-r--r--kerberosIV/krb/getrealm.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/kerberosIV/krb/getrealm.c b/kerberosIV/krb/getrealm.c
index b4c8b6fbcbf..d9ef7568e25 100644
--- a/kerberosIV/krb/getrealm.c
+++ b/kerberosIV/krb/getrealm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrealm.c,v 1.7 1997/12/09 07:57:19 art Exp $ */
+/* $OpenBSD: getrealm.c,v 1.8 1997/12/12 05:30:23 art Exp $ */
/* $KTH: getrealm.c,v 1.26 1997/10/08 22:51:13 joda Exp $ */
/*
@@ -94,26 +94,14 @@ dns_find_realm(char *hostname, char *realm)
static FILE *
open_krb_realms(void)
{
- static const char *const files[] = KRB_RLM_FILES;
- FILE *res;
- int i;
-
- const char *dir = getenv("KRBCONFDIR");
-
- /* First try user specified file */
- if (dir != 0 && getuid() != geteuid()) {
- char fname[MAXPATHLEN];
-
- if(k_concat(fname, sizeof(fname), dir, "/krb.realms", NULL) == 0)
- if ((res = fopen(fname, "r")) != NULL)
+ int i;
+ char file[128];
+ FILE *res;
+ for(i = 0; krb_get_krbrealms(i, file, sizeof(file)) == 0; i++)
+ if ((res = fopen(file, "r")) != NULL)
return res;
- }
-
- for (i = 0; files[i] != 0; i++)
- if ((res = fopen(files[i], "r")) != NULL)
- return res;
- return NULL;
+ return NULL;
}
static int