diff options
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/servconf.c b/servconf.c index 298fefbe2..16eaeba01 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$Id: servconf.c,v 1.13 2000/04/29 13:57:11 damien Exp $"); | 15 | RCSID("$Id: servconf.c,v 1.14 2000/05/01 23:23:45 damien Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "servconf.h" | 18 | #include "servconf.h" |
@@ -33,6 +33,7 @@ initialize_server_options(ServerOptions *options) | |||
33 | options->listen_addrs = NULL; | 33 | options->listen_addrs = NULL; |
34 | options->host_key_file = NULL; | 34 | options->host_key_file = NULL; |
35 | options->dsa_key_file = NULL; | 35 | options->dsa_key_file = NULL; |
36 | options->pid_file = NULL; | ||
36 | options->server_key_bits = -1; | 37 | options->server_key_bits = -1; |
37 | options->login_grace_time = -1; | 38 | options->login_grace_time = -1; |
38 | options->key_regeneration_time = -1; | 39 | options->key_regeneration_time = -1; |
@@ -84,6 +85,8 @@ fill_default_server_options(ServerOptions *options) | |||
84 | options->host_key_file = HOST_KEY_FILE; | 85 | options->host_key_file = HOST_KEY_FILE; |
85 | if (options->dsa_key_file == NULL) | 86 | if (options->dsa_key_file == NULL) |
86 | options->dsa_key_file = DSA_KEY_FILE; | 87 | options->dsa_key_file = DSA_KEY_FILE; |
88 | if (options->pid_file == NULL) | ||
89 | options->pid_file = SSH_DAEMON_PID_FILE; | ||
87 | if (options->server_key_bits == -1) | 90 | if (options->server_key_bits == -1) |
88 | options->server_key_bits = 768; | 91 | options->server_key_bits = 768; |
89 | if (options->login_grace_time == -1) | 92 | if (options->login_grace_time == -1) |
@@ -167,7 +170,7 @@ typedef enum { | |||
167 | sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset, | 170 | sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset, |
168 | sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives, sCheckMail, | 171 | sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives, sCheckMail, |
169 | sUseLogin, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, | 172 | sUseLogin, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, |
170 | sIgnoreUserKnownHosts, sDSAKeyFile, sCiphers, sProtocol | 173 | sIgnoreUserKnownHosts, sDSAKeyFile, sCiphers, sProtocol, sPidFile |
171 | } ServerOpCodes; | 174 | } ServerOpCodes; |
172 | 175 | ||
173 | /* Textual representation of the tokens. */ | 176 | /* Textual representation of the tokens. */ |
@@ -178,6 +181,7 @@ static struct { | |||
178 | { "port", sPort }, | 181 | { "port", sPort }, |
179 | { "hostkey", sHostKeyFile }, | 182 | { "hostkey", sHostKeyFile }, |
180 | { "dsakey", sDSAKeyFile }, | 183 | { "dsakey", sDSAKeyFile }, |
184 | { "pidfile", sPidFile }, | ||
181 | { "serverkeybits", sServerKeyBits }, | 185 | { "serverkeybits", sServerKeyBits }, |
182 | { "logingracetime", sLoginGraceTime }, | 186 | { "logingracetime", sLoginGraceTime }, |
183 | { "keyregenerationinterval", sKeyRegenerationTime }, | 187 | { "keyregenerationinterval", sKeyRegenerationTime }, |
@@ -355,7 +359,19 @@ parse_int: | |||
355 | cp = strtok(NULL, WHITESPACE); | 359 | cp = strtok(NULL, WHITESPACE); |
356 | if (!cp) { | 360 | if (!cp) { |
357 | fprintf(stderr, "%s line %d: missing file name.\n", | 361 | fprintf(stderr, "%s line %d: missing file name.\n", |
358 | filename, linenum); | 362 | filename, linenum); |
363 | exit(1); | ||
364 | } | ||
365 | if (*charptr == NULL) | ||
366 | *charptr = tilde_expand_filename(cp, getuid()); | ||
367 | break; | ||
368 | |||
369 | case sPidFile: | ||
370 | charptr = &options->pid_file; | ||
371 | cp = strtok(NULL, WHITESPACE); | ||
372 | if (!cp) { | ||
373 | fprintf(stderr, "%s line %d: missing file name.\n", | ||
374 | filename, linenum); | ||
359 | exit(1); | 375 | exit(1); |
360 | } | 376 | } |
361 | if (*charptr == NULL) | 377 | if (*charptr == NULL) |