summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-19 12:45:02 +1100
committerDamien Miller <djm@mindrot.org>2001-03-19 12:45:02 +1100
commitffd0e10b9c44201017d17ef4e2d4b21bdfa7b393 (patch)
tree2b575f5c27dceadf5c82da218bbb599e0640e49a
parent2d70f98220c8aaac29ac6fb47b86750209dacb01 (diff)
- (djm) Make scp work on systems without 64-bit ints
-rw-r--r--ChangeLog3
-rw-r--r--scp.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 62f7b118..94052a5e 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 27a50296..3dcd194e 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);