aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLouis <louis@chmn.me>2024-06-24 10:35:16 +0200
committerGitHub <noreply@github.com>2024-06-24 10:35:16 +0200
commit02452712a20b9be2c638e9bea80102b9926d482b (patch)
tree3c35e625d58cb5eafacd4982d6152aca880077c3 /apps
parent4680bc47c21d3a42f20ee970032ecc7d26db0f1c (diff)
parent733e3f62fde59f53e747c5d0f98965b4cd93db9f (diff)
downloadnextcloud-server-02452712a20b9be2c638e9bea80102b9926d482b.tar.gz
nextcloud-server-02452712a20b9be2c638e9bea80102b9926d482b.zip
Merge pull request #45938 from nextcloud/do-not-log-an-error-when-connecting-to-sftp-without-a-logged-in-user
fix: Do not log an error when connecting to SFTP without a logged in user
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 2a60c996974..6046b7266f5 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -194,12 +194,14 @@ class SFTP extends Common {
*/
private function hostKeysPath() {
try {
- $storage_view = \OCP\Files::getStorage('files_external');
- if ($storage_view) {
- return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') .
- $storage_view->getAbsolutePath('') .
- 'ssh_hostKeys';
+ $userId = \OC_User::getUser();
+ if ($userId === false) {
+ return false;
}
+
+ $view = new \OC\Files\View('/' . $userId . '/files_external');
+
+ return $view->getLocalFile('ssh_hostKeys');
} catch (\Exception $e) {
}
return false;