Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/files_external/lib/Lib/Storage/SFTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public function __construct(array $parameters) {
$parsedHost = $this->splitHost($parameters['host']);

$this->host = $parsedHost[0];
$this->port = $parsedHost[1];
if (isset($parameters['port'])) {
$this->port = $parameters['port'];
}
Comment on lines -73 to +75
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. $parsedHost[1] already has the port from the parameters, so it is already working.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried? I did.

I reviewed the related code and found that $parsedHost[1] didn’t include the alternative SFTP port; it always ended up using port 22.

I have an sshd server listening on TCP port 222, and the logs showed repeated SFTP login failures because it was trying port 22 instead of 222 — until I applied this patch.

It works correctly now.

Regards: Paco.-


if (!isset($parameters['user'])) {
throw new \UnexpectedValueException('no authentication parameters specified');
Expand Down