summaryrefslogtreecommitdiff
path: root/apt-private/private-download.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-11-04 13:19:14 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-05 12:21:33 +0100
commit30c8107e9c56d7d78dcf9136f94aeed9d631dfb3 (patch)
treec8d9a601ab50de8d8cd059c2f84e94fedf4f8213 /apt-private/private-download.cc
parent23d35ec15a849ee755f51a99939b0131e8faefa5 (diff)
drop privileges in copy:// method as we do for file://
Continueing on the track of dropping privileges in all methods, lets drop it in copy, too, as the reasoning for it is very similar to file and the interaction between the too quiet interesting as copy kinda surfed as a fallback for file not being able to read the file. Both now show a better error message as well as it was previously claiming to have a hashsum mismatch, given that it couldn't read the file. Git-Dch: Ignore
Diffstat (limited to 'apt-private/private-download.cc')
-rw-r--r--apt-private/private-download.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc
index dcb604f2a..40312d0c8 100644
--- a/apt-private/private-download.cc
+++ b/apt-private/private-download.cc
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <sys/vfs.h>
#include <sys/statvfs.h>
+#include <sys/stat.h>
#include <errno.h>
#include <apti18n.h>
@@ -224,6 +225,7 @@ bool DoDownload(CommandLine &CmdL)
std::ifstream src((*I)->DestFile.c_str(), std::ios::binary);
std::ofstream dst(filename.c_str(), std::ios::binary);
dst << src.rdbuf();
+ chmod(filename.c_str(), 0644);
}
}
return Failed == false;