Преглед на файлове

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
Michael Vogt преди 10 години
родител
ревизия
ef39c14810
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      apt-pkg/acquire.cc

+ 4 - 0
apt-pkg/acquire.cc

@@ -507,7 +507,11 @@ static void CheckDropPrivsMustBeDisabled(pkgAcquire const &Fetcher)
 
 
    struct passwd const * const pw = getpwnam(SandboxUser.c_str());
    struct passwd const * const pw = getpwnam(SandboxUser.c_str());
    if (pw == NULL)
    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_euid = geteuid();
    gid_t const old_egid = getegid();
    gid_t const old_egid = getegid();