summaryrefslogtreecommitdiff
path: root/methods/https.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-13 10:57:30 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-10-13 11:29:47 +0200
commit9983999d294887046abf386adc31190700d89b61 (patch)
tree441df32a5b9767c69b9517c4ae180b953d8dc283 /methods/https.cc
parent954d30df8d8b0fb4fa203d09674a4fe1e990e55c (diff)
Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()
Do not drop privileges in the methods when using a older version of libapt that does not support the chown magic in partial/ yet. To do this DropPrivileges() now will ignore a empty Apt::Sandbox::User. Cleanup all hardcoded _apt along the way.
Diffstat (limited to 'methods/https.cc')
-rw-r--r--methods/https.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/methods/https.cc b/methods/https.cc
index 16d564b34..366148e19 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -37,6 +37,16 @@
/*}}}*/
using namespace std;
+bool HttpsMethod::Configuration(std::string Message)
+{
+ if (pkgAcqMethod::Configuration(Message) == false)
+ return false;
+
+ DropPrivsOrDie();
+
+ return true;
+}
+
size_t
HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
{
@@ -452,8 +462,6 @@ int main()
HttpsMethod Mth;
curl_global_init(CURL_GLOBAL_SSL) ;
- Mth.DropPrivsOrDie();
-
return Mth.Run();
}