]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Authentication: system_user userdb extra field renamed to system_groups_user.
authorTimo Sirainen <tss@iki.fi>
Sat, 21 Feb 2009 23:22:11 +0000 (18:22 -0500)
committerTimo Sirainen <tss@iki.fi>
Sat, 21 Feb 2009 23:22:11 +0000 (18:22 -0500)
--HG--
branch : HEAD

src/auth/auth-request.c
src/auth/userdb-nss.c
src/auth/userdb-passwd.c
src/master/mail-process.c

index bebcb5c1c7db8de9101726d0616c085adecb55dd..8f9a7de9bd8b8e3cf42b86163f17000f8eadb6fc 100644 (file)
@@ -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);
index 16e84abadf2d6e074767e27997128f8420ad9da5..97a93b6055371390ccf644f96606968a65ac023b 100644 (file)
@@ -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);
index 893b305881ec67879295b5d90f838e7fed833e30..ba1a504e3ac630074fc47d8604141e4f6bdef5f5 100644 (file)
@@ -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,
index b040f905116c4f525b933d65fde30e47cd4f52f2..372d3934778127a5dd9c28311228ae89f4da92dd 100644 (file)
@@ -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);