rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone

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

3e8b5b
--- a/scp.c	
3e8b5b
+++ a/scp.c	
3e8b5b
@@ -1084,6 +1084,10 @@ sink(int argc, char **argv)
3e8b5b
 			free(vect[0]);
3e8b5b
 			continue;
3e8b5b
 		}
3e8b5b
+		if (buf[0] == 'C' && ! exists && np[strlen(np)-1] == '/') {
3e8b5b
+			errno = ENOTDIR;
3e8b5b
+			goto bad;
3e8b5b
+		}
3e8b5b
 		omode = mode;
3e8b5b
 		mode |= S_IWUSR;
3e8b5b
 		if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) < 0) {
3e8b5b
--