From dd70d4f4ef98da995db08d9e9a550b766cad9697 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 4 Jun 2009 19:15:24 +0000 Subject: [PATCH] - send the length of the file by printf()ing a long long instead of a long, so that we don't break on large files on 32-bit machines --- krb5-1.7-rcp-sendlarge.patch | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 krb5-1.7-rcp-sendlarge.patch diff --git a/krb5-1.7-rcp-sendlarge.patch b/krb5-1.7-rcp-sendlarge.patch new file mode 100644 index 0000000..59e773e --- /dev/null +++ b/krb5-1.7-rcp-sendlarge.patch @@ -0,0 +1,33 @@ +Fix sending of large files. This isn't *quite* right, because we still have to +open the file right to avoid EFBIG errors, and this patch doesn't fix that. +Either we build with -D_FILE_OFFSET_BITS=64, change open() to open64(), or +pass O_LARGEFILE to open(), none of which are easy to automate. + +diff -up krb5-1.7/src/appl/bsd/configure.in krb5-1.7/src/appl/bsd/configure.in +--- krb5-1.7/src/appl/bsd/configure.in 2009-06-04 14:02:56.000000000 -0400 ++++ krb5-1.7/src/appl/bsd/configure.in 2009-06-04 14:02:56.000000000 -0400 +@@ -53,6 +53,7 @@ AC_FUNC_VFORK + AC_TYPE_MODE_T + AC_CHECK_FUNCS(isatty inet_aton getenv gettosbyname killpg initgroups setpriority setreuid setresuid waitpid setsid ptsname setlogin tcgetpgrp tcsetpgrp setpgid strsave utimes rmufile rresvport_af) + AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h utmp.h sys/time.h sys/ioctl_compat.h paths.h arpa/nameser.h) ++AC_CHECK_TYPES([long long]) + AC_HEADER_STDARG + AC_REPLACE_FUNCS(getdtablesize) + dnl +diff -up krb5-1.7/src/appl/bsd/krcp.c krb5-1.7/src/appl/bsd/krcp.c +--- krb5-1.7/src/appl/bsd/krcp.c 2008-12-15 15:29:01.000000000 -0500 ++++ krb5-1.7/src/appl/bsd/krcp.c 2009-06-04 14:02:56.000000000 -0400 +@@ -764,8 +764,13 @@ void source(argc, argv) + continue; + } + } ++#ifdef HAVE_LONG_LONG ++ (void) snprintf(buf, sizeof(buf), "C%04o %lld %s\n", ++ (int) stb.st_mode&07777, (long long) stb.st_size, last); ++#else + (void) snprintf(buf, sizeof(buf), "C%04o %ld %s\n", + (int) stb.st_mode&07777, (long ) stb.st_size, last); ++#endif + (void) rcmd_stream_write(rem, buf, strlen(buf), 0); + if (response() < 0) { + (void) close(f);