From 5bdb40fd205730ced768ee1ec951e12e6026c559 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Tue, 21 Feb 2006 13:48:50 +0000 Subject: [PATCH] refuse to use stupid paths as cache dir :-) stanos computer is now safe --- zypp/source/susetags/SuseTagsImpl.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zypp/source/susetags/SuseTagsImpl.cc b/zypp/source/susetags/SuseTagsImpl.cc index b21e9eb..f358de5 100644 --- a/zypp/source/susetags/SuseTagsImpl.cc +++ b/zypp/source/susetags/SuseTagsImpl.cc @@ -48,6 +48,10 @@ namespace zypp void SuseTagsImpl::initCacheDir(const Pathname & cache_dir_r) { + // refuse to use stupid paths as cache dir + if (cache_dir_r == Pathname("/") ) + ZYPP_THROW(Exception("I refuse to use / as cache dir")); + if (0 != assert_dir(cache_dir_r.dirname(), 0700)) ZYPP_THROW(Exception("Cannot create cache directory")); -- 2.7.4