libsemanage: Use default semanage.conf as a fallback

If the private semanage.conf file is unreadable for some reason (usually
ENOENT) fallback to the default file.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-01-05 09:20:11 -05:00 committed by Eric Paris
parent fade75f1e2
commit 4120df1c6e
1 changed files with 2 additions and 1 deletions

View File

@ -186,7 +186,8 @@ const char *semanage_selinux_path(void) {
const char *semanage_conf_path(void)
{
if (private_semanage_conf_path)
if (private_semanage_conf_path &&
access(private_semanage_conf_path, R_OK) == 0)
return private_semanage_conf_path;
return SEMANAGE_CONF_PATH;