diff options
-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 */ |