diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-10-01 08:06:29 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-10-01 08:06:29 +0000 |
commit | a99da92123f56fbe14629504b8c44999eb920f3e (patch) | |
tree | 74a738b136a5665718c54b93e98c790a17839a1a /usr.bin | |
parent | b05b83d4d9a65c40d9614c8119e2bf85a7e58032 (diff) |
skip filenames containing \n; report jdamery@chiark.greenend.org.uk
and matthew@debian.org
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/scp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index ec76c4de3c4..999481ecc5c 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.84 2001/09/19 19:24:19 stevesk Exp $"); +RCSID("$OpenBSD: scp.c,v 1.85 2001/10/01 08:06:28 markus Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -484,6 +484,11 @@ source(argc, argv) len = strlen(name); while (len > 1 && name[len-1] == '/') name[--len] = '\0'; + if (strchr(name, '\n') != NULL) { + run_err("%s: skipping, filename contains a newline", + name); + goto next; + } if ((fd = open(name, O_RDONLY, 0)) < 0) goto syserr; if (fstat(fd, &stb) < 0) { |