nextcloud/apps/files_external/lib/Lib/Storage
Daniel Calviño Sánchez 8c2f05f05e fix: Do not log an error when connecting to SFTP without a logged in user
When connecting to a SFTP server from a SFTP storage the host key is
checked against the known host keys stored in a file in the data
directory of the logged in Nextcloud user. The path to the file is
(indirectly) got using "OC_App::getStorage", which logs an error if
called when there is no logged in user; this can happen, for example, if
the storage is used from a background job or a command.

Not being able to read or write the file just causes the host key check
to be skipped, but it has no other consequence. Moreover, even with
logged in users it is likely that the file can not be read either and
the check is also skipped, as the file needs to have been manually
created by an admin.

Due to all that now the path to the file is directly created using a
View rather than relying on "OC_App::getStorage" to prevent the unneeded
error from being logged.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-07-10 15:17:47 +02:00
..
AmazonS3.php chore: apply changes from Nextcloud coding standards 1.1.1 2023-11-23 10:36:13 +01:00
FTP.php fix: Apply new coding standard to all files 2024-04-04 11:45:22 +02:00
FtpConnection.php Refactors "strpos" calls in /apps/files_external to improve code readability. 2023-06-02 19:54:49 +03:30
OwnCloud.php Refactors "strpos" calls in /apps/files_external to improve code readability. 2023-06-02 19:54:49 +03:30
SFTP.php fix: Do not log an error when connecting to SFTP without a logged in user 2024-07-10 15:17:47 +02:00
SFTPReadStream.php sftp psalm fixes 2023-09-18 16:12:03 +02:00
SFTPWriteStream.php Fix usage of streams 2022-10-17 10:58:27 +02:00
SMB.php fix(files_external): list root when using SMB case-insensitive option 2024-02-05 11:24:12 +01:00
StreamWrapper.php Rename file1 and file2 to source and target in Storage abstraction 2022-10-18 17:21:47 +02:00
Swift.php fix: replace Account name by Login 2024-02-13 21:08:10 +01:00