diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-10-04 11:19:26 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-10-04 11:19:26 +0300 |
commit | bc1ac82d8d59f29561fe25e50292d8f0f8950817 (patch) | |
tree | 179a1b20a94a6dc009118ed317939d90115cba24 /lib | |
parent | ffb886048c55b3a668d873bde7054571763c1058 (diff) | |
download | rpm-bc1ac82d8d59f29561fe25e50292d8f0f8950817.tar.gz rpm-bc1ac82d8d59f29561fe25e50292d8f0f8950817.tar.bz2 rpm-bc1ac82d8d59f29561fe25e50292d8f0f8950817.zip |
Restore permissions of a signed rpm to that of the original (rhbz#465586)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rpmchecksig.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 7a1dda694..a35750a4e 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -359,9 +359,14 @@ static int rpmReSign(rpmts ts, QVA_t qva, ARGV_const_t argv) /* Both fd and ofd are now closed. */ /* ASSERT: fd == NULL && ofd == NULL */ - /* Move final target into place. */ - xx = unlink(rpm); - xx = rename(trpm, rpm); + /* Move final target into place, restore file permissions. */ + { + struct stat st; + xx = stat(rpm, &st); + xx = unlink(rpm); + xx = rename(trpm, rpm); + xx = chmod(rpm, st.st_mode); + } trpm = _free(trpm); /* Clean up intermediate target */ |