dissect.target.plugins.os.unix.locate.gnulocate

Module Contents

Classes

GNULocateFile

GNU locate file parser.

GNULocatePlugin

GNU locate plugin.

Attributes

dissect.target.plugins.os.unix.locate.gnulocate.gnulocate_def = Multiline-String
Show Value
"""
#define MAGIC 0x004c4f43415445303200             /* b'/x00LOCATE02/x00' */

struct entry {
    int8 offset;
    char path[];
}
"""
dissect.target.plugins.os.unix.locate.gnulocate.GNULocateRecord
dissect.target.plugins.os.unix.locate.gnulocate.c_gnulocate
class dissect.target.plugins.os.unix.locate.gnulocate.GNULocateFile(fh: BinaryIO)

GNU locate file parser.

Multiple formats exist for the locatedb file. This class only supports the most recent version LOCATE02.

The file is encoded with front compression (incremental encoding). This is a form of compression which takes a number of characters of the previous encoded entries. Entries are separated with a null byte.

References

fh
count = 0
previous_path = ''
__iter__() collections.abc.Iterator[GNULocateFile]
class dissect.target.plugins.os.unix.locate.gnulocate.GNULocatePlugin(target: dissect.target.target.Target)

Bases: dissect.target.plugins.os.unix.locate.locate.BaseLocatePlugin

GNU locate plugin.

__namespace__ = 'gnulocate'

Defines the plugin namespace.

path = '/var/cache/locate/locatedb'
check_compatible() None

Perform a compatibility check with the target.

This function should return None if the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

locate() collections.abc.Iterator[GNULocateRecord]

Yield file and directory names from GNU findutils’ locatedb file.

References