summaryrefslogtreecommitdiff
path: root/methods/ftp.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/ftp.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/ftp.cc')
-rw-r--r--methods/ftp.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 5b739ea06..0504e5872 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -988,6 +988,10 @@ bool FtpMethod::Configuration(string Message)
return false;
TimeOut = _config->FindI("Acquire::Ftp::Timeout",TimeOut);
+
+ // no more active ftp, sorry
+ DropPrivsOrDie();
+
return true;
}
/*}}}*/
@@ -1141,8 +1145,5 @@ int main(int, const char *argv[])
FtpMethod Mth;
- // no more active ftp, sorry
- Mth.DropPrivsOrDie();
-
return Mth.Run();
}