summaryrefslogtreecommitdiffstats
path: root/src/appl
diff options
context:
space:
mode:
Diffstat (limited to 'src/appl')
-rw-r--r--src/appl/gssftp/ftp/ChangeLog17
-rw-r--r--src/appl/gssftp/ftp/ftp.c2
-rw-r--r--src/appl/gssftp/ftp/secure.c23
3 files changed, 33 insertions, 9 deletions
diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog
index d73bf4c692..3533bf026b 100644
--- a/src/appl/gssftp/ftp/ChangeLog
+++ b/src/appl/gssftp/ftp/ChangeLog
@@ -1,3 +1,20 @@
+Fri Jul 26 20:55:12 1996 Sam Hartman <hartmans@tertius.mit.edu>
+
+ * secure.c (secure_putbyte): Reset nout to zero on errorso we
+ don't overflow our buffer.
+
+ * ftp.c (sendrequest): If there is an error in secure_write, break
+ out of the loop.
+
+ * secure.c(FUDGE_FACTOR): Define for GSSAPI so writes don't fail.
+ i chose a value of 64, which is larger than the apparent 52 bytes
+ of additional data but I'm not sure 52 is constant.
+
+ (secure_putbuf): Set bufsize to the size we actually allocate
+ Also, write foure bytes for net_len no matter how long it
+ actually is. I would rather declare it a 32-bit type but am not
+ sure whether to use the GSSAPI, krb4, or krb5 32-bit int.
+
Wed Jul 10 16:40:19 1996 Marc Horowitz <marc@mit.edu>
* cmdtab.c (cmdtab[]), cmds.c (delete_file): rename delete() to
diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c
index a90987f9f5..0a2f4d1544 100644
--- a/src/appl/gssftp/ftp/ftp.c
+++ b/src/appl/gssftp/ftp/ftp.c
@@ -892,6 +892,8 @@ sendrequest(cmd, local, remote, printnames)
}
(void) fflush(stdout);
}
+ if (d <= 0 )
+ break;
}
if (hash && bytes > 0) {
if (bytes < HASHBYTES)
diff --git a/src/appl/gssftp/ftp/secure.c b/src/appl/gssftp/ftp/secure.c
index 6bcc491066..6500ed3308 100644
--- a/src/appl/gssftp/ftp/secure.c
+++ b/src/appl/gssftp/ftp/secure.c
@@ -54,6 +54,10 @@ static unsigned int nout, bufp; /* number of chars in ucbuf,
*/
#endif /* KERBEROS */
+#ifdef GSSAPI
+#define FUDGE_FACTOR 64 /*It appears to add 52 byts, but I'm not usre it is a constant--hartmans*/
+#endif /*GSSAPI*/
+
#ifndef FUDGE_FACTOR /* In case no auth types define it. */
#define FUDGE_FACTOR 0
#endif
@@ -136,11 +140,12 @@ unsigned char c;
int ret;
ucbuf[nout++] = c;
- if (nout == MAX - FUDGE_FACTOR)
- if (ret = secure_putbuf(fd, ucbuf, nout))
- return(ret);
- else nout = 0;
- return(c);
+ if (nout == MAX - FUDGE_FACTOR) {
+ ret = secure_putbuf(fd, ucbuf, nout);
+ nout = 0;
+ return(ret?ret:c);
+ }
+return (c);
}
/* returns:
@@ -202,11 +207,11 @@ unsigned int nbyte;
* -2 on security error
*/
secure_putbuf(fd, buf, nbyte)
-int fd;
+ int fd;
unsigned char *buf;
unsigned int nbyte;
{
- static char *outbuf; /* output ciphertext */
+ static char *outbuf; /* output ciphertext */
static unsigned int bufsize; /* size of outbuf */
long length;
u_long net_len;
@@ -217,7 +222,7 @@ unsigned int nbyte;
if (outbuf?
(outbuf = realloc(outbuf, (unsigned) (nbyte + FUDGE_FACTOR))):
(outbuf = malloc((unsigned) (nbyte + FUDGE_FACTOR)))) {
- bufsize = nbyte + FUDGE_FACTOR;
+ bufsize = out_buf.length;
} else {
bufsize = 0;
secure_error("%s (in malloc of PROT buffer)",
@@ -278,7 +283,7 @@ unsigned int nbyte;
}
#endif /* GSSAPI */
net_len = htonl((u_long) length);
- if (looping_write(fd, &net_len, sizeof(net_len)) == -1) return(-1);
+ if (looping_write(fd, &net_len, 4) == -1) return(-1);
if (looping_write(fd, outbuf, length) != length) return(-1);
return(0);
}