diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2014-10-28 10:06:17 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2016-11-02 10:41:53 +0200 |
commit | 9b2942bef39af2a013aa457c019f38b6b747361e (patch) | |
tree | fe56f9773512eec7f7520aca20200b5d69abcc35 | |
parent | 973bdd9e709727c4cb56c4811250f9a23e0a13b6 (diff) | |
download | rpm-9b2942bef39af2a013aa457c019f38b6b747361e.tar.gz |
Handle %ghost file in payload (RhBug:1156497)
- Older rpm (< 4.11) sometimes packaged %ghost files into payload,
at least in case of a hardlinked file marked as %ghost. Just skip
them if encountered in payload, whereas older rpm thought of these
as actual hardlinks (including 'rpm -qlv' output) but handled
(whether accidentally or otherwise) somewhere in the fsm. Thanks
to Florian for pointing out this correct fix instead of reverting
back to former behavior.
- Depends on commit d85dc92e8d7fb50d16f49faa1e88c85fdc526199.
(cherry picked from commit bcb5fb50ddccdbccf6f096d0c574184c7b82c4b8)
-rw-r--r-- | lib/rpmfi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c index aa4790365..2fba707e7 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1945,6 +1945,10 @@ static int iterReadArchiveNext(rpmfi fi) rpm_loff_t fsize = 0; rpm_mode_t mode = rpmfilesFMode(fi->files, fx); + /* %ghost in payload, should not be there but rpm < 4.11 sometimes did this */ + if (rpmfilesFFlags(fi->files, fx) & RPMFILE_GHOST) + return RPMERR_ITER_SKIP; + if (S_ISREG(mode)) { const int * links; uint32_t numlinks = rpmfilesFLinks(fi->files, fx, &links); |