]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db-lua - Always set callback when iterating
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 1 Jul 2020 10:18:03 +0000 (13:18 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 3 Jul 2020 06:56:42 +0000 (09:56 +0300)
src/auth/db-lua.c

index d8659ee50bec6595ad1e658a8e7a0e0f92d73684..75c19eae1aeb186f01b78f380acc189314043ad4 100644 (file)
@@ -710,6 +710,9 @@ auth_lua_call_userdb_iterate_init(struct dlua_script *script, struct auth_reques
        int ret;
 
        actx->pool = pool;
+       actx->ctx.auth_request = req;
+       actx->ctx.callback = callback;
+       actx->ctx.context = context;
 
        lua_getglobal(script->L, AUTH_LUA_USERDB_ITERATE);
        if (!lua_isfunction(script->L, -1)) {
@@ -763,10 +766,6 @@ auth_lua_call_userdb_iterate_init(struct dlua_script *script, struct auth_reques
        lua_gc(script->L, LUA_GCCOLLECT, 0);
        i_assert(lua_gettop(script->L) == 0);
 
-       actx->ctx.auth_request = req;
-       actx->ctx.callback = callback;
-       actx->ctx.context = context;
-
        return &actx->ctx;
 }