Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not log an error when connecting to SFTP without a logged in user #45938

Commits on Jun 18, 2024

  1. 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>
    danxuliu committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    733e3f6 View commit details
    Browse the repository at this point in the history