Commit e89e9427 e89e9427f611eb45be1ede018169b32ec5fd31d4 by Sergey Poznyakoff

(login_disabled): New global.

(argp_option options): Added --login-disabled option.
(imap4d_parse_opt): Handle --login-disabled option.
(main): Call imap4d_capability_init().
Register "STARTTLS" capability if tls is OK.
1 parent fa686270
...@@ -36,17 +36,22 @@ int tls_available; ...@@ -36,17 +36,22 @@ int tls_available;
36 int tls_done; 36 int tls_done;
37 #endif /* WITH_TLS */ 37 #endif /* WITH_TLS */
38 38
39 int login_disabled;
40
39 /* Number of child processes. */ 41 /* Number of child processes. */
40 volatile size_t children; 42 volatile size_t children;
41 43
42 const char *argp_program_version = "imap4d (" PACKAGE_STRING ")"; 44 const char *argp_program_version = "imap4d (" PACKAGE_STRING ")";
43 static char doc[] = N_("GNU imap4d -- the IMAP4D daemon"); 45 static char doc[] = N_("GNU imap4d -- the IMAP4D daemon");
44 46
47 #define ARG_LOGIN_DISABLED 1
45 static struct argp_option options[] = { 48 static struct argp_option options[] = {
46 {"other-namespace", 'O', N_("PATHLIST"), 0, 49 {"other-namespace", 'O', N_("PATHLIST"), 0,
47 N_("set the `other' namespace"), 0}, 50 N_("set the `other' namespace"), 0},
48 {"shared-namespace", 'S', N_("PATHLIST"), 0, 51 {"shared-namespace", 'S', N_("PATHLIST"), 0,
49 N_("set the `shared' namespace"), 0}, 52 N_("set the `shared' namespace"), 0},
53 {"login-disabled", ARG_LOGIN_DISABLED, NULL, 0,
54 N_("Disable LOGIN command")},
50 {NULL, 0, NULL, 0, NULL, 0} 55 {NULL, 0, NULL, 0, NULL, 0}
51 }; 56 };
52 57
...@@ -96,6 +101,11 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state) ...@@ -96,6 +101,11 @@ imap4d_parse_opt (int key, char *arg, struct argp_state *state)
96 set_namespace (NS_SHARED, arg); 101 set_namespace (NS_SHARED, arg);
97 break; 102 break;
98 103
104 case ARG_LOGIN_DISABLED:
105 login_disabled = 1;
106 imap4d_capability_add ("LOGINDISABLED");
107 break;
108
99 default: 109 default:
100 return ARGP_ERR_UNKNOWN; 110 return ARGP_ERR_UNKNOWN;
101 } 111 }
...@@ -114,6 +124,8 @@ main (int argc, char **argv) ...@@ -114,6 +124,8 @@ main (int argc, char **argv)
114 state = STATE_NONAUTH; /* Starting state in non-auth. */ 124 state = STATE_NONAUTH; /* Starting state in non-auth. */
115 125
116 MU_AUTH_REGISTER_ALL_MODULES (); 126 MU_AUTH_REGISTER_ALL_MODULES ();
127 imap4d_capability_init ();
128
117 #ifdef WITH_TLS 129 #ifdef WITH_TLS
118 mu_tls_init_argp (); 130 mu_tls_init_argp ();
119 #endif /* WITH_TLS */ 131 #endif /* WITH_TLS */
...@@ -190,6 +202,8 @@ main (int argc, char **argv) ...@@ -190,6 +202,8 @@ main (int argc, char **argv)
190 tls_available = mu_check_tls_environment (); 202 tls_available = mu_check_tls_environment ();
191 if (tls_available) 203 if (tls_available)
192 tls_available = mu_init_tls_libs (); 204 tls_available = mu_init_tls_libs ();
205 if (tls_available)
206 imap4d_capability_add ("STARTTLS");
193 #endif /* WITH_TLS */ 207 #endif /* WITH_TLS */
194 208
195 /* Actually run the daemon. */ 209 /* Actually run the daemon. */
......