~cjwatson/ubuntu/lucid/openssh/lucid-proposed

« back to all changes in this revision

Viewing changes to monitor.c

  • Committer: Colin Watson
  • Date: 2010-01-26 13:06:46 UTC
  • mfrom: (3160.1.200 trunk)
  • Revision ID: cjwatson@ubuntu.com-20100126130646-nds9e617wgh42ev8
merge from Debian 1:5.3p1-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: monitor.c,v 1.101 2009/02/12 03:26:22 djm Exp $ */
 
1
/* $OpenBSD: monitor.c,v 1.104 2009/06/12 20:43:22 andreas Exp $ */
2
2
/*
3
3
 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4
4
 * Copyright 2002 Markus Friedl <markus@openbsd.org>
88
88
#include "compat.h"
89
89
#include "ssh2.h"
90
90
#include "jpake.h"
 
91
#include "roaming.h"
91
92
#ifdef USE_CONSOLEKIT
92
93
#include "consolekit.h"
93
94
#endif
103
104
extern z_stream incoming_stream;
104
105
extern z_stream outgoing_stream;
105
106
extern u_char session_id[];
106
 
extern Buffer input, output;
107
107
extern Buffer auth_debug;
108
108
extern int auth_debug_init;
109
109
extern Buffer loginmsg;
129
129
        u_int ilen;
130
130
        u_char *output;
131
131
        u_int olen;
 
132
        u_int64_t sent_bytes;
 
133
        u_int64_t recv_bytes;
132
134
} child_state;
133
135
 
134
136
/* Functions on the monitor that answer unprivileged requests */
1729
1731
 
1730
1732
        /* Network I/O buffers */
1731
1733
        /* XXX inefficient for large buffers, need: buffer_init_from_string */
1732
 
        buffer_clear(&input);
1733
 
        buffer_append(&input, child_state.input, child_state.ilen);
 
1734
        buffer_clear(packet_get_input());
 
1735
        buffer_append(packet_get_input(), child_state.input, child_state.ilen);
1734
1736
        memset(child_state.input, 0, child_state.ilen);
1735
1737
        xfree(child_state.input);
1736
1738
 
1737
 
        buffer_clear(&output);
1738
 
        buffer_append(&output, child_state.output, child_state.olen);
 
1739
        buffer_clear(packet_get_output());
 
1740
        buffer_append(packet_get_output(), child_state.output,
 
1741
                      child_state.olen);
1739
1742
        memset(child_state.output, 0, child_state.olen);
1740
1743
        xfree(child_state.output);
 
1744
 
 
1745
        /* Roaming */
 
1746
        if (compat20)
 
1747
                roam_set_bytes(child_state.sent_bytes, child_state.recv_bytes);
1741
1748
}
1742
1749
 
1743
1750
static Kex *
1860
1867
        child_state.input = buffer_get_string(&m, &child_state.ilen);
1861
1868
        child_state.output = buffer_get_string(&m, &child_state.olen);
1862
1869
 
 
1870
        /* Roaming */
 
1871
        if (compat20) {
 
1872
                child_state.sent_bytes = buffer_get_int64(&m);
 
1873
                child_state.recv_bytes = buffer_get_int64(&m);
 
1874
        }
 
1875
 
1863
1876
        buffer_free(&m);
1864
1877
}
1865
1878