=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/servconf.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- src/usr.bin/ssh/servconf.c 2000/05/31 06:36:40 1.42 +++ src/usr.bin/ssh/servconf.c 2000/06/17 22:52:33 1.43 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$Id: servconf.c,v 1.42 2000/05/31 06:36:40 markus Exp $"); +RCSID("$Id: servconf.c,v 1.43 2000/06/17 22:52:33 jakob Exp $"); #include "ssh.h" #include "servconf.h" @@ -75,6 +75,7 @@ options->ciphers = NULL; options->protocol = SSH_PROTO_UNKNOWN; options->gateway_ports = -1; + options->num_subsystems = 0; } void @@ -182,7 +183,7 @@ sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives, sCheckMail, sUseLogin, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, sIgnoreUserKnownHosts, sHostDSAKeyFile, sCiphers, sProtocol, sPidFile, - sGatewayPorts, sDSAAuthentication, sXAuthLocation + sGatewayPorts, sDSAAuthentication, sXAuthLocation, sSubsystem } ServerOpCodes; /* Textual representation of the tokens. */ @@ -237,6 +238,7 @@ { "ciphers", sCiphers }, { "protocol", sProtocol }, { "gatewayports", sGatewayPorts }, + { "subsystem", sSubsystem }, { NULL, 0 } }; @@ -302,6 +304,7 @@ int linenum, *intptr, value; int bad_options = 0; ServerOpCodes opcode; + int i; f = fopen(filename, "r"); if (!f) { @@ -611,6 +614,28 @@ filename, linenum, cp ? cp : ""); if (*intptr == SSH_PROTO_UNKNOWN) *intptr = value; + break; + + case sSubsystem: + if(options->num_subsystems >= MAX_SUBSYSTEMS) { + fatal("%s line %d: too many subsystems defined.", + filename, linenum); + } + cp = strtok(NULL, WHITESPACE); + if (!cp) + fatal("%s line %d: Missing subsystem name.", + filename, linenum); + for (i = 0; i < options->num_subsystems; i++) + if(strcmp(cp, options->subsystem_name[i]) == 0) + fatal("%s line %d: Subsystem '%s' already defined.", + filename, linenum, cp); + options->subsystem_name[options->num_subsystems] = xstrdup(cp); + cp = strtok(NULL, WHITESPACE); + if (!cp) + fatal("%s line %d: Missing subsystem command.", + filename, linenum); + options->subsystem_command[options->num_subsystems] = xstrdup(cp); + options->num_subsystems++; break; default: