summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-07-28 12:41:27 +0200
committerJulian Andres Klode <jak@debian.org>2016-10-05 12:02:19 +0200
commitc614d66183639638f588422e2b0b3258d4f52323 (patch)
tree7443009d63c33419e418063204b6dd439718c879
parent1b63558a39ee1eed7eb024cd0e164d73beb165b1 (diff)
gpgv: Unlink the correct temp file in error case
Previously, when data could be created and sig not, we would unlink sig, not data (and vice versa). (cherry picked from commit d0d06f44ed60a3888528d834a799bae86c2978d5)
-rw-r--r--apt-pkg/contrib/gpgv.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index 0929ae0e2..4a2f34043 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -118,9 +118,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
if (sigFd == -1 || dataFd == -1)
{
if (dataFd != -1)
- unlink(sig);
- if (sigFd != -1)
unlink(data);
+ if (sigFd != -1)
+ unlink(sig);
ioprintf(std::cerr, "Couldn't create tempfiles for splitting up %s", File.c_str());
exit(EINTERNAL);
}
@@ -134,9 +134,9 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
SplitClearSignedFile(File, &message, &dataHeader, &signature) == false)
{
if (dataFd != -1)
- unlink(sig);
- if (sigFd != -1)
unlink(data);
+ if (sigFd != -1)
+ unlink(sig);
ioprintf(std::cerr, "Splitting up %s into data and signature failed", File.c_str());
exit(112);
}