diff options
Diffstat (limited to 'sftp-int.c')
-rw-r--r-- | sftp-int.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 @@ | |||
26 | /* XXX: recursive operations */ | 26 | /* XXX: recursive operations */ |
27 | 27 | ||
28 | #include "includes.h" | 28 | #include "includes.h" |
29 | RCSID("$OpenBSD: sftp-int.c,v 1.27 2001/03/13 22:42:54 djm Exp $"); | 29 | RCSID("$OpenBSD: sftp-int.c,v 1.28 2001/03/14 15:15:58 markus Exp $"); |
30 | 30 | ||
31 | #include "buffer.h" | 31 | #include "buffer.h" |
32 | #include "xmalloc.h" | 32 | #include "xmalloc.h" |
@@ -70,6 +70,7 @@ int version; | |||
70 | #define I_RMDIR 19 | 70 | #define I_RMDIR 19 |
71 | #define I_SHELL 20 | 71 | #define I_SHELL 20 |
72 | #define I_SYMLINK 21 | 72 | #define I_SYMLINK 21 |
73 | #define I_VERSION 22 | ||
73 | 74 | ||
74 | struct CMD { | 75 | struct CMD { |
75 | const char *c; | 76 | const char *c; |
@@ -102,6 +103,7 @@ const struct CMD cmds[] = { | |||
102 | { "rm", I_RM }, | 103 | { "rm", I_RM }, |
103 | { "rmdir", I_RMDIR }, | 104 | { "rmdir", I_RMDIR }, |
104 | { "symlink", I_SYMLINK }, | 105 | { "symlink", I_SYMLINK }, |
106 | { "version", I_VERSION }, | ||
105 | { "!", I_SHELL }, | 107 | { "!", I_SHELL }, |
106 | { "?", I_HELP }, | 108 | { "?", I_HELP }, |
107 | { NULL, -1} | 109 | { NULL, -1} |
@@ -133,6 +135,7 @@ help(void) | |||
133 | printf("rmdir path Remove remote directory\n"); | 135 | printf("rmdir path Remove remote directory\n"); |
134 | printf("rm path Delete remote file\n"); | 136 | printf("rm path Delete remote file\n"); |
135 | printf("symlink oldpath newpath Symlink remote file\n"); | 137 | printf("symlink oldpath newpath Symlink remote file\n"); |
138 | printf("version Show SFTP version\n"); | ||
136 | printf("!command Execute 'command' in local shell\n"); | 139 | printf("!command Execute 'command' in local shell\n"); |
137 | printf("! Escape to local shell\n"); | 140 | printf("! Escape to local shell\n"); |
138 | printf("? Synonym for help\n"); | 141 | printf("? Synonym for help\n"); |
@@ -432,6 +435,7 @@ parse_args(const char **cpp, int *pflag, unsigned long *n_arg, | |||
432 | case I_PWD: | 435 | case I_PWD: |
433 | case I_LPWD: | 436 | case I_LPWD: |
434 | case I_HELP: | 437 | case I_HELP: |
438 | case I_VERSION: | ||
435 | break; | 439 | break; |
436 | default: | 440 | default: |
437 | fatal("Command not implemented"); | 441 | fatal("Command not implemented"); |
@@ -682,6 +686,9 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd) | |||
682 | case I_HELP: | 686 | case I_HELP: |
683 | help(); | 687 | help(); |
684 | break; | 688 | break; |
689 | case I_VERSION: | ||
690 | printf("SFTP protocol version %d\n", version); | ||
691 | break; | ||
685 | default: | 692 | default: |
686 | fatal("%d is not implemented", cmdnum); | 693 | fatal("%d is not implemented", cmdnum); |
687 | } | 694 | } |