- It is always selinux_file_context_path() anyway.
return NULL;
}
-rpmRC rpmtsSELabelInit(rpmts ts, int open_status, const char *path)
+rpmRC rpmtsSELabelInit(rpmts ts, int open_status)
{
#if WITH_SELINUX
+ const char * path = selinux_file_context_path();
+
if (ts == NULL || path == NULL) {
return RPMRC_FAIL;
}
* Initialize selabel
* @param ts transaction set
* @param open_status if the func should open selinux status or just check it
- * @param path path to contexts file
* @return RPMRC_OK on success, RPMRC_FAIL otherwise
*/
-rpmRC rpmtsSELabelInit(rpmts ts, int open_status, const char * path);
+rpmRC rpmtsSELabelInit(rpmts ts, int open_status);
/** \ingroup rpmts
* Clean up selabel
if (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS) {
rpmlog(RPMLOG_DEBUG, "Selinux disabled.\n");
} else {
- if (rpmtsSELabelInit(ts, 1, selinux_file_context_path())) {
+ if (rpmtsSELabelInit(ts, 1)) {
rpmlog(RPMLOG_WARNING, "Failed to open SELinux handle.\n");
rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_NOCONTEXTS));
}
rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p));
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmtsSELabelInit(ts, 0, selinux_file_context_path());
+ rpmtsSELabelInit(ts, 0);
}
failed = rpmteProcess(p, rpmteType(p));
/* re-init selinux and re-read the files contexts, since things may have changed */
selinux_reset_config();
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS)) {
- if (rpmtsSELabelInit(ts, 0, selinux_file_context_path()) == RPMRC_OK) {
+ if (rpmtsSELabelInit(ts, 0) == RPMRC_OK) {
/* if this was the first time installing policy, every package before
* policy was installed will be mislabeled (e.g. semodule). So, relabel
* the entire filesystem if this is the case */