bmh10 / rpms / openssh

Forked from rpms/openssh 2 days ago
Clone

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

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