Skip to content

File exists control added before opening remote connection (SCP) - #370

Closed
macorapci wants to merge 1 commit into
openssh:masterfrom
macorapci:master
Closed

File exists control added before opening remote connection (SCP)#370
macorapci wants to merge 1 commit into
openssh:masterfrom
macorapci:master

Conversation

@macorapci

Copy link
Copy Markdown

I have such a long password for the remote PC and getting No such file or directory after writing the password is so annoying. This is why I add a check before creating a connection. I didn't remove the existing control after entering the password because at that time folder can be removed.

$ ./scp nonExistFolder  ubuntu@192.168.1.11:/home/ubuntu/folder
./scp: stat local "nonExistFolder": No such file or directory

Tests are successful.

test_hostkeys: .................. 18 tests ok
test_match: ...... 6 tests ok
test_misc: ........................................... 43 tests ok
make[1]: Leaving directory '/home/macorapci/Desktop/openssh-portable/regress'
unit tests passed
echo all tests passed
all tests passed

https://github.com/macorapci/openssh-portable/blob/ca9bb068015321c2045d02c5ba7fa4616abba4d8/scp.c#L682

I wanna add the condition for tolocal but the tests fail so I add it with the comment line. I can delete the line if it breaks something.

Comment thread scp.c
else {
if (targetshouldbedirectory)
verifydir(argv[argc - 1]);
// verify_file_exists(argv[argc - 1]);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I wanna add the condition for tolocal but the tests fail so I add it with the comment line. I can delete the line if it breaks something.

@djmdjm

djmdjm commented Mar 27, 2023

Copy link
Copy Markdown
Contributor

merged upstream as 4f0a676

@djmdjm djmdjm closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants