]> andersk Git - openssh.git/blobdiff - servconf.c
- OpenBSD CVS updates:
[openssh.git] / servconf.c
index bf45295820db230b131009b95099ac0905a3845a..42bd5df56d5c07889b3b5208f0181cc8becceec8 100644 (file)
@@ -75,6 +75,7 @@ initialize_server_options(ServerOptions *options)
        options->ciphers = NULL;
        options->protocol = SSH_PROTO_UNKNOWN;
        options->gateway_ports = -1;
+       options->num_subsystems = 0;
 }
 
 void
@@ -160,7 +161,7 @@ fill_default_server_options(ServerOptions *options)
                options->gateway_ports = 0;
 }
 
-#define WHITESPACE " \t\r\n"
+#define WHITESPACE " \t\r\n="
 
 /* Keyword tokens. */
 typedef enum {
@@ -182,7 +183,7 @@ 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. */
@@ -237,6 +238,7 @@ static struct {
        { "ciphers", sCiphers },
        { "protocol", sProtocol },
        { "gatewayports", sGatewayPorts },
+       { "subsystem", sSubsystem },
        { NULL, 0 }
 };
 
@@ -302,6 +304,7 @@ read_server_config(ServerOptions *options, const char *filename)
        int linenum, *intptr, value;
        int bad_options = 0;
        ServerOpCodes opcode;
+       int i;
 
        f = fopen(filename, "r");
        if (!f) {
@@ -613,6 +616,28 @@ parse_flag:
                                *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);
This page took 0.170998 seconds and 4 git commands to generate.