X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e74ff795d39894268c737c4b1864869dadb74ed1..3e68f7e41022790619c698a32390a5256fadba7c:/apt-pkg/init.cc diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 76278921f..d04c51621 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -15,9 +15,11 @@ #include #include #include +#include +#include +#include #include -#include #include /*}}}*/ @@ -44,16 +46,8 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("APT::Install-Suggests", false); Cnf.CndSet("Dir","/"); - // State + // State Cnf.CndSet("Dir::State","var/lib/apt/"); - - /* Just in case something goes horribly wrong, we can fall back to the - old /var/state paths.. */ - struct stat St; - if (stat("/var/lib/apt/.",&St) != 0 && - stat("/var/state/apt/.",&St) == 0) - Cnf.CndSet("Dir::State","var/state/apt/"); - Cnf.CndSet("Dir::State::lists","lists/"); Cnf.CndSet("Dir::State::cdroms","cdroms.list"); Cnf.CndSet("Dir::State::mirrors","mirrors/"); @@ -92,15 +86,26 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$"); Cnf.Set("Dir::Ignore-Files-Silently::", "\\.save$"); Cnf.Set("Dir::Ignore-Files-Silently::", "\\.orig$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.distUpgrade$"); + + // Repository security + // FIXME: this is set to "true" for backward compatiblity, once + // jessie is out we want to change this to "false" to + // improve security + Cnf.CndSet("Acquire::AllowInsecureRepositories", true); + Cnf.CndSet("Acquire::AllowDowngradeToInsecureRepositories", false); // Default cdrom mount point Cnf.CndSet("Acquire::cdrom::mount", "/media/cdrom/"); + // The default user we drop to in the methods + Cnf.CndSet("APT::Sandbox::User", "_apt"); + bool Res = true; // Read an alternate config file const char *Cfg = getenv("APT_CONFIG"); - if (Cfg != 0) + if (Cfg != 0 && strlen(Cfg) != 0) { if (RealFileExists(Cfg) == true) Res &= ReadConfigFile(Cnf,Cfg);