From 6d7c6ca4e58adcc6cc1db9110fa36d1aacc6c54d Mon Sep 17 00:00:00 2001 From: Jason Downs Date: Mon, 28 Feb 2000 05:16:54 +0000 Subject: Add back the OpenBSDism that a #commented realm means Kerberos is disabled. Let's keep it in this time. --- kerberosIV/src/lib/krb/get_krbrlm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kerberosIV/src/lib/krb/get_krbrlm.c b/kerberosIV/src/lib/krb/get_krbrlm.c index e39df6e549e..884c1177e4f 100644 --- a/kerberosIV/src/lib/krb/get_krbrlm.c +++ b/kerberosIV/src/lib/krb/get_krbrlm.c @@ -82,7 +82,7 @@ krb_get_lrealm_f(char *r, int n, const char *fname) /* Does more junk follow? */ p += nchar; nchar = strspn(p, " \t\n"); - if (p[nchar] == 0) + if ((r[0] != '#') && (p[nchar] == 0)) ret = KSUCCESS; /* This was a realm name only line. */ done: @@ -98,10 +98,15 @@ krb_get_lrealm(char *r, int n) int i; char file[MaxPathLen]; + r[0] = '#'; + for (i = 0; krb_get_krbconf(i, file, sizeof(file)) == 0; i++) if (krb_get_lrealm_f(r, n, file) == KSUCCESS) return KSUCCESS; + if (r[0] == '#') + return KFAILURE; + /* When nothing else works try default realm */ if (n == 1) { char *t = krb_get_default_realm(); @@ -113,7 +118,7 @@ krb_get_lrealm(char *r, int n) return KSUCCESS; } else - return(KFAILURE); + return KFAILURE; } /* Returns local realm if that can be figured out else NO.DEFAULT.REALM */ -- cgit v1.2.3