summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 18c731788..036f0e385 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -653,6 +653,11 @@ bool pkgDPkgPM::CloseLog()
}
term_out = NULL;
+ // check if the directory exists in which we want to write the file
+ string const logdir = _config->FindDir("Dir::Log");
+ if(not FileExists(logdir))
+ return _error->Error(_("Directory '%s' missing"), logdir.c_str());
+
string history_name = flCombine(_config->FindDir("Dir::Log"),
_config->Find("Dir::Log::History"));
if (!history_name.empty())