summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>1996-07-30 02:39:19 +0000
committerEzra Peisach <epeisach@mit.edu>1996-07-30 02:39:19 +0000
commite06e2c249ce8235d88d2bf37a37633d036533273 (patch)
tree65ba55464337b435cfa759a5cac5b3ff18df8ff3
parent7b28250098718eff759a24b3af7ba59a5f15e688 (diff)
* secure.c: Do not assume sizeof(long) = 4 for sending lengths OTW
* configure.in: Determine sizeof short, int, long for secure.c git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8860 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/appl/gssftp/ftp/ChangeLog6
-rw-r--r--src/appl/gssftp/ftp/configure.in3
-rw-r--r--src/appl/gssftp/ftp/secure.c18
3 files changed, 24 insertions, 3 deletions
diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog
index 3533bf026..f3426f786 100644
--- a/src/appl/gssftp/ftp/ChangeLog
+++ b/src/appl/gssftp/ftp/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jul 29 22:37:23 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * secure.c: Do not assume sizeof(long) = 4 for sending lengths OTW
+
+ * configure.in: Determine sizeof short, int, long for secure.c
+
Fri Jul 26 20:55:12 1996 Sam Hartman <hartmans@tertius.mit.edu>
* secure.c (secure_putbyte): Reset nout to zero on errorso we
diff --git a/src/appl/gssftp/ftp/configure.in b/src/appl/gssftp/ftp/configure.in
index 76b7cbee3..40b07852f 100644
--- a/src/appl/gssftp/ftp/configure.in
+++ b/src/appl/gssftp/ftp/configure.in
@@ -7,6 +7,9 @@ USE_ANAME
CHECK_SIGPROCMASK
CHECK_WAIT_TYPE
DECLARE_SYS_ERRLIST
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
AC_FUNC_VFORK
AC_HAVE_FUNCS(getcwd getdtablesize)
AC_HEADER_STDARG
diff --git a/src/appl/gssftp/ftp/secure.c b/src/appl/gssftp/ftp/secure.c
index 6500ed330..183f10a3a 100644
--- a/src/appl/gssftp/ftp/secure.c
+++ b/src/appl/gssftp/ftp/secure.c
@@ -35,6 +35,18 @@ extern gss_ctx_id_t gcontext;
extern char *sys_errlist[];
#endif
+#if (SIZEOF_SHORT == 4)
+typedef unsigned short ftp_uint32;
+typedef short ftp_int32;
+#elif (SIZEOF_INT == 4)
+typedef unsigned int ftp_uint32;
+typedef int ftp_int32;
+#elif (SIZEOF_LONG == 4)
+typedef unsigned long ftp_uint32;
+typedef long ftp_int32;
+#endif
+
+
extern struct sockaddr_in hisaddr;
extern struct sockaddr_in myaddr;
extern int level;
@@ -213,8 +225,8 @@ unsigned int nbyte;
{
static char *outbuf; /* output ciphertext */
static unsigned int bufsize; /* size of outbuf */
- long length;
- u_long net_len;
+ ftp_int32 length;
+ ftp_uint32 net_len;
/* Other auth types go here ... */
#ifdef KERBEROS
@@ -295,7 +307,7 @@ int fd;
/* number of chars in ucbuf, pointer into ucbuf */
static unsigned int nin, bufp;
int kerror;
- u_long length;
+ ftp_uint32 length;
if (nin == 0) {
if ((kerror = looping_read(fd, &length, sizeof(length)))