bmh10 / rpms / openssh

Forked from rpms/openssh 2 days ago
Clone

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

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