diff options
author | Colin Watson <cjwatson@debian.org> | 2004-03-01 02:25:32 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2004-03-01 02:25:32 +0000 |
commit | ea8116a11e3de70036dbc665ccb0d486cf89cac9 (patch) | |
tree | d73ccdff78d8608e156465af42e6a1b3527fb2d6 /sftp-server.c | |
parent | e39b311381a5609cc05acf298c42fba196dc524b (diff) | |
parent | f5bda272678ec6dccaa5f29379cf60cb855018e8 (diff) |
Merge 3.8p1 to the trunk. This builds and runs, but I haven't tested it
extensively yet.
ProtocolKeepAlives is now just a compatibility alias for
ServerAliveInterval.
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/sftp-server.c b/sftp-server.c index 9166853ed..1d13e97b2 100644 --- a/sftp-server.c +++ b/sftp-server.c | |||
@@ -1,28 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000, 2001, 2002 Markus Friedl. All rights reserved. | 2 | * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. |
3 | * | 3 | * |
4 | * Redistribution and use in source and binary forms, with or without | 4 | * Permission to use, copy, modify, and distribute this software for any |
5 | * modification, are permitted provided that the following conditions | 5 | * purpose with or without fee is hereby granted, provided that the above |
6 | * are met: | 6 | * copyright notice and this permission notice appear in all copies. |
7 | * 1. Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * 2. Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * | 7 | * |
13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
14 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
15 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
16 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
19 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
20 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | */ | 15 | */ |
24 | #include "includes.h" | 16 | #include "includes.h" |
25 | RCSID("$OpenBSD: sftp-server.c,v 1.43 2003/06/25 22:39:36 miod Exp $"); | 17 | RCSID("$OpenBSD: sftp-server.c,v 1.45 2004/02/19 21:15:04 markus Exp $"); |
26 | 18 | ||
27 | #include "buffer.h" | 19 | #include "buffer.h" |
28 | #include "bufaux.h" | 20 | #include "bufaux.h" |
@@ -149,7 +141,7 @@ handle_init(void) | |||
149 | } | 141 | } |
150 | 142 | ||
151 | static int | 143 | static int |
152 | handle_new(int use, char *name, int fd, DIR *dirp) | 144 | handle_new(int use, const char *name, int fd, DIR *dirp) |
153 | { | 145 | { |
154 | int i; | 146 | int i; |
155 | 147 | ||
@@ -184,7 +176,7 @@ handle_to_string(int handle, char **stringp, int *hlenp) | |||
184 | } | 176 | } |
185 | 177 | ||
186 | static int | 178 | static int |
187 | handle_from_string(char *handle, u_int hlen) | 179 | handle_from_string(const char *handle, u_int hlen) |
188 | { | 180 | { |
189 | int val; | 181 | int val; |
190 | 182 | ||
@@ -298,7 +290,7 @@ send_status(u_int32_t id, u_int32_t error) | |||
298 | buffer_free(&msg); | 290 | buffer_free(&msg); |
299 | } | 291 | } |
300 | static void | 292 | static void |
301 | send_data_or_handle(char type, u_int32_t id, char *data, int dlen) | 293 | send_data_or_handle(char type, u_int32_t id, const char *data, int dlen) |
302 | { | 294 | { |
303 | Buffer msg; | 295 | Buffer msg; |
304 | 296 | ||
@@ -311,7 +303,7 @@ send_data_or_handle(char type, u_int32_t id, char *data, int dlen) | |||
311 | } | 303 | } |
312 | 304 | ||
313 | static void | 305 | static void |
314 | send_data(u_int32_t id, char *data, int dlen) | 306 | send_data(u_int32_t id, const char *data, int dlen) |
315 | { | 307 | { |
316 | TRACE("sent data id %u len %d", id, dlen); | 308 | TRACE("sent data id %u len %d", id, dlen); |
317 | send_data_or_handle(SSH2_FXP_DATA, id, data, dlen); | 309 | send_data_or_handle(SSH2_FXP_DATA, id, data, dlen); |
@@ -330,7 +322,7 @@ send_handle(u_int32_t id, int handle) | |||
330 | } | 322 | } |
331 | 323 | ||
332 | static void | 324 | static void |
333 | send_names(u_int32_t id, int count, Stat *stats) | 325 | send_names(u_int32_t id, int count, const Stat *stats) |
334 | { | 326 | { |
335 | Buffer msg; | 327 | Buffer msg; |
336 | int i; | 328 | int i; |
@@ -350,7 +342,7 @@ send_names(u_int32_t id, int count, Stat *stats) | |||
350 | } | 342 | } |
351 | 343 | ||
352 | static void | 344 | static void |
353 | send_attrib(u_int32_t id, Attrib *a) | 345 | send_attrib(u_int32_t id, const Attrib *a) |
354 | { | 346 | { |
355 | Buffer msg; | 347 | Buffer msg; |
356 | 348 | ||
@@ -567,7 +559,7 @@ process_fstat(void) | |||
567 | } | 559 | } |
568 | 560 | ||
569 | static struct timeval * | 561 | static struct timeval * |
570 | attrib_to_tv(Attrib *a) | 562 | attrib_to_tv(const Attrib *a) |
571 | { | 563 | { |
572 | static struct timeval tv[2]; | 564 | static struct timeval tv[2]; |
573 | 565 | ||