dovecot-2.0: config: Auth settings now require the "auth_" prefi...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 31 19:43:52 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/3f4d796db5fd
changeset: 9834:3f4d796db5fd
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 31 12:43:23 2009 -0400
description:
config: Auth settings now require the "auth_" prefix also inside auth blocks.

diffstat:

3 files changed, 9 insertions(+), 27 deletions(-)
dovecot-example.conf       |   25 +++----------------------
src/auth/auth-settings.c   |    5 +++--
src/config/config-parser.c |    6 +++---

diffs (99 lines):

diff -r a0ec16185806 -r 3f4d796db5fd dovecot-example.conf
--- a/dovecot-example.conf	Mon Aug 31 12:20:38 2009 -0400
+++ b/dovecot-example.conf	Mon Aug 31 12:43:23 2009 -0400
@@ -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 -r a0ec16185806 -r 3f4d796db5fd src/auth/auth-settings.c
--- a/src/auth/auth-settings.c	Mon Aug 31 12:20:38 2009 -0400
+++ b/src/auth/auth-settings.c	Mon Aug 31 12:43:23 2009 -0400
@@ -60,15 +60,16 @@ struct setting_parser_info auth_userdb_s
 	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 -r a0ec16185806 -r 3f4d796db5fd src/config/config-parser.c
--- a/src/config/config-parser.c	Mon Aug 31 12:20:38 2009 -0400
+++ b/src/config/config-parser.c	Mon Aug 31 12:43:23 2009 -0400
@@ -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);
 			}


More information about the dovecot-cvs mailing list