diff options
author | Ales Kozumplik <akozumpl@redhat.com> | 2011-12-22 14:53:51 +0100 |
---|---|---|
committer | Ales Kozumplik <akozumpl@redhat.com> | 2012-01-12 14:27:36 +0100 |
commit | 7a530738caf6a4c660211e6080b539dea4999d44 (patch) | |
tree | e8c312f98e2663b1c211a696abdb1627b8f1b884 | |
parent | 7a8b75d26605cf7a3fde9f624a80d6fb8390fcbd (diff) | |
download | rpm-7a530738caf6a4c660211e6080b539dea4999d44.tar.gz rpm-7a530738caf6a4c660211e6080b539dea4999d44.tar.bz2 rpm-7a530738caf6a4c660211e6080b539dea4999d44.zip |
remove the 'path' parameter of rpmtsSELabelInit()
- It is always selinux_file_context_path() anyway.
-rw-r--r-- | lib/rpmts.c | 4 | ||||
-rw-r--r-- | lib/rpmts_internal.h | 3 | ||||
-rw-r--r-- | lib/transaction.c | 4 | ||||
-rw-r--r-- | plugins/sepolicy.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c index 86411496e..5619c9103 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -738,9 +738,11 @@ struct selabel_handle * rpmtsSELabelHandle(rpmts ts) 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; } diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h index b4213fea2..e863230bd 100644 --- a/lib/rpmts_internal.h +++ b/lib/rpmts_internal.h @@ -92,10 +92,9 @@ struct selabel_handle * rpmtsSELabelHandle(rpmts ts); * 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 diff --git a/lib/transaction.c b/lib/transaction.c index da2895be0..50dedb1cf 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1261,7 +1261,7 @@ static int rpmtsSetup(rpmts ts, rpmprobFilterFlags ignoreSet) 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)); } @@ -1390,7 +1390,7 @@ static int rpmtsProcess(rpmts ts) 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)); diff --git a/plugins/sepolicy.c b/plugins/sepolicy.c index adbbd13bb..52674c1dd 100644 --- a/plugins/sepolicy.c +++ b/plugins/sepolicy.c @@ -556,7 +556,7 @@ static rpmRC sepolGo(void) /* 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 */ |