Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog.bin.cpio'])
self._SkipIfPathNotExists(test_file)
self._os_path_spec = os_path_spec.OSPathSpec(location=test_file)
self._cpio_path_spec = cpio_path_spec.CPIOPathSpec(
location='/syslog', parent=self._os_path_spec)
self._file_system = cpio_file_system.CPIOFileSystem(self._resolver_context)
self._file_system.Open(self._cpio_path_spec)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._data_range_path_spec = (
data_range_path_spec.DataRangePathSpec(
range_offset=0x1c0, range_size=0x41, parent=path_spec))
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog.rc4'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._encrypted_stream_path_spec = (
encrypted_stream_path_spec.EncryptedStreamPathSpec(
encryption_method=definitions.ENCRYPTION_METHOD_RC4,
parent=path_spec))
resolver.Resolver.key_chain.SetCredential(
self._encrypted_stream_path_spec, 'key', self._RC4_KEY)
self._file_system = (
encrypted_stream_file_system.EncryptedStreamFileSystem(
self._resolver_context))
self._file_system.Open(self._encrypted_stream_path_spec)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['password.txt'])
self._SkipIfPathNotExists(test_file)
self._path_spec1 = os_path_spec.OSPathSpec(location=test_file)
test_file = self._GetTestFilePath(['another_file'])
self._SkipIfPathNotExists(test_file)
self._path_spec2 = os_path_spec.OSPathSpec(location=test_file)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['apfs.raw'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._raw_path_spec = raw_path_spec.RawPathSpec(parent=path_spec)
self._apfs_container_path_spec = (
apfs_container_path_spec.APFSContainerPathSpec(
location='/', parent=self._raw_path_spec))
self._file_system = apfs_container_file_system.APFSContainerFileSystem(
self._resolver_context)
self._file_system.Open(self._apfs_container_path_spec)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['syslog'])
self._SkipIfPathNotExists(test_file)
self._os_path_spec = os_path_spec.OSPathSpec(location=test_file)
self._data_range_path_spec = data_range_path_spec.DataRangePathSpec(
range_offset=167, range_size=1080, parent=self._os_path_spec)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
super(APFSFileTest, self).setUp()
self._resolver_context = context.Context()
test_path = self._GetTestFilePath(['apfs.raw'])
self._SkipIfPathNotExists(test_path)
test_os_path_spec = path_spec_factory.Factory.NewPathSpec(
definitions.TYPE_INDICATOR_OS, location=test_path)
test_raw_path_spec = path_spec_factory.Factory.NewPathSpec(
definitions.TYPE_INDICATOR_RAW, parent=test_os_path_spec)
self._apfs_container_path_spec = path_spec_factory.Factory.NewPathSpec(
definitions.TYPE_INDICATOR_APFS_CONTAINER, location='/apfs1',
parent=test_raw_path_spec)
def setUp(self):
"""Sets up the needed objects used throughout the test."""
self._resolver_context = context.Context()
test_file = self._GetTestFilePath(['bdetogo.raw'])
self._SkipIfPathNotExists(test_file)
path_spec = os_path_spec.OSPathSpec(location=test_file)
self._bde_path_spec = bde_path_spec.BDEPathSpec(parent=path_spec)
resolver.Resolver.key_chain.SetCredential(
self._bde_path_spec, 'password', self._BDE_PASSWORD)
self._file_system = bde_file_system.BDEFileSystem(self._resolver_context)
self._file_system.Open(self._bde_path_spec)
"""The path specification resolver."""
from __future__ import unicode_literals
from dfvfs.credentials import keychain
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.mount import manager as mount_manager
from dfvfs.path import path_spec
from dfvfs.resolver import context
class Resolver(object):
"""Path specification resolver."""
_resolver_context = context.Context()
_resolver_helpers_manager = None
key_chain = keychain.KeyChain()
@classmethod
def _GetResolverHelper(cls, type_indicator):
"""Retrieves the path specification resolver helper for the specified type.
Args:
type_indicator (str): type indicator.
Returns:
ResolverHelper: a resolver helper.
"""
if not cls._resolver_helpers_manager:
# Delay the import of the resolver helpers manager to prevent circular