dovecot-1.2: Authentication: system_user userdb extra field rena...

dovecot at dovecot.org dovecot at dovecot.org
Sun Feb 22 01:22:18 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/91e880ae387a
changeset: 8768:91e880ae387a
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 21 18:22:11 2009 -0500
description:
Authentication: system_user userdb extra field renamed to system_groups_user.

diffstat:

4 files changed, 17 insertions(+), 8 deletions(-)
src/auth/auth-request.c   |    3 +++
src/auth/userdb-nss.c     |    3 ++-
src/auth/userdb-passwd.c  |    7 +++++--
src/master/mail-process.c |   12 +++++++-----

diffs (87 lines):

diff -r e82e0a6b9399 -r 91e880ae387a src/auth/auth-request.c
--- a/src/auth/auth-request.c	Sat Feb 21 17:46:35 2009 -0500
+++ b/src/auth/auth-request.c	Sat Feb 21 18:22:11 2009 -0500
@@ -1168,6 +1168,9 @@ void auth_request_set_userdb_field(struc
 	} else if (strcmp(name, "userdb_import") == 0) {
 		auth_stream_reply_import(request->userdb_reply, value);
 		return;
+	} else if (strcmp(name, "system_user") == 0) {
+		/* FIXME: the system_user is for backwards compatibility */
+		name = "system_groups_user";
 	}
 
 	auth_stream_reply_add(request->userdb_reply, name, value);
diff -r e82e0a6b9399 -r 91e880ae387a src/auth/userdb-nss.c
--- a/src/auth/userdb-nss.c	Sat Feb 21 17:46:35 2009 -0500
+++ b/src/auth/userdb-nss.c	Sat Feb 21 18:22:11 2009 -0500
@@ -72,7 +72,8 @@ userdb_nss_lookup(struct auth_request *a
 	auth_request_set_field(auth_request, "user", pw.pw_name, NULL);
 
 	auth_request_init_userdb_reply(auth_request);
-	auth_request_set_userdb_field(auth_request, "system_user", pw.pw_name);
+	auth_request_set_userdb_field(auth_request, "system_groups_user",
+				      pw.pw_name);
 	auth_request_set_userdb_field(auth_request, "uid", dec2str(pw.pw_uid));
 	auth_request_set_userdb_field(auth_request, "gid", dec2str(pw.pw_gid));
 	auth_request_set_userdb_field(auth_request, "home", pw.pw_dir);
diff -r e82e0a6b9399 -r 91e880ae387a src/auth/userdb-passwd.c
--- a/src/auth/userdb-passwd.c	Sat Feb 21 17:46:35 2009 -0500
+++ b/src/auth/userdb-passwd.c	Sat Feb 21 18:22:11 2009 -0500
@@ -38,9 +38,12 @@ static void passwd_lookup(struct auth_re
 	auth_request_init_userdb_reply(auth_request);
 	userdb_static_template_export(module->tmpl, auth_request);
 
-	if (!userdb_static_template_isset(module->tmpl, "system_user")) {
+	/* FIXME: the system_user is for backwards compatibility */
+	if (!userdb_static_template_isset(module->tmpl, "system_groups_user") &&
+	    !userdb_static_template_isset(module->tmpl, "system_user")) {
 		auth_request_set_userdb_field(auth_request,
-					      "system_user", pw->pw_name);
+					      "system_groups_user",
+					      pw->pw_name);
 	}
 	if (!userdb_static_template_isset(module->tmpl, "uid")) {
 		auth_request_set_userdb_field(auth_request,
diff -r e82e0a6b9399 -r 91e880ae387a src/master/mail-process.c
--- a/src/master/mail-process.c	Sat Feb 21 17:46:35 2009 -0500
+++ b/src/master/mail-process.c	Sat Feb 21 18:22:11 2009 -0500
@@ -551,7 +551,7 @@ create_mail_process(enum process_type pr
 {
 	const struct var_expand_table *var_expand_table;
 	const char *p, *addr, *mail, *chroot_dir, *home_dir, *full_home_dir;
-	const char *system_user, *master_user;
+	const char *system_groups_user, *master_user;
 	struct mail_process_group *process_group;
 	char title[1024];
 	struct log_io *log;
@@ -574,7 +574,8 @@ create_mail_process(enum process_type pr
 	}
 
 	t_array_init(&extra_args, 16);
-	mail = home_dir = chroot_dir = system_user = ""; master_user = NULL;
+	mail = home_dir = chroot_dir = system_groups_user = "";
+	master_user = NULL;
 	uid = (uid_t)-1; gid = (gid_t)-1; nice_value = 0;
 	home_given = FALSE;
 	for (; *args != NULL; args++) {
@@ -587,8 +588,8 @@ create_mail_process(enum process_type pr
 			chroot_dir = *args + 7;
 		else if (strncmp(*args, "nice=", 5) == 0)
 			nice_value = atoi(*args + 5);
-		else if (strncmp(*args, "system_user=", 12) == 0)
-			system_user = *args + 12;
+		else if (strncmp(*args, "system_groups_user=", 12) == 0)
+			system_groups_user = *args + 12;
 		else if (strncmp(*args, "uid=", 4) == 0) {
 			if (uid != (uid_t)-1) {
 				i_error("uid specified multiple times for %s",
@@ -768,7 +769,8 @@ create_mail_process(enum process_type pr
 
 	/* setup environment - set the most important environment first
 	   (paranoia about filling up environment without noticing) */
-	restrict_access_set_env(system_user, uid, gid, set->mail_priv_gid_t,
+	restrict_access_set_env(system_groups_user, uid, gid,
+				set->mail_priv_gid_t,
 				dump_capability ? "" : chroot_dir,
 				set->first_valid_gid, set->last_valid_gid,
 				set->mail_access_groups);


More information about the dovecot-cvs mailing list