diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2017-11-17 11:42:07 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2018-03-28 13:27:34 +0300 |
commit | 1c83ae9f3a52b28620d0b32827c7f42d252ef2bf (patch) | |
tree | 060ec2f27d1131b180c006f5cdb1f23f0e086272 | |
parent | 641ab97226bd2398b71656d80b715255fa1a30d9 (diff) | |
download | rpm-1c83ae9f3a52b28620d0b32827c7f42d252ef2bf.tar.gz |
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.
(cherry picked from commit db1b99db2543b2c2526a2e116daeffa0498d5de4)
-rw-r--r-- | lib/rpmtriggers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c index ea04b0357..769c6f25b 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); @@ -130,7 +129,8 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te) if (rpmdbGetIteratorCount(mi)) { /* Filter triggers and save only trans postun triggers into ts */ - while((trigH = rpmdbNextIterator(mi)) != NULL) { + while ((trigH = rpmdbNextIterator(mi)) != NULL) { + int tix = 0; rpmdsTriggers = rpmdsNew(trigH, RPMTAG_TRANSFILETRIGGERNAME, 0); while ((rpmdsTrigger = rpmdsFilterTi(rpmdsTriggers, tix))) { if ((rpmdsNext(rpmdsTrigger) >= 0) && |