From 2ddf975c70466f5c8603e1062a950ef85f97a703 Mon Sep 17 00:00:00 2001 From: Nikita Rousseau Date: Thu, 12 Dec 2013 20:36:48 +0100 Subject: [PATCH] Fix typo access.sftp_psl --- .../access.sftp_psl/SFTPPSL_StreamWrapper.php | 88 ++++++++----------- .../class.sftpPSLAccessDriver.php | 67 +++++++------- .../class.sftpPSLAccessWrapper.php | 76 +++++++++------- .../plugins/access.sftp_psl/i18n/conf/en.php | 37 ++++---- .../plugins/access.sftp_psl/i18n/conf/fr.php | 37 ++++---- core/src/plugins/access.sftp_psl/manifest.xml | 8 +- .../access.sftp_psl/phpseclib/SSH2.php | 9 ++ 7 files changed, 162 insertions(+), 160 deletions(-) diff --git a/core/src/plugins/access.sftp_psl/SFTPPSL_StreamWrapper.php b/core/src/plugins/access.sftp_psl/SFTPPSL_StreamWrapper.php index 7a12584cd9..26b43843b3 100644 --- a/core/src/plugins/access.sftp_psl/SFTPPSL_StreamWrapper.php +++ b/core/src/plugins/access.sftp_psl/SFTPPSL_StreamWrapper.php @@ -8,7 +8,7 @@ * Requirement: phpseclib - PHP Secure Communications Library * * Filename: SFTPPSL_StreamWrapper.php - * Classname: SFTP_StreamWrapper + * Classname: SFTPPSL_StreamWrapper * * ####################################################################### * # Protocol sftp:// @@ -112,8 +112,8 @@ * @package Net_SFTP_StreamWrapper * @link http://www.php.net/manual/en/class.streamwrapper.php */ -class SFTPPSL_StreamWrapper{ - +class SFTPPSL_StreamWrapper +{ /** * SFTP Object * @@ -144,7 +144,7 @@ class SFTPPSL_StreamWrapper{ * @var Resource * @access public */ - var $context; + public $context; /** * Mode @@ -185,7 +185,7 @@ class SFTPPSL_StreamWrapper{ * @return bool * @access public */ - function dir_closedir() + public function dir_closedir() { $this->stream_close(); @@ -209,13 +209,12 @@ function dir_closedir() * @return bool * @access public */ - function dir_opendir($path, $options) + public function dir_opendir($path, $options) { if ( $this->stream_open($path, NULL, NULL, $opened_path) ) { $this->dir_entries = $this->sftp->nlist($this->path); return TRUE; - } - else { + } else { return FALSE; } } @@ -230,7 +229,7 @@ function dir_opendir($path, $options) * @return string * @access public */ - function dir_readdir() + public function dir_readdir() { if ($this->dir_entries === false) { return FALSE; @@ -242,8 +241,7 @@ function dir_readdir() $this->position += 1; return $filename; - } - else { + } else { return FALSE; } } @@ -256,7 +254,7 @@ function dir_readdir() * @return bool * @access public */ - function dir_rewinddir() + public function dir_rewinddir() { $this->position = 0; @@ -276,7 +274,7 @@ function dir_rewinddir() * @return bool * @access public */ - function mkdir($path, $mode, $options) + public function mkdir($path, $mode, $options) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { @@ -285,8 +283,7 @@ function mkdir($path, $mode, $options) if ( $options === STREAM_MKDIR_RECURSIVE ) { $mkdir = $this->sftp->mkdir($this->path, $mode, true); - } - else { + } else { $mkdir = $this->sftp->mkdir($this->path, $mode, false); } @@ -306,7 +303,7 @@ function mkdir($path, $mode, $options) * @return bool * @access public */ - function rename($path_from, $path_to) + public function rename($path_from, $path_to) { $path1 = parse_url($path_from); $path2 = parse_url($path_to); @@ -351,7 +348,7 @@ function rename($path_from, $path_to) * @return bool * @access public */ - function rmdir($path, $options) + public function rmdir($path, $options) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { @@ -374,7 +371,7 @@ function rmdir($path, $options) * @return resource * @access public */ - function stream_cast($cast_as) + public function stream_cast($cast_as) { return $this->sftp->fsock; } @@ -387,7 +384,7 @@ function stream_cast($cast_as) * @return void * @access public */ - function stream_close() + public function stream_close() { // We do not really close connections because // connections are assigned to a class static variable, so the Net_SFTP object will persist @@ -408,7 +405,7 @@ function stream_close() * @return bool * @access public */ - function stream_eof() + public function stream_eof() { $filesize = $this->sftp->size($this->path); @@ -427,7 +424,7 @@ function stream_eof() * @return bool * @access public */ - function stream_flush() + public function stream_flush() { return TRUE; } @@ -441,7 +438,7 @@ function stream_flush() * @return Boolean * @access public */ - function stream_lock($operation) + public function stream_lock($operation) { return FALSE; } @@ -461,7 +458,7 @@ function stream_lock($operation) * @return bool * @access public */ - function stream_metadata($path, $option, $var) + public function stream_metadata($path, $option, $var) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { @@ -525,7 +522,7 @@ function stream_metadata($path, $option, $var) * @return bool * @access public */ - function stream_open($path, $mode, $options, &$opened_path) + public function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); @@ -538,13 +535,10 @@ function stream_open($path, $mode, $options, &$opened_path) $connection_uuid = md5( $host.$port.$user ); // Generate a unique ID for the current connection - if ( isset(self::$instances[$connection_uuid]) ) - { + if ( isset(self::$instances[$connection_uuid]) ) { // Get previously established connection $this->sftp = self::$instances[$connection_uuid]; - } - else - { + } else { //$context = stream_context_get_options($this->context); if (!isset($user) || !isset($pass)) { @@ -568,8 +562,7 @@ function stream_open($path, $mode, $options, &$opened_path) if (isset($mode)) { $this->mode = preg_replace('#[bt]$#', '', $mode); - } - else { + } else { $this->mode = 'r'; } @@ -581,8 +574,7 @@ function stream_open($path, $mode, $options, &$opened_path) $this->position = 0; if ($filesize === FALSE) { $this->sftp->touch( $this->path ); - } - else { + } else { $this->sftp->truncate( $this->path, 0 ); } break; @@ -590,8 +582,7 @@ function stream_open($path, $mode, $options, &$opened_path) if ($filesize === FALSE) { $this->position = 0; $this->sftp->touch( $this->path ); - } - else { + } else { $this->position = $filesize; } break; @@ -622,7 +613,7 @@ function stream_open($path, $mode, $options, &$opened_path) * @return mixed * @access public */ - function stream_read($count) + public function stream_read($count) { switch ($this->mode) { case 'w': @@ -650,7 +641,7 @@ function stream_read($count) * @return bool * @access public */ - function stream_seek($offset, $whence) + public function stream_seek($offset, $whence) { $filesize = $this->sftp->size($this->path); @@ -689,7 +680,7 @@ function stream_seek($offset, $whence) * @return Boolean * @access public */ - function stream_set_option($option, $arg1, $arg2) + public function stream_set_option($option, $arg1, $arg2) { return FALSE; } @@ -702,11 +693,11 @@ function stream_set_option($option, $arg1, $arg2) * @return mixed * @access public */ - function stream_stat() + public function stream_stat() { $stat = $this->sftp->stat($this->path); - if( !empty($stat) ) { + if ( !empty($stat) ) { // mode fix $stat['mode'] = $stat['permissions']; unset($stat['permissions']); @@ -725,7 +716,7 @@ function stream_stat() * @return Integer * @access public */ - function stream_tell() + public function stream_tell() { return $this->position; } @@ -745,7 +736,7 @@ function stream_tell() * @return bool * @access public */ - function stream_truncate($new_size) + public function stream_truncate($new_size) { return $this->sftp->truncate( $this->path, $new_size ); } @@ -759,7 +750,7 @@ function stream_truncate($new_size) * @return mixed * @access public */ - function stream_write($data) + public function stream_write($data) { switch ($this->mode) { case 'r': @@ -784,7 +775,7 @@ function stream_write($data) * @return bool * @access public */ - function unlink($path) + public function unlink($path) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { @@ -809,7 +800,7 @@ function unlink($path) * @return mixed * @access public */ - function url_stat($path, $flags) + public function url_stat($path, $flags) { $connection = $this->stream_open($path, NULL, NULL, $opened_path); if ($connection === false) { @@ -818,14 +809,13 @@ function url_stat($path, $flags) if ( $flags === STREAM_URL_STAT_LINK ) { $stat = $this->sftp->lstat($this->path); - } - else { + } else { $stat = $this->sftp->stat($this->path); } $this->stream_close(); - if( !empty($stat) ) { + if ( !empty($stat) ) { // mode fix $stat['mode'] = $stat['permissions']; unset($stat['permissions']); @@ -843,5 +833,3 @@ function url_stat($path, $flags) */ stream_wrapper_register('sftp', 'SFTPPSL_StreamWrapper') or die ('Failed to register protocol'); - -?> \ No newline at end of file diff --git a/core/src/plugins/access.sftp_psl/class.sftpPSLAccessDriver.php b/core/src/plugins/access.sftp_psl/class.sftpPSLAccessDriver.php index f5133ea383..7a7f8c1fbf 100644 --- a/core/src/plugins/access.sftp_psl/class.sftpPSLAccessDriver.php +++ b/core/src/plugins/access.sftp_psl/class.sftpPSLAccessDriver.php @@ -1,23 +1,23 @@ - * This file is part of AjaXplorer. + * Copyright 2007-2013 Charles du Jeu - Abstrium SAS + * This file is part of Pydio. * - * AjaXplorer is free software: you can redistribute it and/or modify + * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * AjaXplorer is distributed in the hope that it will be useful, + * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with AjaXplorer. If not, see . - * - * The latest code can be found at . + * along with Pydio. If not, see . * + * The latest code can be found at . */ defined('AJXP_EXEC') or die( 'Access not allowed' ); @@ -29,7 +29,7 @@ * * @author warhawk3407 * @author Charles du Jeu - * @version Release: 1.0.1 + * @version Release: 1.0.2 */ class sftpPSLAccessDriver extends fsAccessDriver { @@ -45,10 +45,11 @@ class sftpPSLAccessDriver extends fsAccessDriver /** * initRepository */ - function initRepository() { - if(is_array($this->pluginConf)){ + public function initRepository() + { + if (is_array($this->pluginConf)) { $this->driverConf = $this->pluginConf; - }else{ + } else { $this->driverConf = array(); } @@ -62,11 +63,11 @@ function initRepository() { $wrapperData = $this->detectStreamWrapper(true); $this->wrapperClassName = $wrapperData["classname"]; $this->urlBase = $wrapperData["protocol"]."://".$this->repository->getId(); -// print "lol"; } - function detectStreamWrapper($register = false) { - if($register){ + public function detectStreamWrapper($register = false) + { + if ($register) { require_once($this->getBaseDir()."/SFTPPSL_StreamWrapper.php"); } return parent::detectStreamWrapper($register); @@ -76,15 +77,17 @@ function detectStreamWrapper($register = false) { * Parse * @param DOMNode $contribNode */ - protected function parseSpecificContributions(&$contribNode){ + protected function parseSpecificContributions(&$contribNode) + { parent::parseSpecificContributions($contribNode); if($contribNode->nodeName != "actions") return ; $this->disableArchiveBrowsingContributions($contribNode); } - function filesystemFileSize($filePath){ + public function filesystemFileSize($filePath) + { $bytesize = filesize($filePath); - if($bytesize < 0){ + if ($bytesize < 0) { $bytesize = sprintf("%u", $bytesize); } return $bytesize; @@ -96,7 +99,7 @@ function filesystemFileSize($filePath){ * @param $basedir * @return zipfile */ - function makeZip ($src, $dest, $basedir) + public function makeZip ($src, $dest, $basedir) { @set_time_limit(60); require_once(AJXP_BIN_FOLDER."/pclzip.lib.php"); @@ -106,7 +109,7 @@ function makeZip ($src, $dest, $basedir) $uniqfolder = '/tmp/ajaxplorer-zip-'.$uniqid; mkdir($uniqfolder); - foreach ($src as $item){ + foreach ($src as $item) { $basedir = trim(dirname($item)); $basename = basename($item); $uniqpath = $uniqfolder.'/'.$basename; @@ -114,23 +117,24 @@ function makeZip ($src, $dest, $basedir) $filePaths[] = array(PCLZIP_ATT_FILE_NAME => $uniqpath, PCLZIP_ATT_FILE_NEW_SHORT_NAME => $basename); } - AJXP_Logger::debug("Pathes", $filePaths); - AJXP_Logger::debug("Basedir", array($basedir)); + $this->logDebug("Pathes", $filePaths); + $this->logDebug("Basedir", array($basedir)); $archive = new PclZip($dest); $vList = $archive->create($filePaths, PCLZIP_OPT_REMOVE_PATH, $uniqfolder, PCLZIP_OPT_NO_COMPRESSION); $this->recursiveRmdir($uniqfolder); - if(!$vList){ + if (!$vList) { throw new Exception("Zip creation error : ($dest) ".$archive->errorInfo(true)); } return $vList; } - function full_copy( $source, $destination ) { + public function full_copy( $source, $destination ) + { if ( is_dir( $source ) ) { @mkdir( $destination ); $directory = dir( $source ); while ( FALSE !== ( $readdirectory = $directory->read() ) ) { - if ( $readdirectory == '.' || $readdirectory == '..' ) { + if ($readdirectory == '.' || $readdirectory == '..') { continue; } $PathDir = $source . '/' . $readdirectory; @@ -142,21 +146,18 @@ function full_copy( $source, $destination ) { } $directory->close(); - }else { + } else { copy( $source, $destination ); } } - function recursiveRmdir($path) + public function recursiveRmdir($path) { - if (is_dir($path)) - { + if (is_dir($path)) { $path = rtrim($path, '/'); $subdir = dir($path); - while (($file = $subdir->read()) !== false) - { - if ($file != '.' && $file != '..') - { + while (($file = $subdir->read()) !== false) { + if ($file != '.' && $file != '..') { (!is_link("$path/$file") && is_dir("$path/$file")) ? $this->recursiveRmdir("$path/$file") : unlink("$path/$file"); } } @@ -167,10 +168,8 @@ function recursiveRmdir($path) return false; } - function isWriteable($dir, $type="dir") + public function isWriteable($dir, $type="dir") { return is_writable($dir); } } - -?> \ No newline at end of file diff --git a/core/src/plugins/access.sftp_psl/class.sftpPSLAccessWrapper.php b/core/src/plugins/access.sftp_psl/class.sftpPSLAccessWrapper.php index afdf9fc0bd..6780278767 100644 --- a/core/src/plugins/access.sftp_psl/class.sftpPSLAccessWrapper.php +++ b/core/src/plugins/access.sftp_psl/class.sftpPSLAccessWrapper.php @@ -1,23 +1,23 @@ - * This file is part of AjaXplorer. + * Copyright 2007-2013 Charles du Jeu - Abstrium SAS + * This file is part of Pydio. * - * AjaXplorer is free software: you can redistribute it and/or modify + * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * AjaXplorer is distributed in the hope that it will be useful, + * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with AjaXplorer. If not, see . - * - * The latest code can be found at . + * along with Pydio. If not, see . * + * The latest code can be found at . */ defined('AJXP_EXEC') or die( 'Access not allowed' ); @@ -29,19 +29,21 @@ * * @author warhawk3407 * @author Charles du Jeu - * @version Release: 1.0.1 + * @version Release: 1.0.2 */ class sftpPSLAccessWrapper extends fsAccessWrapper { - public static function isRemote(){ + public static function isRemote() + { return true; } /** * Initialize the stream from the given path. */ - protected static function initPath($path, $streamType = '', $storeOpenContext = false, $skipZip = true){ + protected static function initPath($path, $streamType = '', $storeOpenContext = false, $skipZip = true) + { $url = parse_url($path); $repoId = $url["host"]; $path = $url["path"]; @@ -58,17 +60,17 @@ protected static function initPath($path, $streamType = '', $storeOpenContext = $user = $credentials["user"]; $pass = $credentials["password"]; - if($basePath[strlen($basePath)-1] == "/"){ + if ($basePath[strlen($basePath)-1] == "/") { $basePath = substr($basePath, 0, -1); } - if($basePath[0] != "/"){ + if ($basePath[0] != "/") { $basePath = "/$basePath"; } $path = AJXP_Utils::securePath($path); - if($path[0] == "/"){ + if ($path[0] == "/") { $path = substr($path, 1); } @@ -81,14 +83,15 @@ protected static function initPath($path, $streamType = '', $storeOpenContext = * @param String $path * @return string */ - public static function getRealFSReference($path, $persistent = false){ - if($persistent){ + public static function getRealFSReference($path, $persistent = false) + { + if($persistent) { $tmpFile = AJXP_Utils::getAjxpTmpDir()."/".md5(time()); $tmpHandle = fopen($tmpFile, "wb"); self::copyFileInStream($path, $tmpHandle); fclose($tmpHandle); return $tmpFile; - }else{ + } else { return self::initPath($path); } } @@ -105,16 +108,16 @@ public static function getRealFSReference($path, $persistent = false){ */ public function stream_open($path, $mode, $options, &$context) { - try{ + try { $this->realPath = $this->initPath($path); - }catch (Exception $e){ - AJXP_Logger::logAction("error", array("message" => "Error while opening stream $path")); + } catch (Exception $e) { + AJXP_Logger::error(__CLASS__,"stream_open", "Error while opening stream $path"); return false; } - if($this->realPath == -1){ + if ($this->realPath == -1) { $this->fp = -1; return true; - }else{ + } else { $this->fp = fopen($this->realPath, $mode, $options); return ($this->fp !== false); } @@ -129,25 +132,27 @@ public function stream_open($path, $mode, $options, &$context) * @param unknown_type $options * @return unknown */ - public function dir_opendir ($path , $options ){ + public function dir_opendir ($path , $options ) + { $this->realPath = $this->initPath($path); - if($this->realPath[strlen($this->realPath)-1] != "/"){ + if ($this->realPath[strlen($this->realPath)-1] != "/") { $this->realPath.="/"; } - if(is_string($this->realPath)){ + if (is_string($this->realPath)) { $this->dH = opendir($this->realPath); - }else if($this->realPath == -1){ + } else if ($this->realPath == -1) { $this->dH = -1; } return $this->dH !== false; } - public function unlink($path){ + public function unlink($path) + { $this->realPath = $this->initPath($path, "file", false, true); @unlink($this->realPath); - if(is_file($this->realPath)){ + if (is_file($this->realPath)) { return false; - }else{ + } else { return true; } } @@ -159,7 +164,8 @@ public function unlink($path){ * @param mixed $flags * @return array */ - public function url_stat($path, $flags){ + public function url_stat($path, $flags) + { $realPath = self::initPath($path); $stat = @stat($realPath); $parts = parse_url($path); @@ -170,7 +176,8 @@ public function url_stat($path, $flags){ return $stat; } - public function detectRemoteUserId($repoObject){ + public function detectRemoteUserId($repoObject) + { $host = $repoObject->getOption("SFTP_HOST"); $port = $repoObject->getOption("SFTP_PORT"); @@ -182,10 +189,10 @@ public function detectRemoteUserId($repoObject){ if ($ssh2->login($user, $pass)) { $output = $ssh2->exec( 'id' ); - if(trim($output != "")){ + if (trim($output != "")) { $res = sscanf($output, "uid=%i(%s) gid=%i(%s) groups=%i(%s)"); preg_match_all("/(\w*)=(\w*)\((\w*)\)/", $output, $matches); - if(count($matches[0]) == 3){ + if (count($matches[0]) == 3) { $uid = $matches[2][0]; $gid = $matches[2][1]; @@ -205,8 +212,8 @@ public function detectRemoteUserId($repoObject){ * @param String $path * @param Stream $stream */ - public static function copyFileInStream($path, $stream){ - + public static function copyFileInStream($path, $stream) + { $src = fopen(self::initPath($path), "rb"); while ($content = fread($src, 5120)) { fputs($stream, $content, strlen($content)); @@ -221,7 +228,8 @@ public static function copyFileInStream($path, $stream){ * @param String $tmpDir * @param String $tmpFile */ - public static function removeTmpFile($tmpDir, $tmpFile){ + public static function removeTmpFile($tmpDir, $tmpFile) + { if(is_file($tmpFile)) unlink($tmpFile); if(is_dir($tmpDir)) rmdir($tmpDir); } diff --git a/core/src/plugins/access.sftp_psl/i18n/conf/en.php b/core/src/plugins/access.sftp_psl/i18n/conf/en.php index 6d9776ad38..ef4c8d3848 100644 --- a/core/src/plugins/access.sftp_psl/i18n/conf/en.php +++ b/core/src/plugins/access.sftp_psl/i18n/conf/en.php @@ -1,23 +1,23 @@ -* This file is part of AjaXplorer. -* -* AjaXplorer is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* AjaXplorer is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with AjaXplorer. If not, see . -* -* The latest code can be found at . -*/ + * Copyright 2007-2013 Charles du Jeu - Abstrium SAS + * This file is part of Pydio. + * + * Pydio is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pydio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pydio. If not, see . + * + * The latest code can be found at . + */ $mess=array( "SSH File Transfer Protocol (SFTP)" => "SSH File Transfer Protocol (SFTP)", "The SSH File Transfer Protocol is a network protocol that provides file access, file transfer, and file management functionalities over SSH2." => "The SSH File Transfer Protocol is a network protocol that provides file access, file transfer, and file management functionalities over SSH2.", @@ -30,4 +30,3 @@ "Fix Permissions" => "Fix Permissions", "How to handle remote permissions to be used by PHP as local permissions. See manual." => "How to handle remote permissions to be used by PHP as local permissions. See manual." ); -?> \ No newline at end of file diff --git a/core/src/plugins/access.sftp_psl/i18n/conf/fr.php b/core/src/plugins/access.sftp_psl/i18n/conf/fr.php index df6f6dcb9c..771182d993 100644 --- a/core/src/plugins/access.sftp_psl/i18n/conf/fr.php +++ b/core/src/plugins/access.sftp_psl/i18n/conf/fr.php @@ -1,23 +1,23 @@ -* This file is part of AjaXplorer. -* -* AjaXplorer is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* AjaXplorer is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with AjaXplorer. If not, see . -* -* The latest code can be found at . -*/ + * Copyright 2007-2013 Charles du Jeu - Abstrium SAS + * This file is part of Pydio. + * + * Pydio is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pydio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pydio. If not, see . + * + * The latest code can be found at . + */ $mess=array( "SSH File Transfer Protocol (SFTP)" => "SSH File Transfer Protocol (SFTP)", "The SSH File Transfer Protocol is a network protocol that provides file access, file transfer, and file management functionalities over SSH2." => "SFTP est un protocole de communication fonctionnant au-dessus du protocole SSH (SSH2) pour transférer et gérer des fichiers à distance.", @@ -30,4 +30,3 @@ "Fix Permissions" => "Correction des permissions", "How to handle remote permissions to be used by PHP as local permissions. See manual." => "Gestion des permissions entre le serveur local et le serveur distant." ); -?> \ No newline at end of file diff --git a/core/src/plugins/access.sftp_psl/manifest.xml b/core/src/plugins/access.sftp_psl/manifest.xml index 21a8e2bfc6..ab1f1d2eb6 100644 --- a/core/src/plugins/access.sftp_psl/manifest.xml +++ b/core/src/plugins/access.sftp_psl/manifest.xml @@ -9,10 +9,10 @@ > - - Rou Nik - http://ajaxplorer.info/plugins/access/sftp_psl - 0.8 + + Rousseau Nikita + http://pyd.io/plugins/access/sftp_psl + 1.0 diff --git a/core/src/plugins/access.sftp_psl/phpseclib/SSH2.php b/core/src/plugins/access.sftp_psl/phpseclib/SSH2.php index c82d4d81b7..77327ef0be 100644 --- a/core/src/plugins/access.sftp_psl/phpseclib/SSH2.php +++ b/core/src/plugins/access.sftp_psl/phpseclib/SSH2.php @@ -2694,6 +2694,13 @@ function _get_channel_packet($client_channel, $skip_extended = false) if ($length) { $this->errors[count($this->errors)].= "\r\n" . $this->_string_shift($response, $length); } + + $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel])); + $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel])); + + $this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF; + + break; case 'exit-status': extract(unpack('Cfalse/Nexit_status', $this->_string_shift($response, 5))); $this->exit_status = $exit_status; @@ -2703,6 +2710,8 @@ function _get_channel_packet($client_channel, $skip_extended = false) $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel])); $this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF; + + break; default: // "Some systems may not implement signals, in which case they SHOULD ignore this message." // -- http://tools.ietf.org/html/rfc4254#section-6.9