diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | session.c | 12 |
2 files changed, 14 insertions, 4 deletions
@@ -18,6 +18,10 @@ | |||
18 | - krw@cvs.openbsd.org 2008/08/02 04:29:51 | 18 | - krw@cvs.openbsd.org 2008/08/02 04:29:51 |
19 | [ssh_config.5] | 19 | [ssh_config.5] |
20 | whitepsace -> whitespace. From Matthew Clarke via bugs@. | 20 | whitepsace -> whitespace. From Matthew Clarke via bugs@. |
21 | - djm@cvs.openbsd.org 2008/08/21 04:09:57 | ||
22 | [session.c] | ||
23 | allow ForceCommand internal-sftp with arguments. based on patch from | ||
24 | michael.barabanov AT gmail.com; ok markus@ | ||
21 | 25 | ||
22 | 20080906 | 26 | 20080906 |
23 | - (dtucker) [config.guess config.sub] Update to latest versions from | 27 | - (dtucker) [config.guess config.sub] Update to latest versions from |
@@ -4752,4 +4756,4 @@ | |||
4752 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4756 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4753 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4757 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4754 | 4758 | ||
4755 | $Id: ChangeLog,v 1.5103 2008/11/03 08:17:33 djm Exp $ | 4759 | $Id: ChangeLog,v 1.5104 2008/11/03 08:17:57 djm Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.c,v 1.241 2008/06/16 13:22:53 dtucker Exp $ */ | 1 | /* $OpenBSD: session.c,v 1.242 2008/08/21 04:09:57 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
4 | * All rights reserved | 4 | * All rights reserved |
@@ -95,6 +95,12 @@ | |||
95 | #include <kafs.h> | 95 | #include <kafs.h> |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | #define IS_INTERNAL_SFTP(c) \ | ||
99 | (!strncmp(c, INTERNAL_SFTP_NAME, sizeof(INTERNAL_SFTP_NAME) - 1) && \ | ||
100 | (c[sizeof(INTERNAL_SFTP_NAME) - 1] == '\0' || \ | ||
101 | c[sizeof(INTERNAL_SFTP_NAME) - 1] == ' ' || \ | ||
102 | c[sizeof(INTERNAL_SFTP_NAME) - 1] == '\t')) | ||
103 | |||
98 | /* func */ | 104 | /* func */ |
99 | 105 | ||
100 | Session *session_new(void); | 106 | Session *session_new(void); |
@@ -781,7 +787,7 @@ do_exec(Session *s, const char *command) | |||
781 | if (options.adm_forced_command) { | 787 | if (options.adm_forced_command) { |
782 | original_command = command; | 788 | original_command = command; |
783 | command = options.adm_forced_command; | 789 | command = options.adm_forced_command; |
784 | if (strcmp(INTERNAL_SFTP_NAME, command) == 0) | 790 | if (IS_INTERNAL_SFTP(command)) |
785 | s->is_subsystem = SUBSYSTEM_INT_SFTP; | 791 | s->is_subsystem = SUBSYSTEM_INT_SFTP; |
786 | else if (s->is_subsystem) | 792 | else if (s->is_subsystem) |
787 | s->is_subsystem = SUBSYSTEM_EXT; | 793 | s->is_subsystem = SUBSYSTEM_EXT; |
@@ -789,7 +795,7 @@ do_exec(Session *s, const char *command) | |||
789 | } else if (forced_command) { | 795 | } else if (forced_command) { |
790 | original_command = command; | 796 | original_command = command; |
791 | command = forced_command; | 797 | command = forced_command; |
792 | if (strcmp(INTERNAL_SFTP_NAME, command) == 0) | 798 | if (IS_INTERNAL_SFTP(command)) |
793 | s->is_subsystem = SUBSYSTEM_INT_SFTP; | 799 | s->is_subsystem = SUBSYSTEM_INT_SFTP; |
794 | else if (s->is_subsystem) | 800 | else if (s->is_subsystem) |
795 | s->is_subsystem = SUBSYSTEM_EXT; | 801 | s->is_subsystem = SUBSYSTEM_EXT; |