static int dict_query_save_results(struct auth_request *auth_request, struct db_dict_value_iter *iter) { const char *key, *value, *error; while (db_dict_value_iter_next(iter, &key, &value)) { if (value != NULL) auth_request_set_userdb_field(auth_request, key, value); } if (db_dict_value_iter_deinit(&iter, &error) < 0) { auth_request_log_error(auth_request, AUTH_SUBSYS_DB, "%s", error); return -1; } return 0; }
static int dict_query_save_results(struct auth_request *auth_request, struct dict_connection *conn, const char *result) { struct db_dict_value_iter *iter; const char *key, *value, *error; iter = db_dict_value_iter_init(conn, result); while (db_dict_value_iter_next(iter, &key, &value)) { if (value != NULL) { auth_request_set_field(auth_request, key, value, conn->set.default_pass_scheme); } } if (db_dict_value_iter_deinit(&iter, &error) < 0) { auth_request_log_error(auth_request, "dict", "Value '%s' not in valid %s format: %s", result, conn->set.value_format, error); return -1; } return 0; }