mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Fix readonly shares were mounted as writable when shared to another user
This commit is contained in:
parent
e54aebebca
commit
c319478816
@ -259,7 +259,7 @@ class Base
|
|||||||
'host' => $GLOBALS['egw_info']['user']['domain'],
|
'host' => $GLOBALS['egw_info']['user']['domain'],
|
||||||
'home' => str_replace(array('\\\\','\\'),array('','/'),$GLOBALS['egw_info']['user']['homedirectory']),
|
'home' => str_replace(array('\\\\','\\'),array('','/'),$GLOBALS['egw_info']['user']['homedirectory']),
|
||||||
);
|
);
|
||||||
$parts = array_merge(Vfs::parse_url($path),$defaults);
|
$parts = array_merge(Vfs::parse_url($_path),Vfs::parse_url($path),$defaults);
|
||||||
if (!$parts['host']) $parts['host'] = 'default'; // otherwise we get an invalid url (scheme:///path/to/something)!
|
if (!$parts['host']) $parts['host'] = 'default'; // otherwise we get an invalid url (scheme:///path/to/something)!
|
||||||
|
|
||||||
if (!empty($parts['scheme']) && $parts['scheme'] != self::SCHEME)
|
if (!empty($parts['scheme']) && $parts['scheme'] != self::SCHEME)
|
||||||
|
@ -32,6 +32,16 @@ class StreamWrapperTest extends Vfs\StreamWrapperBase
|
|||||||
{
|
{
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Check that a user with permission to a file can access the file
|
||||||
|
*
|
||||||
|
* @depends testSimpleReadWrite
|
||||||
|
* @throws Api\Exception\AssertionFailed
|
||||||
|
*/
|
||||||
|
public function testWithAccess() : void
|
||||||
|
{
|
||||||
|
$this->markTestSkipped("Filesystem StreamWrapper does not support giving access to a file by changing group permissions");
|
||||||
|
}
|
||||||
|
|
||||||
protected function mount(): void
|
protected function mount(): void
|
||||||
{
|
{
|
||||||
|
@ -287,7 +287,8 @@ abstract class StreamWrapperBase extends LoggedInTest
|
|||||||
"Could not write file $file"
|
"Could not write file $file"
|
||||||
);
|
);
|
||||||
$pre = Vfs::stat($this->test_file);
|
$pre = Vfs::stat($this->test_file);
|
||||||
|
// Check that it's actually there
|
||||||
|
$this->assertEquals($contents,file_get_contents(Vfs::PREFIX . $file), "Did not write test file");
|
||||||
|
|
||||||
// Create another user who has no access to our file
|
// Create another user who has no access to our file
|
||||||
$user_b = $this->makeUser();
|
$user_b = $this->makeUser();
|
||||||
@ -307,7 +308,7 @@ abstract class StreamWrapperBase extends LoggedInTest
|
|||||||
|
|
||||||
// Check the file
|
// Check the file
|
||||||
$post = Vfs::stat($file);
|
$post = Vfs::stat($file);
|
||||||
$this->assertNotNull($post,
|
$this->assertIsArray($post,
|
||||||
"File '$file' was not accessible by another user who had permission"
|
"File '$file' was not accessible by another user who had permission"
|
||||||
);
|
);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
Loading…
Reference in New Issue
Block a user