Lose the now unnecessary rpmtsSELinuxEnabled() function
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 13 Aug 2010 07:58:51 +0000 (10:58 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 13 Aug 2010 14:24:12 +0000 (17:24 +0300)
- it never was anything more than a cached value of is_selinux_enabled()
  and caching this fairly expensive result is no longer needed as
  scriptlet execution wrt selinux contexts is now conditionalized on
  RPMTRANS_FLAG_NOCONTEXTS instead

lib/rpmts.c
lib/rpmts.h
lib/rpmts_internal.h
lib/transaction.c

index 20e2588..43966e9 100644 (file)
@@ -685,11 +685,6 @@ void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
     }
 }
 
-int rpmtsSELinuxEnabled(rpmts ts)
-{
-    return (ts != NULL ? (ts->selinuxEnabled > 0) : 0);
-}
-
 rpm_tid_t rpmtsGetTid(rpmts ts)
 {
     rpm_tid_t tid = (rpm_tid_t)-1;  /* XXX -1 is time(2) error return. */
@@ -901,9 +896,6 @@ rpmts rpmtsCreate(void)
     ts->members = tsmem;
 
     ts->rootDir = NULL;
-
-    ts->selinuxEnabled = is_selinux_enabled();
-
     ts->keyring = NULL;
 
     ts->nrefs = 0;
index 9b7c306..8ea01f3 100644 (file)
@@ -390,13 +390,6 @@ FD_t rpmtsScriptFd(rpmts ts);
 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
 
 /** \ingroup rpmts
- * Get selinuxEnabled flag, i.e. is SE linux enabled?
- * @param ts           transaction set
- * @return             selinuxEnabled flag
- */
-int rpmtsSELinuxEnabled(rpmts ts);
-
-/** \ingroup rpmts
  * Get transaction id, i.e. transaction time stamp.
  * @param ts           transaction set
  * @return             transaction id
index bfa52ca..1a16457 100644 (file)
@@ -43,7 +43,6 @@ struct rpmts_s {
 
     tsMembers members;         /*!< Transaction set member info (order etc) */
 
-    int selinuxEnabled;                /*!< Is SE linux enabled? */
     char * rootDir;            /*!< Path to top of install tree. */
     char * lockPath;           /*!< Transaction lock path */
     FD_t scriptFd;             /*!< Scriptlet stdout/stderr. */
index 5202ee2..31abe4f 100644 (file)
@@ -1262,7 +1262,7 @@ static int rpmtsSetup(rpmts ts, rpmprobFilterFlags ignoreSet)
        (void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | _noTransScripts | _noTransTriggers));
 
     /* if SELinux isn't enabled, init fails or test run, don't bother... */
-    if (!rpmtsSELinuxEnabled(ts) || (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) {
+    if (!is_selinux_enabled() || (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) {
         rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_NOCONTEXTS));
     }