[scp.c]
     limit trust between local and remote rcp/scp process,
     noticed by lcamtuf; ok deraadt@, djm@
This commit is contained in:
Darren Tucker 2004-04-19 23:50:16 +10:00
Родитель d04121f0ab
Коммит bddc2b0179
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -12,6 +12,10 @@
- djm@cvs.openbsd.org 2004/03/31 21:58:47
[canohost.c]
don't skip ip options check when UseDNS=no; ok markus@ (ID sync only)
- markus@cvs.openbsd.org 2004/04/01 12:19:57
[scp.c]
limit trust between local and remote rcp/scp process,
noticed by lcamtuf; ok deraadt@, djm@
20040418
- (dtucker) [auth-pam.c] Log username and source host for failed PAM
@ -997,4 +1001,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.3320 2004/04/19 12:16:53 dtucker Exp $
$Id: ChangeLog,v 1.3321 2004/04/19 13:50:16 dtucker Exp $

10
scp.c
Просмотреть файл

@ -71,7 +71,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: scp.c,v 1.113 2003/11/23 23:21:21 djm Exp $");
RCSID("$OpenBSD: scp.c,v 1.114 2004/04/01 12:19:57 markus Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@ -759,6 +759,8 @@ sink(int argc, char **argv)
*cp++ = ch;
} while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
*cp = 0;
if (verbose_mode)
fprintf(stderr, "Sink: %s", buf);
if (buf[0] == '\01' || buf[0] == '\02') {
if (iamremote == 0)
@ -822,6 +824,10 @@ sink(int argc, char **argv)
size = size * 10 + (*cp++ - '0');
if (*cp++ != ' ')
SCREWUP("size not delimited");
if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) {
run_err("error: unexpected filename: %s", cp);
exit(1);
}
if (targisdir) {
static char *namebuf;
static int cursize;
@ -843,6 +849,8 @@ sink(int argc, char **argv)
exists = stat(np, &stb) == 0;
if (buf[0] == 'D') {
int mod_flag = pflag;
if (!iamrecursive)
SCREWUP("received directory without -r");
if (exists) {
if (!S_ISDIR(stb.st_mode)) {
errno = ENOTDIR;