Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 6.10
Sv translation
languageru

Файл /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml содержит настройки справочника и базу cигнатур, c помощью которых определяется тип файлов при распаковке архивов и вложений.

Параметр

Описание и примеры настройки

FilenameCharsetsЕсли кодировка имени файла отличается от стандартной (ANSI, UTF), то файл будет обрабатываться как соответствующий кодировкам, указанным в данном параметре. Несколько значений перечисляются через запятую; Система будет последовательно пытаться обработать файл в перечисленных кодировках, пока не найдет похожую. Значения по умолчанию – UTF-8,cp1251,cp866

MinFileSizeInBytes

Минимальный размер файла (в байтах), подлежащего распаковке. Это ограничение позволяет увеличить производительность Системы, за счет отказа от распаковки небольших файлов. Значение по умолчанию – 10

MaxTextPlainSizeInKbВерхняя граница размера файла, сигнатура которого не определена. При превышении порогового значения файл автоматически считается бинарным и не отправляется на анализ в iw_cas. Значение по умолчанию – 25600

SpeedInKBs

Предположительная скорость работы экстрактора, в Кб/с, в расчете на 1 ГГц частоты процессора. Значение по умолчанию – 100

TimeoutInSec

Время ожидания (в секундах) до завершения обработки файла. Значение по умолчанию – 1800

UseLogЛогирование экстрактора. Значение по умолчанию – false

Если общие значения параметров TimeoutInSec и MinFileSizeInBytes не подходят для каких-либо типов файлов, включите эти параметры в секции для нужных типов файлов с другими значениями.

Остальные секции содержат сигнатуры, при помощи которых детектируются типы файлов, находящиеся во вложениях и архивах. Секции имеют следующий набор параметров:

Параметр

Описание и примеры настройки

Extension

Расширение файла архива. Необязательный параметр, необходим для корректной работы некоторых архиваторов, которые требуют наличия правильного расширения входных файлов 
Пример 
Ext = arj

Name

Имя формата. Используется для точного определения имени формата при распаковке файла. 
Для определения/уточнения формата может включать также список имен: 
"defaultname, name1(code1), name2(code2)" 
В этом случае формат определяется на основании кода (codeN), присвоенного файлу при распаковке. Например, если распаковка завершается с кодом code1, то считается, что файл имеет формат name1. Список имен может также включать имя по умолчанию (defaultname), которое будет присваиваться в случаях, когда код не присвоен: 
Пример 1 (одно имя формата) 
text/xml 

Пример 2 (список имен формата) 
"application/arj, UNKNOWN(9), text/encrypted(4)" 
По умолчанию формат файла определяется как application/arj. Если формат архива не удается определить, ему присваивается имя UNKNOWN. Для зашифрованного архива используется имя форматаtext/encrypted

Signature

Сигнатура формата, которая представляет собой «образцовую» последовательность значений (байтов) с начальным смещением и масками. Эта последовательность необходима для однозначного определения формата файлов по их содержимому 
Сигнатура может включать до 16 триад вида: 
[OFFSET]:BYTE_VALUE/[MASK] 
Допускается также и строковая сигнатура, например, "BZh", для BZIP2. Эта сигнатура означает указанную последовательность байтов от смещения 0. Поиск строковых сигнатур выполняется без учета регистра символов. 
Параметр OFFSET является необязательным. Для первого байта этот параметр по умолчанию равен 0, для всех последующих – увеличивается на единицу. Смещение можно задать с символом «?» – поиск образца в первых N байтах файла. Например, для поиска образца в первых 500 байтах файла, нужно задать смещение '500?'. 
Параметр MASK, также является необязательным и равен 0xFF по умолчанию. 
Пример (сигнатура заголовка WAV-формата): 
Sign = "'RIFF', 0x8: 'WAVEfmt'" 
Начиная от смещения 0, расположена последовательность 'R', 'I', 'F', 'F', далее от смещения 8 должно следовать 'W', 'A', 'V', 'E', 'f', 'm', 't'

Comment

Комментарий с пояснениями. Например, указание используемой версии архиватора: 
Comment = "bzip2 v. 1.0.x"

Command

Строка команды для извлечения файлов. Например, 
Extract = "/usr/bin/bzip2 -f -dc ${SRC} > ${OUTDIR}/${SRC}" 
где ${OUTDIR} – каталог, в который будет распакован архив, а ${SRC} – имя файла, который нужно распаковать

ExcludeFromContext

Если параметр включен (On), то распаковка объекта выполняется, но информация об архиваторе не добавляется в XML-контекст объекта. Это позволяет не отображать в контексте объекта фиктивные контейнеры типа MS-TNEF. По умолчанию параметр отключен (Off)

CaseInsensitive

Учет регистра символов при обработке файла. Значение по умолчанию – false

CreateTags

Извлечение метаинформации из файла. Значение по умолчанию – true

ArchiveРегламентирует вид извлеченной информации. При значении true - файлы. При значении false - данные.
PIRegexp

Содержит описание сигнатуры PIRE для детектирования формата файла. Может быть указан несколько раз в пределах одного Extractor. Имеет атрибуты:

  • assurance - достоверность определения формата файла этой сигнатурой,
  • offset - смещение, на котором нужно начинать поиск этой сигнатуры,
  • max_length - длина проверяемого участка,
  • case_sensitive - включение значимости регистра букв в описании сигнатуры.
