Skip to content

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

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

Closed
wants to merge 1 commit into from

Conversation

macorapci
Copy link

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.

@@ -678,6 +679,7 @@ main(int argc, char **argv)
else {
if (targetshouldbedirectory)
verifydir(argv[argc - 1]);
// verify_file_exists(argv[argc - 1]);
Copy link
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
Copy link
Contributor

djmdjm commented Mar 27, 2023

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