From: Timo Sirainen Date: Sat, 21 Feb 2009 23:22:11 +0000 (-0500) Subject: Authentication: system_user userdb extra field renamed to system_groups_user. X-Git-Tag: 1.2.beta2~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=312d3129573fc63ba0d39105b68daccfab9f0c8f;p=thirdparty%2Fdovecot%2Fcore.git Authentication: system_user userdb extra field renamed to system_groups_user. --HG-- branch : HEAD --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index bebcb5c1c7..8f9a7de9bd 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -1168,6 +1168,9 @@ void auth_request_set_userdb_field(struct auth_request *request, } 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 --git a/src/auth/userdb-nss.c b/src/auth/userdb-nss.c index 16e84abadf..97a93b6055 100644 --- a/src/auth/userdb-nss.c +++ b/src/auth/userdb-nss.c @@ -72,7 +72,8 @@ userdb_nss_lookup(struct auth_request *auth_request, 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 --git a/src/auth/userdb-passwd.c b/src/auth/userdb-passwd.c index 893b305881..ba1a504e3a 100644 --- a/src/auth/userdb-passwd.c +++ b/src/auth/userdb-passwd.c @@ -38,9 +38,12 @@ static void passwd_lookup(struct auth_request *auth_request, 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 --git a/src/master/mail-process.c b/src/master/mail-process.c index b040f90511..372d393477 100644 --- a/src/master/mail-process.c +++ b/src/master/mail-process.c @@ -551,7 +551,7 @@ create_mail_process(enum process_type process_type, struct settings *set, { 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 process_type, struct settings *set, } 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 process_type, struct settings *set, 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 process_type, struct settings *set, /* 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);