mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 11:37:33 +00:00
Merge branch '2.0'
* 2.0: Add test case for GitHub Issue 850: Realpath in SFTP chmod(). Fixed a bug in SFTP::chmod not using realpath on the filepath
This commit is contained in:
commit
a88047f242
@ -1416,6 +1416,7 @@ class SFTP extends SSH2
|
||||
return true;
|
||||
}
|
||||
|
||||
$filename = $this->_realPath($filename);
|
||||
// rather than return what the permissions *should* be, we'll return what they actually are. this will also
|
||||
// tell us if the file actually exists.
|
||||
// incidentally, SFTPv4+ adds an additional 32-bit integer field - flags - to the following:
|
||||
|
@ -240,6 +240,20 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
|
||||
/**
|
||||
* @depends testTruncate
|
||||
* @group github850
|
||||
*/
|
||||
public function testChModOnFile($sftp)
|
||||
{
|
||||
$this->assertNotFalse(
|
||||
$sftp->chmod(0755, 'file1.txt'),
|
||||
'Failed asserting that chmod() was successful.'
|
||||
);
|
||||
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testChModOnFile
|
||||
*/
|
||||
public function testChDirOnFile($sftp)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user