semanage: close the selabel handle

Close the selabel handle to update the file_context. This means that the
file_context will be remmaped and used by selabel_lookup() to return
the appropriate context to label the home folder.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1993081

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
Iker Pedrosa
2021-10-08 13:13:13 +02:00
parent 09c752f00f
commit 234af5cf67
3 changed files with 7 additions and 0 deletions

View File

@@ -50,6 +50,11 @@ static void cleanup(void)
}
}
void reset_selinux_handle (void)
{
cleanup();
}
/*
* set_selinux_file_context - Set the security context before any file or
* directory creation.