diff options
author | Guillem Jover <guillem@debian.org> | 2019-11-05 02:55:04 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-11-26 02:42:44 +0100 |
commit | b41fe887e8caf09107cd65d8f561b00d043561d9 (patch) | |
tree | e656fe400091c014e68447636b7e243b62fcf3aa | |
parent | 1fcb291686f6bad5b3d7dfe619fcd840d6ab5d3a (diff) | |
download | dpkg-b41fe887e8caf09107cd65d8f561b00d043561d9.tar.gz |
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
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | man/dpkg.man | 5 | ||||
-rw-r--r-- | src/main.c | 2 |
3 files changed, 7 insertions, 1 deletions
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 <svenjoac@gmx.de>. * 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; |