diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 02:30:41 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-03-22 02:30:41 +0000 |
commit | 7a2073c50b92c053594d48a651ebafae052a71ed (patch) | |
tree | 7cfceb925262a07a356b0667e19f33eec497b602 /servconf.c | |
parent | 0f345f5ee1e71e1e9f8780ec13b2da23b6a9f7f8 (diff) |
- provos@cvs.openbsd.org 2002/03/18 17:50:31
[auth-bsdauth.c auth-options.c auth-rh-rsa.c auth-rsa.c auth-skey.c auth.h
auth1.c auth2-chall.c auth2.c kex.c kex.h kexdh.c kexgex.c servconf.c
session.h servconf.h serverloop.c session.c sshd.c]
integrate privilege separated openssh; its turned off by default for now.
work done by me and markus@
applied, but outside of ensure that smaller code bits migrated with
their owners.. no work was tried to 'fix' it to work. =) Later project!
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c index 9bbd994ca..3b6b55e93 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "includes.h" | 12 | #include "includes.h" |
13 | RCSID("$OpenBSD: servconf.c,v 1.101 2002/02/04 12:15:25 markus Exp $"); | 13 | RCSID("$OpenBSD: servconf.c,v 1.102 2002/03/18 17:50:31 provos Exp $"); |
14 | 14 | ||
15 | #if defined(KRB4) || defined(KRB5) | 15 | #if defined(KRB4) || defined(KRB5) |
16 | #include <krb.h> | 16 | #include <krb.h> |
@@ -36,6 +36,8 @@ static void add_one_listen_addr(ServerOptions *, char *, u_short); | |||
36 | 36 | ||
37 | /* AF_UNSPEC or AF_INET or AF_INET6 */ | 37 | /* AF_UNSPEC or AF_INET or AF_INET6 */ |
38 | extern int IPv4or6; | 38 | extern int IPv4or6; |
39 | /* Use of privilege separation or not */ | ||
40 | extern int use_privsep; | ||
39 | 41 | ||
40 | /* Initializes the server options to their default values. */ | 42 | /* Initializes the server options to their default values. */ |
41 | 43 | ||
@@ -110,6 +112,13 @@ initialize_server_options(ServerOptions *options) | |||
110 | options->client_alive_count_max = -1; | 112 | options->client_alive_count_max = -1; |
111 | options->authorized_keys_file = NULL; | 113 | options->authorized_keys_file = NULL; |
112 | options->authorized_keys_file2 = NULL; | 114 | options->authorized_keys_file2 = NULL; |
115 | |||
116 | options->unprivileged_user = -1; | ||
117 | options->unprivileged_group = -1; | ||
118 | options->unprivileged_dir = NULL; | ||
119 | |||
120 | /* Needs to be accessable in many places */ | ||
121 | use_privsep = -1; | ||
113 | } | 122 | } |
114 | 123 | ||
115 | void | 124 | void |
@@ -235,6 +244,16 @@ fill_default_server_options(ServerOptions *options) | |||
235 | } | 244 | } |
236 | if (options->authorized_keys_file == NULL) | 245 | if (options->authorized_keys_file == NULL) |
237 | options->authorized_keys_file = _PATH_SSH_USER_PERMITTED_KEYS; | 246 | options->authorized_keys_file = _PATH_SSH_USER_PERMITTED_KEYS; |
247 | |||
248 | /* Turn privilege separation _off_ by default */ | ||
249 | if (use_privsep == -1) | ||
250 | use_privsep = 0; | ||
251 | if (options->unprivileged_user == -1) | ||
252 | options->unprivileged_user = 32767; | ||
253 | if (options->unprivileged_group == -1) | ||
254 | options->unprivileged_group = 32767; | ||
255 | if (options->unprivileged_dir == NULL) | ||
256 | options->unprivileged_dir = "/var/empty"; | ||
238 | } | 257 | } |
239 | 258 | ||
240 | /* Keyword tokens. */ | 259 | /* Keyword tokens. */ |
@@ -267,6 +286,7 @@ typedef enum { | |||
267 | sBanner, sVerifyReverseMapping, sHostbasedAuthentication, | 286 | sBanner, sVerifyReverseMapping, sHostbasedAuthentication, |
268 | sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, | 287 | sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, |
269 | sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2, | 288 | sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2, |
289 | sUsePrivilegeSeparation, sUnprivUser, sUnprivGroup, sUnprivDir, | ||
270 | sDeprecated | 290 | sDeprecated |
271 | } ServerOpCodes; | 291 | } ServerOpCodes; |
272 | 292 | ||
@@ -342,6 +362,10 @@ static struct { | |||
342 | { "clientalivecountmax", sClientAliveCountMax }, | 362 | { "clientalivecountmax", sClientAliveCountMax }, |
343 | { "authorizedkeysfile", sAuthorizedKeysFile }, | 363 | { "authorizedkeysfile", sAuthorizedKeysFile }, |
344 | { "authorizedkeysfile2", sAuthorizedKeysFile2 }, | 364 | { "authorizedkeysfile2", sAuthorizedKeysFile2 }, |
365 | { "useprivilegeseparation", sUsePrivilegeSeparation}, | ||
366 | { "unprivuser", sUnprivUser}, | ||
367 | { "unprivgroup", sUnprivGroup}, | ||
368 | { "unprivdir", sUnprivDir}, | ||
345 | { NULL, sBadOption } | 369 | { NULL, sBadOption } |
346 | }; | 370 | }; |
347 | 371 | ||
@@ -718,6 +742,22 @@ parse_flag: | |||
718 | intptr = &options->allow_tcp_forwarding; | 742 | intptr = &options->allow_tcp_forwarding; |
719 | goto parse_flag; | 743 | goto parse_flag; |
720 | 744 | ||
745 | case sUsePrivilegeSeparation: | ||
746 | intptr = &use_privsep; | ||
747 | goto parse_flag; | ||
748 | |||
749 | case sUnprivUser: | ||
750 | intptr = &options->unprivileged_user; | ||
751 | goto parse_flag; | ||
752 | |||
753 | case sUnprivGroup: | ||
754 | intptr = &options->unprivileged_group; | ||
755 | goto parse_flag; | ||
756 | |||
757 | case sUnprivDir: | ||
758 | charptr = &options->unprivileged_dir; | ||
759 | goto parse_filename; | ||
760 | |||
721 | case sAllowUsers: | 761 | case sAllowUsers: |
722 | while ((arg = strdelim(&cp)) && *arg != '\0') { | 762 | while ((arg = strdelim(&cp)) && *arg != '\0') { |
723 | if (options->num_allow_users >= MAX_ALLOW_USERS) | 763 | if (options->num_allow_users >= MAX_ALLOW_USERS) |