diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-03-14 15:15:59 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-03-14 15:15:59 +0000 |
commit | 60127fc2905e7358cd3fefee7739df4703914438 (patch) | |
tree | 90401298972a3f802cbe7412b5d2b2f0220cda14 | |
parent | fa2ab4e1353333213ff9c2ef53ddffc0f41f5f84 (diff) |
add version command
-rw-r--r-- | usr.bin/ssh/sftp-int.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp-int.c b/usr.bin/ssh/sftp-int.c index d350e398deb..a379c101364 100644 --- a/usr.bin/ssh/sftp-int.c +++ b/usr.bin/ssh/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 <glob.h> @@ -72,6 +72,7 @@ int version; #define I_RMDIR 19 #define I_SHELL 20 #define I_SYMLINK 21 +#define I_VERSION 22 struct CMD { const char *c; @@ -104,6 +105,7 @@ const struct CMD cmds[] = { { "rm", I_RM }, { "rmdir", I_RMDIR }, { "symlink", I_SYMLINK }, + { "version", I_VERSION }, { "!", I_SHELL }, { "?", I_HELP }, { NULL, -1} @@ -135,6 +137,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"); @@ -434,6 +437,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"); @@ -684,6 +688,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); } |