From 806e94dcd8dbdf7bf1909657fd4331cfe17b4ab0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Dec 2018 16:52:59 +0100 Subject: Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkg This avoids a lot of problems from local installations of scripting languages and other stuff in /usr/local for which maintainer scripts are not prepared. [v3: Inherit PATH during tests, check overrides work] [v2: Add testing] --- apt-pkg/init.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 3502e7ddc..cf69f40d0 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -208,6 +208,9 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "https://changelogs.ubuntu.com/changelogs/pool/@CHANGEPATH@/changelog"); Cnf.CndSet("Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu", true); + + Cnf.CndSet("DPkg::Path", "/usr/sbin:/usr/bin:/sbin:/bin"); + // Read an alternate config file _error->PushToStack(); const char *Cfg = getenv("APT_CONFIG"); -- cgit v1.2.3