mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Fix escaping of single quotes when opening streams
This commit is contained in:
parent
e9cda42fa9
commit
f357ad7b6f
1 changed files with 4 additions and 0 deletions
|
|
@ -240,6 +240,8 @@ class Share implements IShare {
|
||||||
*/
|
*/
|
||||||
public function read($source) {
|
public function read($source) {
|
||||||
$source = $this->escapePath($source);
|
$source = $this->escapePath($source);
|
||||||
|
// close the single quote, open a double quote where we put the single quote...
|
||||||
|
$source = str_replace('\'', '\'"\'"\'', $source);
|
||||||
// since returned stream is closed by the caller we need to create a new instance
|
// since returned stream is closed by the caller we need to create a new instance
|
||||||
// since we can't re-use the same file descriptor over multiple calls
|
// since we can't re-use the same file descriptor over multiple calls
|
||||||
$command = Server::CLIENT . ' --authentication-file=/proc/self/fd/3' .
|
$command = Server::CLIENT . ' --authentication-file=/proc/self/fd/3' .
|
||||||
|
|
@ -264,6 +266,8 @@ class Share implements IShare {
|
||||||
*/
|
*/
|
||||||
public function write($target) {
|
public function write($target) {
|
||||||
$target = $this->escapePath($target);
|
$target = $this->escapePath($target);
|
||||||
|
// close the single quote, open a double quote where we put the single quote...
|
||||||
|
$target = str_replace('\'', '\'"\'"\'', $target);
|
||||||
// since returned stream is closed by the caller we need to create a new instance
|
// since returned stream is closed by the caller we need to create a new instance
|
||||||
// since we can't re-use the same file descriptor over multiple calls
|
// since we can't re-use the same file descriptor over multiple calls
|
||||||
$command = Server::CLIENT . ' --authentication-file=/proc/self/fd/3' .
|
$command = Server::CLIENT . ' --authentication-file=/proc/self/fd/3' .
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue