Skip to content

[stable28] fix: Do not log an error when connecting to SFTP without a logged in user - #46060

Merged
AndyScherzinger merged 1 commit into
stable28from
backport/45938/stable28
Jul 11, 2024
Merged

[stable28] fix: Do not log an error when connecting to SFTP without a logged in user#46060
AndyScherzinger merged 1 commit into
stable28from
backport/45938/stable28

Conversation

@backportbot

Copy link
Copy Markdown

Backport of PR #45938

@blizzzblizzz mentioned this pull request Jun 24, 2024
@artongeartonge added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 25, 2024
@artonge
artongeforce-pushed the backport/45938/stable28 branch from c32c56a to 182392aCompareJune 27, 2024 09:39
@AltahrimAltahrim mentioned this pull request Jul 10, 2024
@AndyScherzinger
AndyScherzingerforce-pushed the backport/45938/stable28 branch 2 times, most recently from 7670e0b to b7e88bbCompareJuly 11, 2024 06:14
…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>
@AndyScherzinger
AndyScherzingerforce-pushed the backport/45938/stable28 branch from b7e88bb to c360c20CompareJuly 11, 2024 06:16
@AndyScherzinger
AndyScherzinger merged commit 1135d77 into stable28Jul 11, 2024
@AndyScherzinger
AndyScherzinger deleted the backport/45938/stable28 branch July 11, 2024 12:56
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: external storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@AndyScherzinger@artonge@blizzz@danxuliu