summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-10-03 17:30:58 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-10-03 17:30:58 +0000
commit3e45e4cd003fd9aa5ae1556afd4ba405904b761f (patch)
treeaa82d0a7f836a217947fe4fe0442157139fff4ef /scp.c
parent83f07d19544b3acc2fb4d3b2b8640c5e5c7ae9d4 (diff)
- markus@cvs.openbsd.org 2001/10/01 08:06:28
[scp.c] skip filenames containing \n; report jdamery@chiark.greenend.org.uk and matthew@debian.org
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/scp.c b/scp.c
index e603646b..b5cb541b 100644
--- a/scp.c
+++ b/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"
@@ -503,6 +503,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) {