]> andersk Git - openssh.git/blobdiff - servconf.c
- OpenBSD CVS update
[openssh.git] / servconf.c
index 21123144dfd079b5064afe2b9553883b7ff2ed70..8aeed3e3b00d99b6698ad8965e905125db19780b 100644 (file)
@@ -33,6 +33,7 @@ initialize_server_options(ServerOptions *options)
        options->listen_addrs = NULL;
        options->host_key_file = NULL;
        options->dsa_key_file = NULL;
+       options->pid_file = NULL;
        options->server_key_bits = -1;
        options->login_grace_time = -1;
        options->key_regeneration_time = -1;
@@ -84,6 +85,8 @@ fill_default_server_options(ServerOptions *options)
                options->host_key_file = HOST_KEY_FILE;
        if (options->dsa_key_file == NULL)
                options->dsa_key_file = DSA_KEY_FILE;
+       if (options->pid_file == NULL)
+               options->pid_file = SSH_DAEMON_PID_FILE;
        if (options->server_key_bits == -1)
                options->server_key_bits = 768;
        if (options->login_grace_time == -1)
@@ -167,7 +170,7 @@ typedef enum {
        sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset,
        sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives, sCheckMail,
        sUseLogin, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
-       sIgnoreUserKnownHosts, sDSAKeyFile, sCiphers, sProtocol
+       sIgnoreUserKnownHosts, sDSAKeyFile, sCiphers, sProtocol, sPidFile
 } ServerOpCodes;
 
 /* Textual representation of the tokens. */
@@ -178,6 +181,7 @@ static struct {
        { "port", sPort },
        { "hostkey", sHostKeyFile },
        { "dsakey", sDSAKeyFile },
+       { "pidfile", sPidFile },
        { "serverkeybits", sServerKeyBits },
        { "logingracetime", sLoginGraceTime },
        { "keyregenerationinterval", sKeyRegenerationTime },
@@ -355,7 +359,19 @@ parse_int:
                        cp = strtok(NULL, WHITESPACE);
                        if (!cp) {
                                fprintf(stderr, "%s line %d: missing file name.\n",
-                                       filename, linenum);
+                                   filename, linenum);
+                               exit(1);
+                       }
+                       if (*charptr == NULL)
+                               *charptr = tilde_expand_filename(cp, getuid());
+                       break;
+
+               case sPidFile:
+                       charptr = &options->pid_file;
+                       cp = strtok(NULL, WHITESPACE);
+                       if (!cp) {
+                               fprintf(stderr, "%s line %d: missing file name.\n",
+                                   filename, linenum);
                                exit(1);
                        }
                        if (*charptr == NULL)
This page took 0.49761 seconds and 4 git commands to generate.