summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/servconf.c b/servconf.c
index 55b0b0039..7dbf31834 100644
--- a/servconf.c
+++ b/servconf.c
@@ -10,14 +10,11 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: servconf.c,v 1.84 2001/06/23 15:12:19 itojun Exp $"); 13RCSID("$OpenBSD: servconf.c,v 1.85 2001/06/26 16:15:24 dugsong Exp $");
14 14
15#ifdef KRB4 15#ifdef KRB4
16#include <krb.h> 16#include <krb.h>
17#endif 17#endif
18#ifdef AFS
19#include <kafs.h>
20#endif
21 18
22#include "ssh.h" 19#include "ssh.h"
23#include "log.h" 20#include "log.h"
@@ -70,13 +67,15 @@ initialize_server_options(ServerOptions *options)
70 options->hostbased_uses_name_from_packet_only = -1; 67 options->hostbased_uses_name_from_packet_only = -1;
71 options->rsa_authentication = -1; 68 options->rsa_authentication = -1;
72 options->pubkey_authentication = -1; 69 options->pubkey_authentication = -1;
73#ifdef KRB4 70#if defined(KRB4) || defined(KRB5)
74 options->kerberos_authentication = -1; 71 options->kerberos_authentication = -1;
75 options->kerberos_or_local_passwd = -1; 72 options->kerberos_or_local_passwd = -1;
76 options->kerberos_ticket_cleanup = -1; 73 options->kerberos_ticket_cleanup = -1;
77#endif 74#endif
78#ifdef AFS 75#if defined(AFS) || defined(KRB5)
79 options->kerberos_tgt_passing = -1; 76 options->kerberos_tgt_passing = -1;
77#endif
78#ifdef AFS
80 options->afs_token_passing = -1; 79 options->afs_token_passing = -1;
81#endif 80#endif
82 options->password_authentication = -1; 81 options->password_authentication = -1;
@@ -170,20 +169,22 @@ fill_default_server_options(ServerOptions *options)
170 options->rsa_authentication = 1; 169 options->rsa_authentication = 1;
171 if (options->pubkey_authentication == -1) 170 if (options->pubkey_authentication == -1)
172 options->pubkey_authentication = 1; 171 options->pubkey_authentication = 1;
173#ifdef KRB4 172#if defined(KRB4) || defined(KRB5)
174 if (options->kerberos_authentication == -1) 173 if (options->kerberos_authentication == -1)
175 options->kerberos_authentication = (access(KEYFILE, R_OK) == 0); 174 options->kerberos_authentication = (access(KEYFILE, R_OK) == 0);
176 if (options->kerberos_or_local_passwd == -1) 175 if (options->kerberos_or_local_passwd == -1)
177 options->kerberos_or_local_passwd = 1; 176 options->kerberos_or_local_passwd = 1;
178 if (options->kerberos_ticket_cleanup == -1) 177 if (options->kerberos_ticket_cleanup == -1)
179 options->kerberos_ticket_cleanup = 1; 178 options->kerberos_ticket_cleanup = 1;
180#endif /* KRB4 */ 179#endif
181#ifdef AFS 180#if defined(AFS) || defined(KRB5)
182 if (options->kerberos_tgt_passing == -1) 181 if (options->kerberos_tgt_passing == -1)
183 options->kerberos_tgt_passing = 0; 182 options->kerberos_tgt_passing = 0;
183#endif
184#ifdef AFS
184 if (options->afs_token_passing == -1) 185 if (options->afs_token_passing == -1)
185 options->afs_token_passing = k_hasafs(); 186 options->afs_token_passing = k_hasafs();
186#endif /* AFS */ 187#endif
187 if (options->password_authentication == -1) 188 if (options->password_authentication == -1)
188 options->password_authentication = 1; 189 options->password_authentication = 1;
189 if (options->kbd_interactive_authentication == -1) 190 if (options->kbd_interactive_authentication == -1)
@@ -224,11 +225,14 @@ typedef enum {
224 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, 225 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime,
225 sPermitRootLogin, sLogFacility, sLogLevel, 226 sPermitRootLogin, sLogFacility, sLogLevel,
226 sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication, 227 sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication,
227#ifdef KRB4 228#if defined(KRB4) || defined(KRB5)
228 sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup, 229 sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup,
229#endif 230#endif
231#if defined(AFS) || defined(KRB5)
232 sKerberosTgtPassing,
233#endif
230#ifdef AFS 234#ifdef AFS
231 sKerberosTgtPassing, sAFSTokenPassing, 235 sAFSTokenPassing,
232#endif 236#endif
233 sChallengeResponseAuthentication, 237 sChallengeResponseAuthentication,
234 sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress, 238 sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress,
@@ -267,13 +271,15 @@ static struct {
267 { "rsaauthentication", sRSAAuthentication }, 271 { "rsaauthentication", sRSAAuthentication },
268 { "pubkeyauthentication", sPubkeyAuthentication }, 272 { "pubkeyauthentication", sPubkeyAuthentication },
269 { "dsaauthentication", sPubkeyAuthentication }, /* alias */ 273 { "dsaauthentication", sPubkeyAuthentication }, /* alias */
270#ifdef KRB4 274#if defined(KRB4) || defined(KRB5)
271 { "kerberosauthentication", sKerberosAuthentication }, 275 { "kerberosauthentication", sKerberosAuthentication },
272 { "kerberosorlocalpasswd", sKerberosOrLocalPasswd }, 276 { "kerberosorlocalpasswd", sKerberosOrLocalPasswd },
273 { "kerberosticketcleanup", sKerberosTicketCleanup }, 277 { "kerberosticketcleanup", sKerberosTicketCleanup },
274#endif 278#endif
275#ifdef AFS 279#if defined(AFS) || defined(KRB5)
276 { "kerberostgtpassing", sKerberosTgtPassing }, 280 { "kerberostgtpassing", sKerberosTgtPassing },
281#endif
282#ifdef AFS
277 { "afstokenpassing", sAFSTokenPassing }, 283 { "afstokenpassing", sAFSTokenPassing },
278#endif 284#endif
279 { "passwordauthentication", sPasswordAuthentication }, 285 { "passwordauthentication", sPasswordAuthentication },
@@ -584,8 +590,7 @@ parse_flag:
584 case sPubkeyAuthentication: 590 case sPubkeyAuthentication:
585 intptr = &options->pubkey_authentication; 591 intptr = &options->pubkey_authentication;
586 goto parse_flag; 592 goto parse_flag;
587 593#if defined(KRB4) || defined(KRB5)
588#ifdef KRB4
589 case sKerberosAuthentication: 594 case sKerberosAuthentication:
590 intptr = &options->kerberos_authentication; 595 intptr = &options->kerberos_authentication;
591 goto parse_flag; 596 goto parse_flag;
@@ -598,12 +603,12 @@ parse_flag:
598 intptr = &options->kerberos_ticket_cleanup; 603 intptr = &options->kerberos_ticket_cleanup;
599 goto parse_flag; 604 goto parse_flag;
600#endif 605#endif
601 606#if defined(AFS) || defined(KRB5)
602#ifdef AFS
603 case sKerberosTgtPassing: 607 case sKerberosTgtPassing:
604 intptr = &options->kerberos_tgt_passing; 608 intptr = &options->kerberos_tgt_passing;
605 goto parse_flag; 609 goto parse_flag;
606 610#endif
611#ifdef AFS
607 case sAFSTokenPassing: 612 case sAFSTokenPassing:
608 intptr = &options->afs_token_passing; 613 intptr = &options->afs_token_passing;
609 goto parse_flag; 614 goto parse_flag;