summaryrefslogtreecommitdiff
path: root/apt-inst
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
commit3b310a644d82abeb76b5028a9ee7b8d1b96fc629 (patch)
tree4f700ae465eb6c065dfba405741c1ab800e06f11 /apt-inst
parentc996a75cabffa5d3e5bc610d9f1097c2edae606f (diff)
parent4fdb612374655361c8923a4611db6a0d10054317 (diff)
merged from the debian branch
Diffstat (limited to 'apt-inst')
-rw-r--r--apt-inst/dirstream.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc
index 586bbf739..9b6a56848 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -43,11 +43,17 @@ bool pkgDirStream::DoItem(Item &Itm,int &Fd)
// fchmod deals with umask and fchown sets the ownership
if (fchmod(iFd,Itm.Mode) != 0)
- return _error->Errno("fchmod",_("Failed to write file %s"),
- Itm.Name);
+ {
+ _error->Errno("fchmod",_("Failed to write file %s"), Itm.Name);
+ close(iFd);
+ return false;
+ }
if (fchown(iFd,Itm.UID,Itm.GID) != 0 && errno != EPERM)
- return _error->Errno("fchown",_("Failed to write file %s"),
- Itm.Name);
+ {
+ return _error->Errno("fchown",_("Failed to write file %s"), Itm.Name);
+ close(iFd);
+ return false;
+ }
Fd = iFd;
return true;
}