diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | scp.c | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -9,6 +9,9 @@ | |||
9 | more useful. | 9 | more useful. |
10 | based on discussion with <mats@mindbright.se> long time ago | 10 | based on discussion with <mats@mindbright.se> long time ago |
11 | and recent mail from <res@shore.net> | 11 | and recent mail from <res@shore.net> |
12 | - deraadt@cvs.openbsd.org 2001/04/06 16:46:59 | ||
13 | [scp.c] | ||
14 | remove trailing / from source paths; fixes pr#1756 | ||
12 | 15 | ||
13 | 20010406 | 16 | 20010406 |
14 | - (stevesk) logintest.c: fix for systems without __progname | 17 | - (stevesk) logintest.c: fix for systems without __progname |
@@ -4920,4 +4923,4 @@ | |||
4920 | - Wrote replacements for strlcpy and mkdtemp | 4923 | - Wrote replacements for strlcpy and mkdtemp |
4921 | - Released 1.0pre1 | 4924 | - Released 1.0pre1 |
4922 | 4925 | ||
4923 | $Id: ChangeLog,v 1.1076 2001/04/07 01:12:11 mouring Exp $ | 4926 | $Id: ChangeLog,v 1.1077 2001/04/07 01:14:38 mouring Exp $ |
@@ -75,7 +75,7 @@ | |||
75 | */ | 75 | */ |
76 | 76 | ||
77 | #include "includes.h" | 77 | #include "includes.h" |
78 | RCSID("$OpenBSD: scp.c,v 1.64 2001/03/28 20:04:38 stevesk Exp $"); | 78 | RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $"); |
79 | 79 | ||
80 | #include "xmalloc.h" | 80 | #include "xmalloc.h" |
81 | #include "atomicio.h" | 81 | #include "atomicio.h" |
@@ -500,10 +500,14 @@ source(argc, argv) | |||
500 | off_t i; | 500 | off_t i; |
501 | int amt, fd, haderr, indx, result; | 501 | int amt, fd, haderr, indx, result; |
502 | char *last, *name, buf[2048]; | 502 | char *last, *name, buf[2048]; |
503 | int len; | ||
503 | 504 | ||
504 | for (indx = 0; indx < argc; ++indx) { | 505 | for (indx = 0; indx < argc; ++indx) { |
505 | name = argv[indx]; | 506 | name = argv[indx]; |
506 | statbytes = 0; | 507 | statbytes = 0; |
508 | len = strlen(name); | ||
509 | while (len > 1 && name[len-1] == '/') | ||
510 | name[--len] = '\0'; | ||
507 | if ((fd = open(name, O_RDONLY, 0)) < 0) | 511 | if ((fd = open(name, O_RDONLY, 0)) < 0) |
508 | goto syserr; | 512 | goto syserr; |
509 | if (fstat(fd, &stb) < 0) { | 513 | if (fstat(fd, &stb) < 0) { |