lib/krb5: do not fail set_config_files due to parse error

Follow Apple's lead and do not fail krb5_set_config_files() simply
because one of the files in the profile list fails to parse correctly.
Doing so can lead to hard to find failures and could lead to an end
user shooting themselves in the foot and no longer be able to login
to their system to fix it.

Parse as many of the files as we can.  Only fail krb5_set_config_files()
if init_context_from_config_file() fails.

Change-Id: I122664c6d707a5f926643808ba414bf4f681f8b8
This commit is contained in:
Jeffrey Altman
2016-06-16 16:25:41 -04:00
parent cfc5b42bb1
commit b7cf5e7caf
2 changed files with 4 additions and 3 deletions

View File

@@ -370,11 +370,11 @@ krb5_config_parse_debug (struct fileptr *f,
b = NULL;
} else if (*p == '}') {
*err_message = "unmatched }";
return EINVAL; /* XXX */
return KRB5_CONFIG_BADFORMAT;
} else if(*p != '\0') {
if (s == NULL) {
*err_message = "binding before section";
return EINVAL;
return KRB5_CONFIG_BADFORMAT;
}
ret = parse_binding(f, lineno, p, &b, &s->u.list, err_message);
if (ret)