[serverloop.c sshconnect.c uuencode.c]
move #include <netinet/in.h> out of includes.h; ok deraadt@
(also ssh-rand-helper.c logintest.c loginrec.c)
+ - djm@cvs.openbsd.org 2006/07/06 10:47:05
+ [servconf.c servconf.h session.c sshd_config.5]
+ support arguments to Subsystem commands; ok markus@
20060706
- (dtucker) [configure.ac] Try AIX blibpath test in different order when
-/* $OpenBSD: servconf.c,v 1.150 2006/03/25 13:17:02 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.151 2006/07/06 10:47:05 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
ServerOpCodes opcode;
u_short port;
u_int i;
+ size_t len;
cp = line;
if ((arg = strdelim(&cp)) == NULL)
fatal("%s line %d: Missing subsystem command.",
filename, linenum);
options->subsystem_command[options->num_subsystems] = xstrdup(arg);
+
+ /* Collect arguments (separate to executable) */
+ p = xstrdup(arg);
+ len = strlen(p) + 1;
+ while ((arg = strdelim(&cp)) != NULL && *arg != '\0') {
+ len += 1 + strlen(arg);
+ p = xrealloc(p, 1, len);
+ strlcat(p, " ", len);
+ strlcat(p, arg, len);
+ }
+ options->subsystem_args[options->num_subsystems] = p;
options->num_subsystems++;
break;
-/* $OpenBSD: servconf.h,v 1.73 2006/03/25 22:22:43 djm Exp $ */
+/* $OpenBSD: servconf.h,v 1.74 2006/07/06 10:47:05 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
u_int num_subsystems;
char *subsystem_name[MAX_SUBSYSTEMS];
char *subsystem_command[MAX_SUBSYSTEMS];
+ char *subsystem_args[MAX_SUBSYSTEMS];
u_int num_accept_env;
char *accept_env[MAX_ACCEPT_ENV];
-/* $OpenBSD: session.c,v 1.204 2006/07/02 22:45:59 stevesk Exp $ */
+/* $OpenBSD: session.c,v 1.205 2006/07/06 10:47:05 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
struct stat st;
u_int len;
int success = 0;
- char *cmd, *subsys = packet_get_string(&len);
+ char *prog, *cmd, *subsys = packet_get_string(&len);
u_int i;
packet_check_eom();
for (i = 0; i < options.num_subsystems; i++) {
if (strcmp(subsys, options.subsystem_name[i]) == 0) {
- cmd = options.subsystem_command[i];
- if (stat(cmd, &st) < 0) {
- error("subsystem: cannot stat %s: %s", cmd,
+ prog = options.subsystem_command[i];
+ cmd = options.subsystem_args[i];
+ if (stat(prog, &st) < 0) {
+ error("subsystem: cannot stat %s: %s", prog,
strerror(errno));
break;
}
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: sshd_config.5,v 1.58 2006/07/02 17:12:58 stevesk Exp $
+.\" $OpenBSD: sshd_config.5,v 1.59 2006/07/06 10:47:05 djm Exp $
.Dd September 25, 1999
.Dt SSHD_CONFIG 5
.Os
.Dq yes .
.It Cm Subsystem
Configures an external subsystem (e.g. file transfer daemon).
-Arguments should be a subsystem name and a command to execute upon subsystem
-request.
+Arguments should be a subsystem name and a command (with optional arguments)
+to execute upon subsystem request.
The command
.Xr sftp-server 8
implements the