Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-13 22:03:09 +00:00

zapret-lib: call apply_arg_prefix right before instance execute

This commit is contained in:
bol-van
2026-03-02 20:21:38 +03:00
parent 03f1fc4788
commit a8a742f48c
4 changed files with 12 additions and 3 deletions

View File

@@ -265,3 +265,4 @@ v0.9.4.3
* winws2, dvtws2: ASLR
* github, linux-builder: reduce arm executable size by 20% - move to armv7+thumb
* init.d: warn if hostlist/ipset files are inside zapret2 root
* zapret-lib: do not call apply_arg_prefix in apply_execution_plan - call it right before instance execute

View File

@@ -3531,7 +3531,7 @@ Checks the [instance cutoff](#instance_cutoff) state for `desync.func_instance`
function apply_arg_prefix(desync)
```
Performs substitution of argument values from `desync.arg` that start with `%` and `#`.
Performs substitution of argument values from `desync.arg` that start with `%`, `#`, `\`.
### apply_execution_plan
@@ -3540,6 +3540,7 @@ function apply_execution_plan(desync, instance)
```
Copies the instance identification and its arguments from an [execution plan](#execution_plan) `instance` into the desync object, thereby recreating the desync state as if the `instance` were called directly by C code.
With one exception : apply_arg_prefix is not applied because args can refer a blob created by previous conditionally executed instances.
The [execution plan](#execution_plan) is provided by the C function `execution_plan()` as an array of `instance` elements.
### verdict_aggregate
@@ -3558,6 +3559,7 @@ function plan_instance_execute_preapplied(desync, verdict, instance)
```
Executes an [execution plan](#execution_plan) `instance`, taking into account the [instance cutoff](#instance_cutoff) and standard [payload](#in-profile-filters) and [range](#in-profile-filters) filters.
Calls apply_arg_prefix right before calling the instance.
Returns the aggregation of the current verdict and the `instance` verdict.
The "preapplied" version does not apply execution plan, allowing the calling code to do so.
@@ -4479,6 +4481,7 @@ function cond_lua(desync)
```
Executes a Lua code from the "cond_code" argument. The code returns condition value. Direct addressing of the desync table is possible within the code.
desync.arg is passed without called "apply_arg_prefix" : `%`, `#`, `\` remain as is without substitution because can refer blobs created by previous conditionally executed instances.
# Auxiliary programs

View File

@@ -3709,7 +3709,7 @@ function cutoff_shim_check(desync)
function apply_arg_prefix(desync)
```
Выполняет подстановку значений аргументов из desync.arg, начинающихся с `%` и `#`.
Выполняет подстановку значений аргументов из desync.arg, начинающихся с `%` и `#`, `\`.
### apply_execution_plan
@@ -3719,6 +3719,7 @@ function apply_execution_plan(desync, instance)
Копирует в desync идентификацию инстанса и его аргументы из элемента [execution plan](#execution_plan) `instance`,
тем самым воссоздает состояние desync, как если бы `instance` был вызван напрямую C кодом.
За одним исключением : apply_arg_prefix не применяется, поскольку может содержать несуществующие блоб, существование которого зависит от условного выполнения предыдущих истансов.
[execution plan](#execution_plan) выдается C функцией `execution_plan()` как массив, элементами которого являются `instance`.
### verdict_aggregate
@@ -3737,6 +3738,7 @@ function plan_instance_execute_preapplied(desync, verdict, instance)
```
Выполняет элемент [execution plan](#execution_plan) `instance` с учетом [instance cutoff](#instance_cutoff) и стандартных фильтров [payload](#внутрипрофильные-фильтры) и [range](#внутрипрофильные-фильтры).
При совпадении условий непосредственно перед вызовом выполняет apply_arg_prefix.
Возвращает агрегацию verdict и вердикта `instance`.
Вариант "preapplied" не выполняет apply_execution_plan, позволяя это сделат вызывающему коду.
@@ -4658,6 +4660,7 @@ function cond_lua(desync)
```
Выполняет Lua код из аргумента "cond_code". Код возвращает значение условия через return. Возможна прямая адресация таблицы desync.
desync.arg передаются с НЕ разименованными `%`, `#`, `\`, поскольку разименование может ссылаться на блобы, создаваемые предыдущими условно вызываемыми инстансами.
# Вспомогательные программы