summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2015-11-27 12:29:22 +0100
committerMichael Vogt <mvo@ubuntu.com>2015-11-27 12:29:22 +0100
commitef39c148105cf30aea822022a5f41a120897cc65 (patch)
treef3f9b2739cbb5222339950c331879c1be7cf379d /apt-pkg/acquire.cc
parenta416a90b631a430306df6ed3fa1d4f3a1bdc7949 (diff)
Check if the Apt::Sandbox::User exists in CheckDropPrivsMustBeDisabled()
If it does not exist disabled priv dropping as there is nothing we can drop to. This will unblock people with special chroots or systems that deleted the "_apt" user. Closes: #806406
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index a86bcef1a..b229a61b6 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -507,7 +507,11 @@ static void CheckDropPrivsMustBeDisabled(pkgAcquire const &Fetcher)
struct passwd const * const pw = getpwnam(SandboxUser.c_str());
if (pw == NULL)
+ {
+ _error->Warning(_("No sandbox user '%s' on the system, can not drop privileges"), SandboxUser.c_str());
+ _config->Set("APT::Sandbox::User", "");
return;
+ }
gid_t const old_euid = geteuid();
gid_t const old_egid = getegid();