diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 2000-02-28 05:16:54 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 2000-02-28 05:16:54 +0000 |
commit | 6d7c6ca4e58adcc6cc1db9110fa36d1aacc6c54d (patch) | |
tree | 196185fd91f65739e3d5458df3d8215aa1592329 | |
parent | c2939d9f9dcd759c25f06107adc67866c1694e2a (diff) |
Add back the OpenBSDism that a #commented realm means Kerberos is disabled.
Let's keep it in this time.
-rw-r--r-- | kerberosIV/src/lib/krb/get_krbrlm.c | 9 |
1 files 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 */ |