diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-06-18 17:40:38 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-06-18 17:40:38 +0200 |
commit | e15dd783ab86c0c65ec626685d59fff0128f3aca (patch) | |
tree | 69c52e730119b3ea27086ec8bc41d25563070d53 /apps | |
parent | 7a0917e5b2c25b2d90e503e30a3016dbe06a780c (diff) | |
download | nextcloud-server-e15dd783ab86c0c65ec626685d59fff0128f3aca.tar.gz nextcloud-server-e15dd783ab86c0c65ec626685d59fff0128f3aca.zip |
Workaround for empty dir deletion for SFTP
Explicitly clear the stat cache after deleting an empty folder to make
sure it is properly detected as deleted in subsequent requests.
This works around a problem with phpseclib where the folder is properly
deleted remotely but the stat cache was not updated.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/sftp.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php index c457a87a6c7..cbe090311a9 100644 --- a/apps/files_external/lib/sftp.php +++ b/apps/files_external/lib/sftp.php @@ -251,7 +251,11 @@ class SFTP extends \OC\Files\Storage\Common { */ public function rmdir($path) { try { - return $this->getConnection()->delete($this->absPath($path), true); + $result = $this->getConnection()->delete($this->absPath($path), true); + // workaround: stray stat cache entry when deleting empty folders + // see https://github.com/phpseclib/phpseclib/issues/706 + $this->getConnection()->clearStatCache(); + return $result; } catch (\Exception $e) { return false; } |