From f78682d24ab65980c9858b0e563d5c6c9568cddd Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Wed, 14 Mar 2001 21:26:27 +0000 Subject: - markus@cvs.openbsd.org 2001/03/14 15:15:58 [sftp-int.c] add version command --- ChangeLog | 17 ++++++++++------- sftp-int.c | 9 ++++++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89856fbc1..b83619bfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,16 +3,19 @@ - markus@cvs.openbsd.org 2001/03/14 08:57:14 [sftp-client.c] Wall + - markus@cvs.openbsd.org 2001/03/14 15:15:58 + [sftp-int.c] + add version command - (stevesk) ssh-keyscan.c: specify "openbsd-compat/fake-queue.h" 20010314 - OpenBSD CVS Sync - - markus@cvs.openbsd.org 2001/03/13 17:34:42 - [auth-options.c] - missing xfree, deny key on parse error; ok stevesk@ - - djm@cvs.openbsd.org 2001/03/13 22:42:54 - [sftp-client.c sftp-client.h sftp-glob.c sftp-glob.h sftp-int.c] - sftp client filename globbing for get, put, ch{mod,grp,own}. ok markus@ + - markus@cvs.openbsd.org 2001/03/13 17:34:42 + [auth-options.c] + missing xfree, deny key on parse error; ok stevesk@ + - djm@cvs.openbsd.org 2001/03/13 22:42:54 + [sftp-client.c sftp-client.h sftp-glob.c sftp-glob.h sftp-int.c] + sftp client filename globbing for get, put, ch{mod,grp,own}. ok markus@ - (bal) Fix strerror() in bsd-misc.c - (djm) Add replacement glob() from OpenBSD libc if the system glob is missing or lacks the GLOB_ALTDIRFUNC extension @@ -4552,4 +4555,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.957 2001/03/14 18:37:13 stevesk Exp $ +$Id: ChangeLog,v 1.958 2001/03/14 21:26:27 mouring Exp $ diff --git a/sftp-int.c b/sftp-int.c index d1c505262..cf86012ea 100644 --- a/sftp-int.c +++ b/sftp-int.c @@ -26,7 +26,7 @@ /* XXX: recursive operations */ #include "includes.h" -RCSID("$OpenBSD: sftp-int.c,v 1.27 2001/03/13 22:42:54 djm Exp $"); +RCSID("$OpenBSD: sftp-int.c,v 1.28 2001/03/14 15:15:58 markus Exp $"); #include "buffer.h" #include "xmalloc.h" @@ -70,6 +70,7 @@ int version; #define I_RMDIR 19 #define I_SHELL 20 #define I_SYMLINK 21 +#define I_VERSION 22 struct CMD { const char *c; @@ -102,6 +103,7 @@ const struct CMD cmds[] = { { "rm", I_RM }, { "rmdir", I_RMDIR }, { "symlink", I_SYMLINK }, + { "version", I_VERSION }, { "!", I_SHELL }, { "?", I_HELP }, { NULL, -1} @@ -133,6 +135,7 @@ help(void) printf("rmdir path Remove remote directory\n"); printf("rm path Delete remote file\n"); printf("symlink oldpath newpath Symlink remote file\n"); + printf("version Show SFTP version\n"); printf("!command Execute 'command' in local shell\n"); printf("! Escape to local shell\n"); printf("? Synonym for help\n"); @@ -432,6 +435,7 @@ parse_args(const char **cpp, int *pflag, unsigned long *n_arg, case I_PWD: case I_LPWD: case I_HELP: + case I_VERSION: break; default: fatal("Command not implemented"); @@ -682,6 +686,9 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd) case I_HELP: help(); break; + case I_VERSION: + printf("SFTP protocol version %d\n", version); + break; default: fatal("%d is not implemented", cmdnum); } -- cgit v1.2.3