fail if trying to unlink a directory

This commit is contained in:
Ralf Becker 2010-05-19 17:33:19 +00:00
parent 4c1e3a9e70
commit df58928ac6

View File

@ -527,7 +527,13 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
if (!($stat = self::url_stat($path,STREAM_URL_STAT_LINK)) || !egw_vfs::check_access(dirname($path),egw_vfs::WRITABLE))
{
self::_remove_password($url);
if (self::LOG_LEVEL) error_log(__METHOD__."($url) (type=$type) permission denied!");
if (self::LOG_LEVEL) error_log(__METHOD__."($url) permission denied!");
return false; // no permission or file does not exist
}
if ($stat['mime'] == self::DIR_MIME_TYPE)
{
self::_remove_password($url);
if (self::LOG_LEVEL) error_log(__METHOD__."($url) is NO file!");
return false; // no permission or file does not exist
}
$stmt = self::$pdo->prepare('DELETE FROM '.self::TABLE.' WHERE fs_id=:fs_id');