Skip to content

Commit

Permalink
Fix not all %transfiletriggerpostun triggers executing (RhBug:1514085)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pmatilai committed Nov 17, 2017
1 parent 8093409 commit db1b99d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rpmtriggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) &&
Expand Down

0 comments on commit db1b99d

Please sign in to comment.