From b41fe887e8caf09107cd65d8f561b00d043561d9 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 5 Nov 2019 02:55:04 +0100 Subject: dpkg: Use DPKG_ADMINDIR to set the admindir This was done in the name of security, but it does not make much sense as root should make sure to be running in a clean environment. This is problematic as it makes the interface hard to understand, and produces unexpected behavior as dpkg can be called from within itself, or as a wrapper for dpkg-query, which will then not inherit the admindir value. Closes: #900071 --- debian/changelog | 1 + man/dpkg.man | 5 +++++ src/main.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 55e731cf8..febbcc200 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,7 @@ dpkg (1.20.0) UNRELEASED; urgency=medium Patch co-authored with Sven Joachim . * dpkg: Fix and clarify behavior for packages marked to be on “hold”. These need to be processed for configuration and triggers. Closes: #926472 + * dpkg: Use DPKG_ADMINDIR to set the admindir. Closes: #900071 * Perl modules: - Dpkg::Source::Package: Verify original tarball signatures at build time. - Dpkg::BuildFlags: Add new unset() method. diff --git a/man/dpkg.man b/man/dpkg.man index 659e87978..5f0a5e973 100644 --- a/man/dpkg.man +++ b/man/dpkg.man @@ -938,6 +938,11 @@ Sets the force flags (since dpkg 1.19.5). When this variable is present, no built-in force defaults will be applied. If the variable is present but empty, all force flags will be disabled. .TP +.B DPKG_ADMINDIR +If set and the \fB\-\-admindir\fP or \fB\-\-root\fP options have not been +specified, it will be used as the \fBdpkg\fP administrative directory +(since dpkg 1.20.0). +.TP .B DPKG_FRONTEND_LOCKED Set by a package manager frontend to notify dpkg that it should not acquire the frontend lock (since dpkg 1.19.1). diff --git a/src/main.c b/src/main.c index 61e186904..602d4d5d3 100644 --- a/src/main.c +++ b/src/main.c @@ -194,7 +194,7 @@ int f_autodeconf=0, f_nodebsig=0; int f_triggers = 0; int errabort = 50; -static const char *admindir = ADMINDIR; +static const char *admindir; const char *instdir= ""; struct pkg_list *ignoredependss = NULL; -- cgit v1.2.3