summaryrefslogtreecommitdiff
path: root/session.c
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 /session.c
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.
Diffstat (limited to 'session.c')
-rw-r--r--session.c14
1 files changed, 7 insertions, 7 deletions
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 }