summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/fileutl.cc3
-rw-r--r--apt-pkg/indexcopy.cc6
-rw-r--r--debian/changelog1
3 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 7c3a302e2..0f88923cf 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -184,7 +184,8 @@ bool RunScripts(const char *Cnf)
/* The caller is expected to set things so that failure causes erasure */
bool CopyFile(FileFd &From,FileFd &To)
{
- if (From.IsOpen() == false || To.IsOpen() == false)
+ if (From.IsOpen() == false || To.IsOpen() == false ||
+ From.Failed() == true || To.Failed() == true)
return false;
// Buffered copy between fds
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 0e36b3ded..1d61b974d 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -544,11 +544,9 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/
FileFd Rel;
Target.Open(TargetF,FileFd::WriteAtomic);
Rel.Open(prefix + file,FileFd::ReadOnly);
- if (_error->PendingError() == true)
- return false;
if (CopyFile(Rel,Target) == false)
- return false;
-
+ return _error->Error("Copying of '%s' for '%s' from '%s' failed", file.c_str(), CDName.c_str(), prefix.c_str());
+
return true;
}
/*}}}*/
diff --git a/debian/changelog b/debian/changelog
index 42a8e540e..cde0aba2f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ apt (0.9.8.3) UNRELEASED; urgency=low
* set Fail flag in FileFd on all errors consistently
* don't explicitly init ExtractTar InFd with invalid fd
* OpenDescriptor should autoclose fd always on error (Closes: #704608)
+ * fail in CopyFile if the FileFds have error flag set
-- David Kalnischkies <kalnischkies@gmail.com> Sun, 09 Jun 2013 15:06:24 +0200