From 9b0450fb77a0f11a2d66047b1d90309466a471a6 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Mon, 13 Nov 1995 01:41:07 +0000 Subject: [PATCH] * def_realm.c (krb5_get_default_realm): check for PROF_NO_PROFILE and return KRB5_CONFIG_CANTOPEN instead of BADFORMAT so that the user in the end knows what is going on. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7097 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/def_realm.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 7e253c863..cf2c45624 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ +Sun Nov 12 05:31:21 1995 Mark W. Eichin + + * def_realm.c (krb5_get_default_realm): check for PROF_NO_PROFILE + and return KRB5_CONFIG_CANTOPEN instead of BADFORMAT so that the + user in the end knows what is going on. + Mon Oct 9 19:05:24 1995 Ezra Peisach * ktdefname.c (krb5_kt_default_name): If profile_secure flag is diff --git a/src/lib/krb5/os/def_realm.c b/src/lib/krb5/os/def_realm.c index fbff2d5ef..327a0931b 100644 --- a/src/lib/krb5/os/def_realm.c +++ b/src/lib/krb5/os/def_realm.c @@ -51,6 +51,7 @@ krb5_get_default_realm(context, lrealm) { char *realm; char *cp; + krb5_error_code retval; if (!context || (context->magic != KV5M_CONTEXT)) return KV5M_CONTEXT; @@ -61,9 +62,11 @@ krb5_get_default_realm(context, lrealm) * on the host's DNS domain. */ context->default_realm = 0; - profile_get_string(context->profile, "libdefaults", + retval = profile_get_string(context->profile, "libdefaults", "default_realm", 0, 0, &context->default_realm); + if (retval == PROF_NO_PROFILE) + return KRB5_CONFIG_CANTOPEN; if (context->default_realm == 0) return(KRB5_CONFIG_BADFORMAT); } -- 2.26.2