From: Theodore Tso Date: Thu, 7 Nov 1996 17:11:19 +0000 (+0000) Subject: alt_prof.c (krb5_aprof_init): If the user specifies the config file X-Git-Tag: krb5-1.0-freeze1~106 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c6b692d6797f18ed55f4c8da89b56cac7cf1da2;p=krb5.git alt_prof.c (krb5_aprof_init): If the user specifies the config file using a configuration file, it must exist. Otherwise, krb5_aprof_init will return an error. (kadm5_get_config_params): If aprof_init returns an error, it should return an error as well. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9319 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog index 169c2e99f..0d735ce5e 100644 --- a/src/lib/kadm5/ChangeLog +++ b/src/lib/kadm5/ChangeLog @@ -1,3 +1,11 @@ +Mon Nov 4 21:16:01 1996 Theodore Y. Ts'o + + * alt_prof.c (krb5_aprof_init): If the user specifies the config + file using a configuration file, it must exist. + Otherwise, krb5_aprof_init will return an error. + (kadm5_get_config_params): If aprof_init returns an error, + it should return an error as well. + Wed Nov 6 17:45:43 1996 Barry Jaspan * kadm_rpc_xdr.c (xdr_krb5_principal): handle a NULL principal diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c index 374e22706..247050d49 100644 --- a/src/lib/kadm5/alt_prof.c +++ b/src/lib/kadm5/alt_prof.c @@ -55,18 +55,24 @@ krb5_aprof_init(fname, envname, acontextp) profile = (profile_t) NULL; if (envname) { if ((namelist[0] = getenv(envname))) { - if (!(kret = profile_init(namelist, &profile))) { - *acontextp = (krb5_pointer) profile; - return(0); - } + kret = profile_init(namelist, &profile); + if (kret) + return kret; + *acontextp = (krb5_pointer) profile; + return 0; } } profile = (profile_t) NULL; - if (fname && !(kret = profile_init_path(fname, &profile))) { + if (fname) { + kret = profile_init_path(fname, &profile); + if (kret == ENOENT) { + profile = 0; + } else if (kret) + return kret; *acontextp = (krb5_pointer) profile; - return(0); + return 0; } - return(kret); + return 0; } /* @@ -319,8 +325,9 @@ krb5_error_code kadm5_get_config_params(context, kdcprofile, kdcenv, if (context->profile_secure == TRUE) envname = 0; } - /* ignore failures */ - (void) krb5_aprof_init(filename, envname, &aprofile); + kret = krb5_aprof_init(filename, envname, &aprofile); + if (kret) + goto cleanup; /* Initialize realm parameters */ hierarchy[0] = "realms";