diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sftp-client.c b/sftp-client.c index 8d0666b85..2565a704d 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-client.c,v 1.84 2008/06/08 20:15:29 dtucker Exp $ */ | 1 | /* $OpenBSD: sftp-client.c,v 1.85 2008/06/12 20:47:04 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -326,17 +326,27 @@ do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests) | |||
326 | while (buffer_len(&msg) > 0) { | 326 | while (buffer_len(&msg) > 0) { |
327 | char *name = buffer_get_string(&msg, NULL); | 327 | char *name = buffer_get_string(&msg, NULL); |
328 | char *value = buffer_get_string(&msg, NULL); | 328 | char *value = buffer_get_string(&msg, NULL); |
329 | int known = 0; | ||
329 | 330 | ||
330 | debug2("Init extension: \"%s\"", name); | ||
331 | if (strcmp(name, "posix-rename@openssh.com") == 0 && | 331 | if (strcmp(name, "posix-rename@openssh.com") == 0 && |
332 | strcmp(value, "1") == 0) | 332 | strcmp(value, "1") == 0) { |
333 | exts |= SFTP_EXT_POSIX_RENAME; | 333 | exts |= SFTP_EXT_POSIX_RENAME; |
334 | if (strcmp(name, "statvfs@openssh.com") == 0 && | 334 | known = 1; |
335 | strcmp(value, "2") == 0) | 335 | } else if (strcmp(name, "statvfs@openssh.com") == 0 && |
336 | strcmp(value, "2") == 0) { | ||
336 | exts |= SFTP_EXT_STATVFS; | 337 | exts |= SFTP_EXT_STATVFS; |
337 | if (strcmp(name, "fstatvfs@openssh.com") == 0 && | 338 | known = 1; |
338 | strcmp(value, "2") == 0) | 339 | } if (strcmp(name, "fstatvfs@openssh.com") == 0 && |
340 | strcmp(value, "2") == 0) { | ||
339 | exts |= SFTP_EXT_FSTATVFS; | 341 | exts |= SFTP_EXT_FSTATVFS; |
342 | known = 1; | ||
343 | } | ||
344 | if (known) { | ||
345 | debug2("Server supports extension \"%s\" revision %s", | ||
346 | name, value); | ||
347 | } else { | ||
348 | debug2("Unrecognised server extension \"%s\"", name); | ||
349 | } | ||
340 | xfree(name); | 350 | xfree(name); |
341 | xfree(value); | 351 | xfree(value); |
342 | } | 352 | } |