Skip to content
Snippets Groups Projects
Commit 20a1f829 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Don't return an error when reading /..

POSIX requires a .. directory in the root of a filesystem, and
some SFTP clients (at least Filezilla and WinSCP) assume it's there
even if the remote doesn't list it.  Per POSIX, /. and /.. are the
same directory.
parent cedc67bb
No related branches found
No related tags found
No related merge requests found
Pipeline #6073 passed
......@@ -731,13 +731,10 @@ sftp_resolve_path(char *target, const char *path, size_t size)
else if(*(out+1)=='.' && *(out+2)=='.' && (*(out+3)=='/' || *(out+3)==0)) {
*out=0;
p=strrchr(target,'/');
if(p==NULL) {
if (target_alloced)
free(target);
return nullptr;
if (p!=NULL) {
memmove(p,out+3,strlen(out+3)+1);
out=p;
}
memmove(p,out+3,strlen(out+3)+1);
out=p;
}
else {
out++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment