summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-14 15:11:48 +1000
committerDamien Miller <djm@mindrot.org>2003-05-14 15:11:48 +1000
commit4e448a31ae12e6f84caa7cdfc8b4c23db92459db (patch)
tree8f4c0885c8c91456b4d27d7f405e9125b83491a4 /servconf.c
parent9c617693c2250c62e5e326372bc783e3416a94b0 (diff)
- (djm) Add new UsePAM configuration directive to allow runtime control
over usage of PAM. This allows non-root use of sshd when built with --with-pam
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/servconf.c b/servconf.c
index 8e2839085..fbdc4d8fa 100644
--- a/servconf.c
+++ b/servconf.c
@@ -59,8 +59,10 @@ initialize_server_options(ServerOptions *options)
59{ 59{
60 memset(options, 0, sizeof(*options)); 60 memset(options, 0, sizeof(*options));
61 61
62#ifdef USE_PAM
62 /* Portable-specific options */ 63 /* Portable-specific options */
63 options->pam_authentication_via_kbd_int = -1; 64 options->use_pam = -1;
65#endif
64 66
65 /* Standard Options */ 67 /* Standard Options */
66 options->num_ports = 0; 68 options->num_ports = 0;
@@ -136,8 +138,10 @@ void
136fill_default_server_options(ServerOptions *options) 138fill_default_server_options(ServerOptions *options)
137{ 139{
138 /* Portable-specific options */ 140 /* Portable-specific options */
139 if (options->pam_authentication_via_kbd_int == -1) 141#ifdef USE_PAM
140 options->pam_authentication_via_kbd_int = 0; 142 if (options->use_pam == -1)
143 options->use_pam = 1;
144#endif
141 145
142 /* Standard Options */ 146 /* Standard Options */
143 if (options->protocol == SSH_PROTO_UNKNOWN) 147 if (options->protocol == SSH_PROTO_UNKNOWN)
@@ -279,7 +283,7 @@ fill_default_server_options(ServerOptions *options)
279typedef enum { 283typedef enum {
280 sBadOption, /* == unknown option */ 284 sBadOption, /* == unknown option */
281 /* Portable-specific options */ 285 /* Portable-specific options */
282 sPAMAuthenticationViaKbdInt, 286 sUsePAM,
283 /* Standard Options */ 287 /* Standard Options */
284 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, 288 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime,
285 sPermitRootLogin, sLogFacility, sLogLevel, 289 sPermitRootLogin, sLogFacility, sLogLevel,
@@ -315,7 +319,7 @@ static struct {
315 ServerOpCodes opcode; 319 ServerOpCodes opcode;
316} keywords[] = { 320} keywords[] = {
317 /* Portable-specific options */ 321 /* Portable-specific options */
318 { "PAMAuthenticationViaKbdInt", sPAMAuthenticationViaKbdInt }, 322 { "UsePAM", sUsePAM },
319 /* Standard Options */ 323 /* Standard Options */
320 { "port", sPort }, 324 { "port", sPort },
321 { "hostkey", sHostKeyFile }, 325 { "hostkey", sHostKeyFile },
@@ -462,8 +466,8 @@ process_server_config_line(ServerOptions *options, char *line,
462 opcode = parse_token(arg, filename, linenum); 466 opcode = parse_token(arg, filename, linenum);
463 switch (opcode) { 467 switch (opcode) {
464 /* Portable-specific options */ 468 /* Portable-specific options */
465 case sPAMAuthenticationViaKbdInt: 469 case sUsePAM:
466 intptr = &options->pam_authentication_via_kbd_int; 470 intptr = &options->use_pam;
467 goto parse_flag; 471 goto parse_flag;
468 472
469 /* Standard Options */ 473 /* Standard Options */