From 10ecfe4f8a617ab285abd99d67917ae332ed2e4a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 8 Jul 2014 11:27:01 +0200 Subject: Do not clean "/" in pkgAcquire::Clean/pkgArchiveCleaner Having "/" here is most likely a user configuration error and may cause removal of import symlinks like /vmlinuz Closes: #753531 --- apt-pkg/clean.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apt-pkg/clean.cc') diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 0ee3b765d..37128e9aa 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -34,7 +34,10 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) { bool CleanInstalled = _config->FindB("APT::Clean-Installed",true); - + + if(Dir == "/") + return _error->Error(_("Clean of %s is not supported"), Dir.c_str()); + DIR *D = opendir(Dir.c_str()); if (D == 0) return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str()); -- cgit v1.2.3