- (djm) Make scp work on systems without 64-bit ints

This commit is contained in:
Damien Miller 2001-03-19 12:45:02 +11:00
Родитель 2d70f98220
Коммит ffd0e10b9c
2 изменённых файлов: 10 добавлений и 1 удалений

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

@ -6,6 +6,7 @@
- markus@cvs.openbsd.org 2001/03/18 12:07:52 - markus@cvs.openbsd.org 2001/03/18 12:07:52
[auth-options.c] [auth-options.c]
ignore permitopen="host:port" if AllowTcpForwarding==no ignore permitopen="host:port" if AllowTcpForwarding==no
- (djm) Make scp work on systems without 64-bit ints
20010318 20010318
- (bal) Fixed scp type casing issue which causes "scp: protocol error: - (bal) Fixed scp type casing issue which causes "scp: protocol error:
@ -4605,4 +4606,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.974 2001/03/19 00:13:46 mouring Exp $ $Id: ChangeLog,v 1.975 2001/03/19 01:45:02 djm Exp $

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

@ -545,9 +545,17 @@ syserr: run_err("%s: %s", name, strerror(errno));
goto next; goto next;
} }
#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) #define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
#ifdef HAVE_INT64_T
snprintf(buf, sizeof buf, "C%04o %lld %s\n", snprintf(buf, sizeof buf, "C%04o %lld %s\n",
(u_int) (stb.st_mode & FILEMODEMASK), (u_int) (stb.st_mode & FILEMODEMASK),
(long long) stb.st_size, last); (long long) stb.st_size, last);
#else
/* XXX: Handle integer overflow? */
snprintf(buf, sizeof buf, "C%04o %ld %s\n",
(u_int) (stb.st_mode & FILEMODEMASK),
(long) stb.st_size, last);
#endif
if (verbose_mode) { if (verbose_mode) {
fprintf(stderr, "Sending file modes: %s", buf); fprintf(stderr, "Sending file modes: %s", buf);
fflush(stderr); fflush(stderr);