From: Timo Sirainen Date: Mon, 31 Aug 2009 16:43:23 +0000 (-0400) Subject: config: Auth settings now require the "auth_" prefix also inside auth blocks. X-Git-Tag: 2.0.alpha1~218 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=57d2429fae575e96ca276355af675deb66b76d00;p=thirdparty%2Fdovecot%2Fcore.git config: Auth settings now require the "auth_" prefix also inside auth blocks. --HG-- branch : HEAD --- diff --git a/dovecot-example.conf b/dovecot-example.conf index b42efc8fe6..5e148b723e 100644 --- a/dovecot-example.conf +++ b/dovecot-example.conf @@ -743,9 +743,6 @@ protocol lda { # Executable location #auth_executable = /usr/libexec/dovecot/dovecot-auth -# Set max. process size in megabytes. -#auth_process_size = 256 - # Authentication cache size in kilobytes. 0 means it's disabled. # Note that bsdauth, PAM and vpopmail require cache_key to be set for caching # to be used. @@ -840,7 +837,7 @@ auth default { # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey # gss-spnego # NOTE: See also disable_plaintext_auth setting. - mechanisms = plain + auth_mechanisms = plain # # Password database is used to verify user's password (and nothing more). @@ -1041,29 +1038,13 @@ auth default { #userdb vpopmail { #} - # User to use for the process. This user needs access to only user and - # password databases, nothing else. Only shadow and pam authentication - # requires roots, so use something else if possible. Note that passwd - # authentication with BSDs internally accesses shadow files, which also - # requires roots. Note that this user is NOT used to access mails. - # That user is specified by userdb above. - user = root - - # Directory where to chroot the process. Most authentication backends don't - # work if this is set, and there's no point chrooting if auth_user is root. - # Note that valid_chroot_dirs isn't needed to use this setting. - #chroot = - - # Number of authentication processes to create - #count = 1 - # Require a valid SSL client certificate or the authentication fails. - #ssl_require_client_cert = no + #auth_ssl_require_client_cert = no # Take the username from client's SSL certificate, using # X509_NAME_get_text_by_NID() which returns the subject's DN's # CommonName. - #ssl_username_from_cert = no + #auth_ssl_username_from_cert = no } # If you wish to use another authentication server than dovecot-auth, you can diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index e5ca2e56e7..dfe3d71a68 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -60,15 +60,16 @@ struct setting_parser_info auth_userdb_setting_parser_info = { MEMBER(struct_size) sizeof(struct auth_userdb_settings) }; +/* we're kind of kludging here to avoid "auth_" prefix in the struct fields */ #undef DEF #undef DEFLIST #define DEF(type, name) \ - { type, #name, offsetof(struct auth_settings, name), NULL } + { type, "auth_"#name, offsetof(struct auth_settings, name), NULL } #define DEFLIST(field, name, defines) \ { SET_DEFLIST, name, offsetof(struct auth_settings, field), defines } static struct setting_define auth_setting_defines[] = { - DEF(SET_STR, name), + { SET_STR, "name", offsetof(struct auth_settings, name), NULL }, DEF(SET_STR, mechanisms), DEF(SET_STR, realms), DEF(SET_STR, default_realm), diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 19a980b5c9..6b777c2f48 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -575,16 +575,16 @@ prevfile: /* get auth_* settings working outside auth sections. we'll verify that the setting is valid, but delay actually adding it */ - const char *s = t_strdup(str_c(str) + 5); + const char *s = t_strdup(str_c(str)); str_truncate(str, 0); - str_printfa(str, "auth/0/%s=", key + 5); + str_printfa(str, "auth/0/%s=", key); if (*value != '<' || !expand_files) str_append(str, value); else str_append_file(str, key, value+1, &errormsg); - if (config_apply_line(parsers, key + 5, str_c(str), NULL, &errormsg) < 0) + if (config_apply_line(parsers, key, str_c(str), NULL, &errormsg) < 0) break; array_append(&auth_defaults, &s, 1); }