]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2006/01/02 01:20:31
authordjm <djm>
Mon, 2 Jan 2006 12:40:50 +0000 (12:40 +0000)
committerdjm <djm>
Mon, 2 Jan 2006 12:40:50 +0000 (12:40 +0000)
     [sftp-client.c sftp-common.h sftp-server.c]
     use a common max. packet length, no binary change

ChangeLog
sftp-client.c
sftp-common.h
sftp-server.c

index 41a611aa219a098870bf2515e3e21144793b1654..0ac09025daa95bd16926d9b6e6e7192d39199edc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
    - stevesk@cvs.openbsd.org 2006/01/01 10:08:48
      [misc.c]
      no trailing "\n" for debug()
+   - djm@cvs.openbsd.org 2006/01/02 01:20:31
+     [sftp-client.c sftp-common.h sftp-server.c]
+     use a common max. packet length, no binary change
 
 20060101
  - (djm) [Makefile.in configure.ac includes.h misc.c]
index afbd1e6f3784a224c1ce5fbdd7c8928c8a178731..05bce3368ea812d3ce75c1999af9ec16753e8d03 100644 (file)
@@ -20,7 +20,7 @@
 /* XXX: copy between two remote sites */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.57 2005/07/27 10:39:03 dtucker Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.58 2006/01/02 01:20:31 djm Exp $");
 
 #include "openbsd-compat/sys-queue.h"
 
@@ -42,9 +42,6 @@ extern int showprogress;
 /* Minimum amount of data to read at at time */
 #define MIN_READ_SIZE  512
 
-/* Maximum packet size */
-#define MAX_MSG_LENGTH (256 * 1024)
-
 struct sftp_conn {
        int fd_in;
        int fd_out;
@@ -59,7 +56,7 @@ send_msg(int fd, Buffer *m)
 {
        u_char mlen[4];
 
-       if (buffer_len(m) > MAX_MSG_LENGTH)
+       if (buffer_len(m) > SFTP_MAX_MSG_LENGTH)
                fatal("Outbound message too long %u", buffer_len(m));
 
        /* Send length first */
@@ -87,7 +84,7 @@ get_msg(int fd, Buffer *m)
        }
 
        msg_len = buffer_get_int(m);
-       if (msg_len > MAX_MSG_LENGTH)
+       if (msg_len > SFTP_MAX_MSG_LENGTH)
                fatal("Received message too long %u", msg_len);
 
        buffer_append_space(m, msg_len);
index b42ba91409f8fc2497b5b76201fddcf91876a127..2b1995a2de7ebaad9ae8007cf9f6f49fdb2be7be 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sftp-common.h,v 1.5 2003/11/10 16:23:41 jakob Exp $   */
+/*     $OpenBSD: sftp-common.h,v 1.6 2006/01/02 01:20:31 djm Exp $     */
 
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -25,6 +25,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* Maximum packet that we are willing to send/accept */
+#define SFTP_MAX_MSG_LENGTH    (256 * 1024)
+
 typedef struct Attrib Attrib;
 
 /* File attributes */
index 4fa07e2f55ad8045ce9fb37921674a71253649c7..7060c44ad0833fcfbc8268e51f136e725fc6f492 100644 (file)
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.49 2005/09/13 23:40:07 djm Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.50 2006/01/02 01:20:31 djm Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -946,7 +946,7 @@ process(void)
                return;         /* Incomplete message. */
        cp = buffer_ptr(&iqueue);
        msg_len = GET_32BIT(cp);
-       if (msg_len > 256 * 1024) {
+       if (msg_len > SFTP_MAX_MSG_LENGTH) {
                error("bad message ");
                exit(11);
        }
This page took 0.079711 seconds and 5 git commands to generate.