On 17. Feb 2025, at 13.01, Timo Sirainen via dovecot <dovecot@dovecot.org> 
wrote:
> 
> On 17. Feb 2025, at 12.46, Timo Sirainen via dovecot <dovecot@dovecot.org> 
> wrote:
>> Also I've attached a patch that allows using auth-workers with PostgreSQL 
>> with Dovecot v2.4. Maybe it'll be in v2.4.1.
>> 
>> passdb sql {
>> use_worker = yes
>> }
> 
> Well, attachments don't seem to work on this list, so here's inline patch. 
> Should work, but I didn't write a test for it yet:
> 
> commit 9fcc97ba3c336746d868ab17d04392972884befd
> Author: Timo Sirainen <timo.sirai...@open-xchange.com>
> Date:   Mon Feb 17 12:39:11 2025 +0200
> 
>    auth: Allow configuring passdb/userdb sql to use auth-workers
> 
>    If passdb/userdb_use_worker=yes, this overrides the sql-driver specific
>    worker decision.
> 
> diff --git a/src/auth/passdb-sql.c b/src/auth/passdb-sql.c
> index 614344f66a..db1990dc47 100644
> --- a/src/auth/passdb-sql.c
> +++ b/src/auth/passdb-sql.c
> @@ -321,7 +321,8 @@ static void passdb_sql_init(struct passdb_module *_module)
>       enum sql_db_flags flags;
> 
>       flags = sql_get_flags(module->db);
> -     module->module.blocking = (flags & SQL_DB_FLAG_BLOCKING) != 0;
> +     if (!module->module.blocking)
> +             module->module.blocking = (flags & SQL_DB_FLAG_BLOCKING) != 0;
> 
>       if (!module->module.blocking || worker)
>               db_sql_connect(module->db);
> diff --git a/src/auth/userdb-sql.c b/src/auth/userdb-sql.c
> index 671f494d82..aac0fb0de6 100644
> --- a/src/auth/userdb-sql.c
> +++ b/src/auth/userdb-sql.c
> @@ -334,7 +334,8 @@ static void userdb_sql_init(struct userdb_module *_module)
>       enum sql_db_flags flags;
> 
>       flags = sql_get_flags(module->db);
> -     _module->blocking = (flags & SQL_DB_FLAG_BLOCKING) != 0;
> +     if (_module->blocking)

Of course, tiny mistake there: if (!_module->blocking)

> +             _module->blocking = (flags & SQL_DB_FLAG_BLOCKING) != 0;
> 
>       if (!_module->blocking || worker)
>               db_sql_connect(module->db);
> 
> _______________________________________________
> dovecot mailing list -- dovecot@dovecot.org
> To unsubscribe send an email to dovecot-le...@dovecot.org

_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to