summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>1999-07-23 03:20:38 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>1999-07-23 03:20:38 +0000
commit238956d1d3f378270f5517e007948a0aa3437029 (patch)
tree0256885b172381bcd2e491ac3b517ee323e1521e /src/lib
parent79674077d32842e8a9f4aea60d3b2ccf65a27e17 (diff)
downloadkrb5-238956d1d3f378270f5517e007948a0aa3437029.tar.gz
krb5-238956d1d3f378270f5517e007948a0aa3437029.tar.xz
krb5-238956d1d3f378270f5517e007948a0aa3437029.zip
Updated Windows section to use filespecs instead of filenames
Add support for storing the existence of a memory profile in the krb5_context git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11588 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/krb5/os/init_os_ctx.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c
index ee62eb96d..668336c2b 100644
--- a/src/lib/krb5/os/init_os_ctx.c
+++ b/src/lib/krb5/os/init_os_ctx.c
@@ -259,9 +259,9 @@ os_get_default_config_files(pfiles, secure)
if (!name)
return KRB5_CONFIG_CANTOPEN; /* should never happen */
- filenames = malloc(2 * sizeof(char *));
- filenames[0] = name;
- filenames[1] = 0;
+ files = malloc(2 * sizeof(char *));
+ files[0] = name;
+ files[1] = 0;
#else /* !_MSDOS && !_WIN32 */
char* filepath = 0;
int n_entries, i;
@@ -322,14 +322,23 @@ os_init_paths(ctx, secure)
profile_filespec_t *files = 0;
ctx->profile_secure = secure;
+ ctx->profile_in_memory = 0;
retval = os_get_default_config_files(&files, secure);
- if (!retval)
+ if (!retval) {
retval = profile_init(files, &ctx->profile);
-
- if (files)
- free_filespecs(files);
+
+ /* if none of the filenames can be opened use an empty profile */
+ if ( retval == ENOENT ) {
+ retval = profile_init(NULL,&ctx->profile);
+ if ( !retval )
+ ctx->profile_in_memory = 1;
+ }
+
+ if (files)
+ free_filespecs(files);
+ }
if (retval)
ctx->profile = 0;
@@ -448,13 +457,17 @@ krb5_os_free_context(ctx)
if (!os_ctx)
return;
- if (os_ctx->default_ccname)
+ if (os_ctx->default_ccname) {
free(os_ctx->default_ccname);
+ os_ctx->default_ccname = 0;
+ }
os_ctx->magic = 0;
free(os_ctx);
ctx->os_context = 0;
- if (ctx->profile)
+ if (ctx->profile) {
profile_release(ctx->profile);
+ ctx->profile = 0;
+ }
}