]> git.saurik.com Git - apt.git/commitdiff
fix 'Dead assignment' by dropping unneeded boolean
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 10 Sep 2015 20:44:01 +0000 (22:44 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 14 Sep 2015 13:22:18 +0000 (15:22 +0200)
Reported-By: scan-build
Git-Dch: Ignore

apt-pkg/acquire.cc

index 433a2a6faaf774f553c22693f5b03bfd04bb4b7d..6a800002e3de7ba8a6c4a2b1b3a50e3bc0af2472 100644 (file)
@@ -467,9 +467,8 @@ static void CheckDropPrivsMustBeDisabled(pkgAcquire const &Fetcher)
    if (seteuid(pw->pw_uid) != 0)
       _error->Errno("seteuid", "seteuid %u failed", pw->pw_uid);
 
-   bool dropPrivs = true;
    for (pkgAcquire::ItemCIterator I = Fetcher.ItemsBegin();
-       I != Fetcher.ItemsEnd() && dropPrivs == true; ++I)
+       I != Fetcher.ItemsEnd(); ++I)
    {
       std::string filename = (*I)->DestFile;
       if (filename.empty())
@@ -496,7 +495,6 @@ static void CheckDropPrivsMustBeDisabled(pkgAcquire const &Fetcher)
 
       if (faccessat(-1, dirname.c_str(), R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0)
       {
-        dropPrivs = false;
         _error->WarningE("pkgAcquire::Run", _("Can't drop privileges for downloading as file '%s' couldn't be accessed by user '%s'."),
               filename.c_str(), SandboxUser.c_str());
         _config->Set("APT::Sandbox::User", "");