lib/base: heim_config_parse_file_multi warn if ignoring included config
commitf0de5f5c43f39d45b5d9a656a80864f7a643e283
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 26 May 2020 01:18:29 +0000 (25 21:18 -0400)
committerNicolas Williams <nico@twosigma.com>
Tue, 26 May 2020 16:48:45 +0000 (26 11:48 -0500)
tree5c6bb2f3eda63f241c46d133c0c27a19b5403d3f
parent5502fa4ecaad44628d91be1edca904d701c880f4
lib/base: heim_config_parse_file_multi warn if ignoring included config

At present Heimdal silently ignores included configuration files that
cannot be successfully opened or parsed.  This is done to ensure that
an administrator or configuration management tool cannot lock users
out of a machine due to an editing mistake.

This change modifies heim_config_parse_file_multi() to warn the user
if a configuration file cannot be parsed or if an included ("include"
or "includedir") configuration file cannot be opened.  Example warnings
for a configuration file starting with:

  includedir c:/temp

where some of the matching file names cannot be parsed:

  Ignoring: c:\temp\20170516:1: binding before section

or opened:

  Ignoring: open or stat c:\temp\AUAA-83: Permission denied

A top level configuration file will also generate a warning if it
can be opened but cannot be parsed successfully produces

  Ignoring: c:\temp\foo.cmd:1: binding before section
  Ignoring: C:\ProgramData\Kerberos\krb5.conf:22: unmatched }

Change-Id: I455854156f4a61e1b7dad7f96601eca23d2368eb
lib/base/config_file.c