DetectableByRegexp

Может использоваться для отключения детектирования формата с помощью PIRE (для него будут использоваться сигнатуры из Signature).

OpenFifoRetryTimeout
Таймаут между попытками открыть fifo очередь
OpenFifoRetryCount
Количество попыток открыть fifo очередь
ResultCharset
Указывает кодировку извлеченного экстрактором текста
NeedProcess
Нужно ли файлы с указанным mime-типом отправлять на анализ.


Sv translation
languageen

The /opt/iw/tm5/etc/config-perm/bookworm/extractors.xml file contains directory settings and signatures base which define file types when unpacking archives and enclosures.

Parameter

Description

FilenameCharsetsIf file name encoding differs from the standard one (ANSI, UTF) then the filename processes as corresponding to encodings listed in this setting. Several values are listed comma separated; the System sequentially tries process the filename in listed encodings while it finds a matched one. Default value is UTF-8,cp1251,cp866

MinFileSizeInBytes

Minimum file size (in bytes) subjected to unpacking. This limit lets increase the System performance due to refusing of small files unpacking. Default value is 10

MaxTextPlainSizeInKbMaximum size of file, which signature is not defined. Exceeding the threshold value file is automatically considered to be binary and is not sent to iw_cas.
Default value is 25600

SpeedInKBs

Proposed extractor’s operation speed, in Kb/s, per 1 GHz of the processor. Default value is 100

TimeoutInSec

Awaiting time (in seconds) till file processing ends. Default value is 1800

UseLogLogging extractor. Default value is false

If the general values of TimeoutInSec and MinFileSizeInBytes settings are not appropriated for some file types then enable these parameters in sections of needed file types with other values.

Other sections define signatures used for detection of types of files from archives and enclosures. Each section contains the same set of parameters:

Parameter

Description

Extension

Extension of archive files. Optional  parameter which is needed for correct operation of some archiving utilities requiring correct extensions of incoming files

Example:

Ext = arj

Name

Format name. Used for exact detection of format name when file unpacking.

To define detection/detailing of format the setting can include a list of names:

"defaultname, name1(code1), name2(code2)"

In this case the format can be defined basing on the code (codeN) assigned to the file when unpacking. For example if the unpacking is ended with code1 code that the file is considered as having name1 format. The list of names can include default name (defaultname) which will be assigned when the code is not  assigned:

Example 1 (one format name)

text/xml

 

Example 2 (list of format names)

"application/arj, UNKNOWN(9), text/encrypted(4)"

the file format is defined as application/arj. Two others for specific cases are: unknown format (UNKNOWN), encrypted format (text/encrypted)

Signature

Format signature which is «standard» sequence of values (bytes) with initial displacement and masks. This sequence is needed for unambiguous definition of files format by the content of those files.

The signature can include up to 16 triades of the following view:

[OFFSET]:BYTE_VALUE/[MASK]

There can be string signature like "BZh" for BZIP2. This signature means specified bytes sequence from 0 displacement. The search of string signatures is performed except for upper/lowercase distinction.

The OFFSET setting is optional. By default it equals 0 for the first byte and increases by 1 for each later one. The displacement can be specified using «?» symbol  – searching of the  pattern in first N bytes of a file. For example to search pattern in first 500 bytes you should specify '500?' displacement.

The MASK setting is optional and equals to 0xFF by default.

Example (signature of a heading of WAV format):

Sign = "'RIFF', 0x8: 'WAVEfmt'"

Starting from 0 displacement there is a sequence 'R', 'I', 'F', 'F', then from 8 displacement there should be 'W', 'A', 'V', 'E', 'f', 'm', 't'

Comment

The explanation commentary, for example, indicating the version of archiving utility:

Comment = "bzip2 v. 1.0.x"

Command

Command string for file extracting, for example,

Extract = "/usr/bin/bzip2 -f -dc ${SRC} > ${OUTDIR}/${SRC}"

where ${OUTDIR} is a catalogue where to the archive will be extracted and ${SRC} is a name of file to unpack

ExcludeFromContext

If the parameter is enabled (On) then the file is unpacked but information on archiving utility is not added to object’s XML-context. This lets to let out the fictional containers like MS-TNEF from object’s context. By default the parameter is disabled (Off)

CaseInsensitive

Indicates whether the symbol register will be taken into account in file processing or not. Default value is false

CreateTags

Indicates if there is an extracting of the metadata from the file when proceeding by TM extractors.

ArchiveRegulates the kind of retrieved information. When true - files. When false - data.
PIRegexp

Contains a description of PIRE signature for file format detection. Can be specified several times withing the same Extractor. Includes the following attributes:

  • assurance - the accuracy of detecting file format with this signature
  • offset - offset where to start searching for the signature
  • max_length - the length of the section to be checked
  • case_sensitive - enables case sensitivity in the signature description
DetectableByRegexp
Allows you to disable format detection by means of PIRE (instead, signatures from Signature will be used).
OpenFifoRetryTimeout
Timeout during few attempts to open fifo queue
OpenFifoRetryCount
Number of attempts to open fifo queue
ResultCharset
Specifies the code of extracted text
NeedProcess
If the files with mime type specified should be sent for analysis