fix broken file-access cache after a917293 (fix smallPART file-access depending on full path)

fix wrong condition when storing an attachment, either the file or it's directory must be writable
This commit is contained in:
ralf 2022-05-12 15:16:16 +02:00
parent 3ac6cbba87
commit 965159d505
4 changed files with 5 additions and 8 deletions

View File

@ -1798,10 +1798,7 @@ class Link extends Link\Storage
{
$cache |= $ret ? $required|Acl::READ : 0;
}
else
{
$ret = $ret ? $required|Acl::READ : 0;
}
$ret = $ret ? $required|Acl::READ : 0;
}
else
{

View File

@ -2017,7 +2017,7 @@ class Vfs extends Vfs\Base
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !is_uploaded_file()");
return false;
}
if (!(self::is_writable($target) || ($dir = self::dirname($target)) && self::is_writable($dir)))
if (!self::is_writable($target) && !(($dir = self::dirname($target)) && self::is_writable($dir)))
{
if (self::LOG_LEVEL) error_log(__METHOD__."($tmp_name, $target, ".array2string($props).",$check_is_uploaded_file) returning FALSE !writable");
return false;

View File

@ -113,7 +113,7 @@ class StreamWrapper extends LinksParent
// vfs & stream-wrapper use posix rights, Api\Link::file_access uses Api\Acl::{EDIT|READ}!
$required = $check & Vfs::WRITABLE ? Api\Acl::EDIT : Api\Acl::READ;
$access = Api\Link::file_access($app, $id, $required, $rel_path, $this->user);
$what = "from Api\Link::file_access('$app', $id, $required, '$rel_path,".$this->user.")";
$what = "from Api\Link::file_access('$app', $id, $required, '$rel_path', ".$this->user.")";
}
if (self::DEBUG) error_log(__METHOD__."($url,$check) user=".Vfs::$user." ($what) ".($access?"access granted ($app:$id:$rel_path)":'no access!!!'));
return $access;
@ -453,4 +453,4 @@ class StreamWrapper extends LinksParent
}
}
StreamWrapper::register();
StreamWrapper::register();

View File

@ -1569,7 +1569,7 @@ class infolog_bo
{
Link::set_cache('infolog',$info['info_id'],
$this->link_title($info),
$this->file_access($info,Acl::EDIT) ? EGW_ACL_READ|EGW_ACL_EDIT :
$this->file_access($info,Acl::EDIT) ? Acl::READ|Acl::EDIT :
($this->file_access($info,Acl::READ) ? Acl::READ : 0));
}