Contents of /trunk/netkit-rsh/netkit-rsh-0.17-checkdir.patch
Parent Directory | Revision Log
Revision 97 -
(show annotations)
(download)
Fri Jan 19 23:50:26 2007 UTC (17 years, 8 months ago) by niro
File size: 701 byte(s)
Fri Jan 19 23:50:26 2007 UTC (17 years, 8 months ago) by niro
File size: 701 byte(s)
new files
1 | --- netkit-rsh-0.17/rcp/rcp.c.checkdir 2005-01-28 16:20:38.280031064 +0100 |
2 | +++ netkit-rsh-0.17/rcp/rcp.c 2005-01-28 16:25:56.479657368 +0100 |
3 | @@ -716,6 +716,10 @@ |
4 | size = size * 10 + (*cp++ - '0'); |
5 | if (*cp++ != ' ') |
6 | SCREWUP("size not delimited"); |
7 | + if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { |
8 | + error("rcp: unexpected filename: %s", cp); |
9 | + exit(1); |
10 | + } |
11 | if (targisdir) { |
12 | static char *namebuf; |
13 | static int cursize; |
14 | @@ -734,6 +738,8 @@ |
15 | np = targ; |
16 | exists = stat(np, &stb) == 0; |
17 | if (buf[0] == 'D') { |
18 | + if (!iamrecursive) |
19 | + SCREWUP("received directory without -r"); |
20 | if (exists) { |
21 | if ((stb.st_mode&S_IFMT) != S_IFDIR) { |
22 | errno = ENOTDIR; |