diff options
Diffstat (limited to 'lib/transaction.c')
-rw-r--r-- | lib/transaction.c | 20 |
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(); |