]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
Check if the Apt::Sandbox::User exists in CheckDropPrivsMustBeDisabled()
[apt.git] / apt-pkg / acquire.cc
index a86bcef1aba1c8dde630014d337a99cf8234b3b6..b229a61b62297739accc7c8786b5a2af7576905b 100644 (file)
@@ -507,7 +507,11 @@ static void CheckDropPrivsMustBeDisabled(pkgAcquire const &Fetcher)
 
    struct passwd const * const pw = getpwnam(SandboxUser.c_str());
    if (pw == NULL)
 
    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;
       return;
+   }
 
    gid_t const old_euid = geteuid();
    gid_t const old_egid = getegid();
 
    gid_t const old_euid = geteuid();
    gid_t const old_egid = getegid();