*error_r = t_strdup_printf("db-lua: %s(req) failed: %s",
fn, lua_tostring(script->L, -1));
lua_pop(script->L, 1);
+ i_assert(lua_gettop(script->L) == 0);
return -1;
} else if (!lua_isnumber(script->L, -2)) {
*error_r = t_strdup_printf("db-lua: %s(req) invalid return value "
if (err != 0) {
lua_pop(script->L, 2);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
return PASSDB_RESULT_INTERNAL_FAILURE;
}
*/
lua_pop(script->L, 3);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
}
static enum userdb_result
const char *str = t_strdup(lua_tostring(script->L, -1));
lua_pop(script->L, 2);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ /* stack should be empty now */
+ i_assert(lua_gettop(script->L) == 0);
if (ret != PASSDB_RESULT_OK && ret != PASSDB_RESULT_NEXT) {
*error_r = str;
*error_r = t_strdup_printf("db-lua: %s(req, password) failed: %s",
AUTH_LUA_PASSWORD_VERIFY,
lua_tostring(script->L, -1));
+ i_assert(lua_gettop(script->L) == 0);
lua_pop(script->L, 1);
return PASSDB_RESULT_INTERNAL_FAILURE;
} else if (!lua_isnumber(script->L, -2)) {
if (err != 0) {
lua_pop(script->L, 2);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
return PASSDB_RESULT_INTERNAL_FAILURE;
}
*scheme_r = *password_r = NULL;
if (auth_lua_call_lookup(script, AUTH_LUA_PASSDB_LOOKUP, req, error_r) < 0) {
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
return PASSDB_RESULT_INTERNAL_FAILURE;
}
{
if (auth_lua_call_lookup(script, AUTH_LUA_USERDB_LOOKUP, req, error_r) < 0) {
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
return USERDB_RESULT_INTERNAL_FAILURE;
}
const char *str = t_strdup(lua_tostring(script->L, -1));
lua_pop(script->L, 2);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
if (ret != USERDB_RESULT_OK) {
*error_r = str;
lua_tostring(script->L, -1));
actx->ctx.failed = TRUE;
lua_pop(script->L, 1);
+ i_assert(lua_gettop(script->L) == 0);
return &actx->ctx;
}
actx->ctx.failed = TRUE;
lua_pop(script->L, 1);
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
return &actx->ctx;
}
}
lua_gc(script->L, LUA_GCCOLLECT, 0);
+ i_assert(lua_gettop(script->L) == 0);
actx->ctx.auth_request = req;
actx->ctx.callback = callback;