options->ciphers = NULL;
options->protocol = SSH_PROTO_UNKNOWN;
options->gateway_ports = -1;
+ options->num_subsystems = 0;
}
void
options->gateway_ports = 0;
}
-#define WHITESPACE " \t\r\n"
+#define WHITESPACE " \t\r\n="
/* Keyword tokens. */
typedef enum {
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. */
{ "ciphers", sCiphers },
{ "protocol", sProtocol },
{ "gatewayports", sGatewayPorts },
+ { "subsystem", sSubsystem },
{ NULL, 0 }
};
int linenum, *intptr, value;
int bad_options = 0;
ServerOpCodes opcode;
+ int i;
f = fopen(filename, "r");
if (!f) {
*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:
fprintf(stderr, "%s line %d: Missing handler for opcode %s (%d)\n",
filename, linenum, cp, opcode);