From: Miro Jurisic Date: Mon, 26 Jul 1999 16:34:48 +0000 (+0000) Subject: merged changes from the Mac_V2_0_derivatives branch and added krb5_get_profile X-Git-Tag: krb5-1.1-beta1~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2fd5cdff2c634835c0b6e871a0720515ee4006a8;p=krb5.git merged changes from the Mac_V2_0_derivatives branch and added krb5_get_profile git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11598 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index 668336c2b..edfbb5dc3 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -202,7 +202,7 @@ os_get_default_config_files(pfiles, secure) #ifdef macintosh files = malloc(3 * sizeof(FSSpec)); if (files != 0) { - OSErr err = GetMacProfileFileSpec(&(files [0]), "\pkrb Configuration"); + OSErr err = GetMacProfileFileSpec(&(files [0]), "\pKerberos5 Configuration"); if (err == noErr) { err = GetMacProfileFileSpec( &(files [1]), "\pkrb5.ini"); } @@ -391,6 +391,35 @@ krb5_os_init_context(ctx) return retval; } +krb5_error_code +krb5_get_profile (ctx, profile) + krb5_context ctx; + profile_t* profile; +{ + krb5_error_code retval = 0; + profile_filespec_t *files = 0; + + retval = os_get_default_config_files(&files, ctx->profile_secure); + + if (!retval) + retval = profile_init(files, profile); + + if (files) + free_filespecs(files); + + if (retval == ENOENT) + return KRB5_CONFIG_CANTOPEN; + + if ((retval == PROF_SECTION_NOTOP) || + (retval == PROF_SECTION_SYNTAX) || + (retval == PROF_RELATION_SYNTAX) || + (retval == PROF_EXTRA_CBRACE) || + (retval == PROF_MISSING_OBRACE)) + return KRB5_CONFIG_BADFORMAT; + + return retval; +} + #ifndef macintosh krb5_error_code