openssh/openssh-6.6.1p1-scp-non-existing-directory.patch

15 lines
316 B
Diff
Raw Permalink Normal View History

2019-09-30 11:10:51 -04:00
--- a/scp.c
+++ a/scp.c
@@ -1084,6 +1084,10 @@ sink(int argc, char **argv)
free(vect[0]);
continue;
}
+ if (buf[0] == 'C' && ! exists && np[strlen(np)-1] == '/') {
+ errno = ENOTDIR;
+ goto bad;
+ }
omode = mode;
mode |= S_IWUSR;
2020-07-24 15:45:06 +08:00
if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) == -1) {
2019-09-30 11:10:51 -04:00
--