diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.c,v 1.204 2006/07/02 22:45:59 stevesk Exp $ */ | 1 | /* $OpenBSD: session.c,v 1.205 2006/07/06 10:47:05 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 |
@@ -1841,7 +1841,7 @@ session_subsystem_req(Session *s) | |||
1841 | struct stat st; | 1841 | struct stat st; |
1842 | u_int len; | 1842 | u_int len; |
1843 | int success = 0; | 1843 | int success = 0; |
1844 | char *cmd, *subsys = packet_get_string(&len); | 1844 | char *prog, *cmd, *subsys = packet_get_string(&len); |
1845 | u_int i; | 1845 | u_int i; |
1846 | 1846 | ||
1847 | packet_check_eom(); | 1847 | packet_check_eom(); |
@@ -1849,9 +1849,10 @@ session_subsystem_req(Session *s) | |||
1849 | 1849 | ||
1850 | for (i = 0; i < options.num_subsystems; i++) { | 1850 | for (i = 0; i < options.num_subsystems; i++) { |
1851 | if (strcmp(subsys, options.subsystem_name[i]) == 0) { | 1851 | if (strcmp(subsys, options.subsystem_name[i]) == 0) { |
1852 | cmd = options.subsystem_command[i]; | 1852 | prog = options.subsystem_command[i]; |
1853 | if (stat(cmd, &st) < 0) { | 1853 | cmd = options.subsystem_args[i]; |
1854 | error("subsystem: cannot stat %s: %s", cmd, | 1854 | if (stat(prog, &st) < 0) { |
1855 | error("subsystem: cannot stat %s: %s", prog, | ||
1855 | strerror(errno)); | 1856 | strerror(errno)); |
1856 | break; | 1857 | break; |
1857 | } | 1858 | } |