if (rpmExpandNumeric("%{?_repackage_all_erasures}"))
ia->transFlags |= RPMTRANS_FLAG_REPACKAGE;
- /* Initialize security context patterns (if not already done). */
- if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(ts, sx);
- }
- fn = _free(fn);
- }
- sx = rpmsxFree(sx);
- }
(void) rpmtsSetFlags(ts, ia->transFlags);
probFilter = ia->probFilter;
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) {
+ rpmsx sx = rpmtsREContext(ts);
+ if (sx == NULL) {
+ const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+ if (fn != NULL && *fn != '\0') {
+ sx = rpmsxNew(fn);
+ (void) rpmtsSetREContext(ts, sx);
+ }
+ fn = _free(fn);
+ }
+ sx = rpmsxFree(sx);
+ }
+
ts->probs = rpmpsFree(ts->probs);
ts->probs = rpmpsCreate();
(void) rpmtsSetNotifyCallback(s->ts, rpmtsCallback, (void *) &cbInfo);
}
- /* Initialize security context patterns (if not already done). */
- if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
- rpmsx sx = rpmtsREContext(s->ts);
- if (sx == NULL) {
- const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
- if (fn != NULL && *fn != '\0') {
- sx = rpmsxNew(fn);
- (void) rpmtsSetREContext(s->ts, sx);
- }
- fn = _free(fn);
- }
- sx = rpmsxFree(sx);
- }
-
if (_rpmts_debug)
fprintf(stderr, "*** rpmts_Run(%p) ts %p ignore %x\n", s, s->ts, s->ignoreSet);