summaryrefslogtreecommitdiff
path: root/lib/transaction.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-09-03 17:57:54 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-09-03 17:57:54 +0300
commitf9e641a65c1644217f8487e6a38df9a7ba062303 (patch)
tree4a6afe3547fb30ffaee67826407697b179d38f97 /lib/transaction.c
parent09bcd97b3a17609f97d82aed9f93b5c5c78bac1a (diff)
parentcec13226210a83fecdefbd21d0e81c640c23990c (diff)
downloadrpm-f9e641a65c1644217f8487e6a38df9a7ba062303.tar.gz
rpm-f9e641a65c1644217f8487e6a38df9a7ba062303.tar.bz2
rpm-f9e641a65c1644217f8487e6a38df9a7ba062303.zip
Automated merge with file:/home/pmatilai/repos/rpm-whitespace
Diffstat (limited to 'lib/transaction.c')
-rw-r--r--lib/transaction.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/transaction.c b/lib/transaction.c
index 35d0ac084..4d743c102 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -32,12 +32,7 @@
#include "debug.h"
-/*
- * This is needed for the IDTX definitions. I think probably those need
- * to be moved into a different source file (idtx.{c,h}), but that is up
- * to Jeff Johnson.
- */
-#include "rpmcli.h"
+#include "idtx.h"
/*@access Header @*/ /* XXX ts->notify arg1 is void ptr */
/*@access rpmps @*/ /* XXX need rpmProblemSetOK() */
@@ -1454,6 +1449,19 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB)
(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | _noTransScripts | _noTransTriggers));
+ /* if SELinux isn't enabled or init fails, don't bother... */
+ if (!rpmtsSELinuxEnabled(ts)) {
+ rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_NOCONTEXTS));
+ }
+
+ if (!rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (matchpathcon_init(fn) == -1) {
+ rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_NOCONTEXTS));
+ }
+ _free(fn);
+ }
+
ts->probs = rpmpsFree(ts->probs);
ts->probs = rpmpsCreate();