mirror of https://github.com/CIRCL/PyCIRCLean
Prevent following arbitrarily nested symlinks
parent
d7280a8535
commit
41abe7e5d6
|
@ -737,7 +737,9 @@ class KittenGroomerFileCheck(KittenGroomerBase):
|
||||||
if os.path.isdir(full_path):
|
if os.path.isdir(full_path):
|
||||||
queue.append(full_path)
|
queue.append(full_path)
|
||||||
queue += self.list_files_dirs(full_path)
|
queue += self.list_files_dirs(full_path)
|
||||||
elif os.path.isfile(full_path):
|
elif os.path.isfile(full_path, follow_symlinks=False):
|
||||||
|
queue.append(full_path)
|
||||||
|
elif os.path.islink(full_path):
|
||||||
queue.append(full_path)
|
queue.append(full_path)
|
||||||
return queue
|
return queue
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,10 @@ def get_filename(sample_file):
|
||||||
return os.path.basename(sample_file.path)
|
return os.path.basename(sample_file.path)
|
||||||
|
|
||||||
|
|
||||||
|
@fixture(scope='module')
|
||||||
|
def src_dir_path(tmpdir_factory):
|
||||||
|
return tmpdir_factory.mktemp('src').strpath
|
||||||
|
|
||||||
@fixture(scope='module')
|
@fixture(scope='module')
|
||||||
def dest_dir_path(tmpdir_factory):
|
def dest_dir_path(tmpdir_factory):
|
||||||
return tmpdir_factory.mktemp('dest').strpath
|
return tmpdir_factory.mktemp('dest').strpath
|
||||||
|
|
Loading…
Reference in New Issue