Fail if cache_dir is specified and not a directory
authorpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 11 Jan 2010 09:51:32 +0000 (09:51 +0000)
committerpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 11 Jan 2010 09:51:32 +0000 (09:51 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@514 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_download.c

index cfbf35119311a800a4484b00860ec246527ac3ac..c852d867b85dc2f10f1c0c2ed651271ec81908f4 100644 (file)
@@ -199,6 +199,13 @@ opkg_download_cache(const char *src, const char *dest_file_name,
        goto out1;
     }
 
+    if(!file_is_dir(conf->cache)){
+           opkg_msg(ERROR, "%s is not a directory.\n",
+                           conf->cache);
+           err = 1;
+           goto out1;
+    }
+
     for (p = cache_name; *p; p++)
        if (*p == '/')
            *p = ',';   /* looks nicer than | or # */