summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-08 17:09:50 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-08 17:09:50 +1100
commitc3dc404113c4bb3d3a86bdee47f15e5c881d12a4 (patch)
tree7b898acaabc60c4c0077cae4699d8d1925816e88
parentd6b06a9f39cde8708a7c6b276635cdea5dcd3820 (diff)
- dtucker@cvs.openbsd.org 2009/11/20 00:15:41
[session.c] Warn but do not fail if stat()ing the subsystem binary fails. This helps with chrootdirectory+forcecommand=sftp-server and restricted shells. bz #1599, ok djm.
-rw-r--r--ChangeLog5
-rw-r--r--session.c14
2 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ece9c09d..16b9c133a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,11 @@
67 with ForceCommand=internal-sftp with a shell session (i.e. not a 67 with ForceCommand=internal-sftp with a shell session (i.e. not a
68 subsystem session). Avoids stuck client when attempting to ssh to such a 68 subsystem session). Avoids stuck client when attempting to ssh to such a
69 service. ok dtucker@ 69 service. ok dtucker@
70 - dtucker@cvs.openbsd.org 2009/11/20 00:15:41
71 [session.c]
72 Warn but do not fail if stat()ing the subsystem binary fails. This helps
73 with chrootdirectory+forcecommand=sftp-server and restricted shells.
74 bz #1599, ok djm.
70 75
7120091226 7620091226
72 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 77 - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
diff --git a/session.c b/session.c
index cc205386f..733b5a909 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.248 2009/11/19 23:39:50 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.249 2009/11/20 00:15:41 dtucker 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
@@ -2121,16 +2121,16 @@ session_subsystem_req(Session *s)
2121 if (strcmp(subsys, options.subsystem_name[i]) == 0) { 2121 if (strcmp(subsys, options.subsystem_name[i]) == 0) {
2122 prog = options.subsystem_command[i]; 2122 prog = options.subsystem_command[i];
2123 cmd = options.subsystem_args[i]; 2123 cmd = options.subsystem_args[i];
2124 if (!strcmp(INTERNAL_SFTP_NAME, prog)) { 2124 if (strcmp(INTERNAL_SFTP_NAME, prog) == 0) {
2125 s->is_subsystem = SUBSYSTEM_INT_SFTP; 2125 s->is_subsystem = SUBSYSTEM_INT_SFTP;
2126 } else if (stat(prog, &st) < 0) { 2126 debug("subsystem: %s", prog);
2127 error("subsystem: cannot stat %s: %s", prog,
2128 strerror(errno));
2129 break;
2130 } else { 2127 } else {
2128 if (stat(prog, &st) < 0)
2129 debug("subsystem: cannot stat %s: %s",
2130 prog, strerror(errno));
2131 s->is_subsystem = SUBSYSTEM_EXT; 2131 s->is_subsystem = SUBSYSTEM_EXT;
2132 debug("subsystem: exec() %s", cmd);
2132 } 2133 }
2133 debug("subsystem: exec() %s", cmd);
2134 success = do_exec(s, cmd) == 0; 2134 success = do_exec(s, cmd) == 0;
2135 break; 2135 break;
2136 } 2136 }