mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Merge pull request #79 from raffis/busybox
smbclient wrapper not compatible with busybox
This commit is contained in:
commit
2580be8caf
3 changed files with 5 additions and 14 deletions
|
|
@ -289,7 +289,7 @@ class NativeShare extends AbstractShare {
|
|||
*/
|
||||
public function append($source) {
|
||||
$url = $this->buildUrl($source);
|
||||
$handle = $this->getState()->open($url, "a");
|
||||
$handle = $this->getState()->open($url, "a+");
|
||||
return NativeWriteStream::wrap($this->getState(), $handle, "a", $url);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,18 +173,6 @@ class RawConnection {
|
|||
return;
|
||||
}
|
||||
if ($terminate) {
|
||||
// if for case that posix_ functions are not available
|
||||
if (function_exists('posix_kill')) {
|
||||
$status = proc_get_status($this->process);
|
||||
$ppid = $status['pid'];
|
||||
$pids = preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`);
|
||||
foreach ($pids as $pid) {
|
||||
if (is_numeric($pid)) {
|
||||
//9 is the SIGKILL signal
|
||||
posix_kill($pid, 9);
|
||||
}
|
||||
}
|
||||
}
|
||||
proc_terminate($this->process);
|
||||
}
|
||||
proc_close($this->process);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ class Share extends AbstractShare {
|
|||
FileInfo::MODE_SYSTEM => 's'
|
||||
];
|
||||
|
||||
const EXEC_CMD = 'exec';
|
||||
|
||||
/**
|
||||
* @param IServer $server
|
||||
* @param string $name
|
||||
|
|
@ -78,7 +80,8 @@ class Share extends AbstractShare {
|
|||
|
||||
protected function getConnection() {
|
||||
$command = sprintf(
|
||||
'%s%s -t %s %s %s %s',
|
||||
'%s %s%s -t %s %s %s %s',
|
||||
self::EXEC_CMD,
|
||||
$this->system->getStdBufPath() ? $this->system->getStdBufPath() . ' -o0 ' : '',
|
||||
$this->system->getSmbclientPath(),
|
||||
$this->server->getOptions()->getTimeout(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue