diff options
author | Theodore Tso <tytso@mit.edu> | 1999-03-12 20:33:28 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1999-03-12 20:33:28 +0000 |
commit | 0d3268d4bd5a4f76e38db9b7c5bceb6372f350fe (patch) | |
tree | 1c90982692a0236a03610a20453b43c04d971cea /src/lib/krb5/os/ccdefname.c | |
parent | e7ed9d3ec084e83a10f3a13894d4b29de1cb4209 (diff) | |
download | krb5-0d3268d4bd5a4f76e38db9b7c5bceb6372f350fe.zip krb5-0d3268d4bd5a4f76e38db9b7c5bceb6372f350fe.tar.gz krb5-0d3268d4bd5a4f76e38db9b7c5bceb6372f350fe.tar.bz2 |
Check to make sure the context is valid and return an error if it
isn't.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11273 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/os/ccdefname.c')
-rw-r--r-- | src/lib/krb5/os/ccdefname.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index 18a7b99..fccdbf8 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -84,6 +84,9 @@ static krb5_error_code get_from_os(char *name_buf, int name_size) char *prefix = krb5_cc_dfl_ops->prefix; int len; + if (get_from_registry(name_buf, name_size) == 0) + return 0; + if (!strcmp(prefix, "FILE") || !strcmp(prefix, "STDIO")) { GetWindowsDirectory (defname, sizeof(defname)-7); strcat (defname, "\\krb5cc"); @@ -129,6 +132,9 @@ krb5_cc_set_default_name(context, name) krb5_error_code retval; krb5_os_context os_ctx; + if (!context || context->magic != KV5M_CONTEXT) + return KV5M_CONTEXT; + os_ctx = context->os_context; if (!name) @@ -161,10 +167,12 @@ krb5_cc_default_name(context) { krb5_os_context os_ctx; + if (!context || context->magic != KV5M_CONTEXT) + return NULL; + os_ctx = context->os_context; if (!os_ctx->default_ccname) krb5_cc_set_default_name(context, NULL); return(os_ctx->default_ccname); } - |