]> git.saurik.com Git - apt.git/commit - methods/server.cc
wrap every unlink call to check for != /dev/null
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 2 Nov 2015 17:49:52 +0000 (18:49 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 4 Nov 2015 17:42:28 +0000 (18:42 +0100)
commitce1f3a2c616b86da657c1c796efa5f4d18c30c39
tree5ab1f87a06042576c479e4064b47252f9956e656
parentcd46d4ebd33e74ee53bbc73dcdb7fe1d4d006558
wrap every unlink call to check for != /dev/null

Unlinking /dev/null is bad, we shouldn't do that. Also, we should print
at least a warning if we tried to unlink a file but didn't manage to
pull it of (ignoring the case were the file is /dev/null or doesn't
exist in the first place).

This got triggered by a relatively unlikely to cause problem in
pkgAcquire::Worker::PrepareFiles which would while temporary
uncompressed files (which are set to keep compressed) figure out that to
files are the same and prepare for sharing by deleting them. Bad move.
That also shows why not printing a warning is a bad idea as this hide
the error for in non-root test runs.

Git-Dch: Ignore
20 files changed:
apt-pkg/acquire-item.cc
apt-pkg/acquire-worker.cc
apt-pkg/acquire.cc
apt-pkg/cachefile.cc
apt-pkg/cdrom.cc
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/fileutl.h
apt-pkg/deb/dpkgpm.cc
apt-pkg/edsp/edsplistparser.cc
apt-pkg/edsp/edspsystem.cc
apt-private/private-download.cc
cmdline/apt-dump-solver.cc
ftparchive/byhash.cc
ftparchive/multicompress.cc
ftparchive/writer.cc
methods/file.cc
methods/ftp.cc
methods/https.cc
methods/mirror.cc
methods/server.cc