From db1b99db2543b2c2526a2e116daeffa0498d5de4 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 17 Nov 2017 11:42:07 +0200 Subject: Fix not all %transfiletriggerpostun triggers executing (RhBug:1514085) Trigger indexes need to be reset to zero when the package changes, otherwise only the first %transfiletriggerpostun encountered will get stored and run. This bug has been there since introduction of file triggers so 4.13.x and 4.14.x are affected and will need updates. Besides triggeres just not executing, I suppose this might in some circumstances cause wrong triggers executing. Trigger indexes must be reset to zero when package changes. --- lib/rpmtriggers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rpmtriggers.c') diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c index 84fde0bb4..9d8699e2b 100644 --- a/lib/rpmtriggers.c +++ b/lib/rpmtriggers.c @@ -106,7 +106,6 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te) rpmfiles files; rpmds rpmdsTriggers; rpmds rpmdsTrigger; - int tix = 0; ii = rpmdbIndexIteratorInit(rpmtsGetRdb(ts), RPMDBI_TRANSFILETRIGGERNAME); mi = rpmdbNewIterator(rpmtsGetRdb(ts), RPMDBI_PACKAGES); @@ -131,6 +130,7 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te) if (rpmdbGetIteratorCount(mi)) { /* Filter triggers and save only trans postun triggers into ts */ while ((trigH = rpmdbNextIterator(mi)) != NULL) { + int tix = 0; rpmdsTriggers = rpmdsNew(trigH, RPMTAG_TRANSFILETRIGGERNAME, 0); while ((rpmdsTrigger = rpmdsFilterTi(rpmdsTriggers, tix))) { if ((rpmdsNext(rpmdsTrigger) >= 0) && -- cgit v1.2.1