From ffd0e10b9c44201017d17ef4e2d4b21bdfa7b393 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 19 Mar 2001 12:45:02 +1100 Subject: [PATCH] - (djm) Make scp work on systems without 64-bit ints --- ChangeLog | 3 ++- scp.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 62f7b1186..94052a5ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ - markus@cvs.openbsd.org 2001/03/18 12:07:52 [auth-options.c] ignore permitopen="host:port" if AllowTcpForwarding==no + - (djm) Make scp work on systems without 64-bit ints 20010318 - (bal) Fixed scp type casing issue which causes "scp: protocol error: @@ -4605,4 +4606,4 @@ - Wrote replacements for strlcpy and mkdtemp - 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 $ diff --git a/scp.c b/scp.c index 27a502964..3dcd194ea 100644 --- a/scp.c +++ b/scp.c @@ -545,9 +545,17 @@ syserr: run_err("%s: %s", name, strerror(errno)); goto next; } #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", (u_int) (stb.st_mode & FILEMODEMASK), (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) { fprintf(stderr, "Sending file modes: %s", buf); fflush(stderr);