Added check if user supplied attachpoint is writeable
authorMarius Tomaschewski <mt@suse.de>
Thu, 9 Feb 2006 11:47:04 +0000 (11:47 +0000)
committerMarius Tomaschewski <mt@suse.de>
Thu, 9 Feb 2006 11:47:04 +0000 (11:47 +0000)
zypp/media/MediaCurl.cc

index c4c9500..1faaa6f 100644 (file)
@@ -73,6 +73,18 @@ MediaCurl::MediaCurl( const Url &      url_r,
       _curl( 0 ), _connected( false )
 {
   MIL << "MediaCurl::MediaCurl(" << url_r << ", " << attach_point_hint_r << ")" << endl;
+
+  if( !attachPoint().empty())
+  {
+    PathInfo ainfo(attachPoint());
+    if( !ainfo.isDir() || !ainfo.userMayRWX())
+    {
+      WAR << "attach point " << ainfo.path()
+          << " is not useable for " << url_r.getScheme() << endl;
+      setAttachPoint("", true);
+    }
+  }
+
   if ( ! _globalInit )
     {
       _globalInit = true;