]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage, util: mail_storage_service_restrict_setenv() - Remove ctx parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 19 Jan 2023 21:25:17 +0000 (23:25 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
It can be accessed via the user parameter.

src/lib-storage/mail-storage-service.c
src/lib-storage/mail-storage-service.h
src/util/script-login.c

index 4db2db7181e3a91ea4a1c61a57f3bc50f1845ec8..4a3d93818aa48bb4ea5a7092e0feeb6f7f7885a6 100644 (file)
@@ -1579,13 +1579,12 @@ int mail_storage_service_next_with_session_suffix(struct mail_storage_service_ct
        return ret;
 }
 
-void mail_storage_service_restrict_setenv(struct mail_storage_service_ctx *ctx,
-                                         struct mail_storage_service_user *user)
+void mail_storage_service_restrict_setenv(struct mail_storage_service_user *user)
 {
        struct mail_storage_service_privileges priv;
        const char *error;
 
-       if (service_parse_privileges(ctx, user, &priv, &error) < 0)
+       if (service_parse_privileges(user->service_ctx, user, &priv, &error) < 0)
                i_fatal("user %s: %s", user->input.username, error);
        if (service_drop_privileges(user, &priv,
                                    TRUE, FALSE, TRUE, &error) < 0)
index adddc4081f21f6145501c0b0c44016e47282ab75..86f84258b82d95abb94c736c88ba74b222847add 100644 (file)
@@ -117,8 +117,7 @@ int mail_storage_service_next_with_session_suffix(struct mail_storage_service_ct
                                                  const char *session_id_postfix,
                                                  struct mail_user **mail_user_r,
                                                   const char **error_r);
-void mail_storage_service_restrict_setenv(struct mail_storage_service_ctx *ctx,
-                                         struct mail_storage_service_user *user);
+void mail_storage_service_restrict_setenv(struct mail_storage_service_user *user);
 /* Combine lookup() and next() into one call. */
 int mail_storage_service_lookup_next(struct mail_storage_service_ctx *ctx,
                                     const struct mail_storage_service_input *input,
index 14346c4bd0a0c1c71aa650c492b879f0ec2cd53c..be77c78024c3aa99d50d17e15e19ae2ea881ebbd 100644 (file)
@@ -118,7 +118,7 @@ static void client_connected(struct master_service_connection *conn)
                service_ctx = mail_storage_service_init(master_service, NULL, flags);
                if (mail_storage_service_lookup(service_ctx, &input, &user, &error) <= 0)
                        i_fatal("%s", error);
-               mail_storage_service_restrict_setenv(service_ctx, user);
+               mail_storage_service_restrict_setenv(user);
                /* we can't exec anything in a chroot */
                env_remove("RESTRICT_CHROOT");
                restrict_access_by_env(0, getenv("HOME"));