From 489a1bebda13ceb70d42fff7142c41362fc6ba7b Mon Sep 17 00:00:00 2001 From: kamil-certat <117654481+kamil-certat@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:09:45 +0200 Subject: [PATCH] Improve descriptions Co-authored-by: Sebastian --- CHANGELOG.md | 3 +-- intelmq/tests/lib/test_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8de554638..ff3d2ee5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,7 @@ ### Core - `intelmq.lib.utils.drop_privileges`: When IntelMQ is called as `root` and dropping the privileges to user `intelmq`, also set the non-primary groups associated with the `intelmq` user. Makes the behaviour of running intelmqctl as `root` closer to the behaviour of `sudo -u intelmq ...` (PR#2507 by Mikk Margus Möll). -- `intelmq.lib.utils.unzip`: Filter out directory entries when extracting data fixing the issue that - archives with directories causes extracting empty data for a directory entry (PR# by Kamil Mankowski). +- `intelmq.lib.utils.unzip`: Ignore directories themselves when extracting data to prevent the extraction of empty data for a directory entries (PR#2512 by Kamil Mankowski). ### Development diff --git a/intelmq/tests/lib/test_utils.py b/intelmq/tests/lib/test_utils.py index daba62996..ddb34408a 100644 --- a/intelmq/tests/lib/test_utils.py +++ b/intelmq/tests/lib/test_utils.py @@ -261,7 +261,7 @@ def test_unzip_tar_gz_return_names(self): ('foo', b'foo text\n'))) def test_unzip_tar_gz_with_subdir(self): - """ Test the unzip function with a tar gz file and return_names. """ + """ Test the unzip function with a tar gz file containing a subdirectory and return_names. Test that the directories themselves are ignored. """ filename = os.path.join(os.path.dirname(__file__), '../assets/subdir.tar.gz') with open(filename, 'rb') as fh: result = utils.unzip(fh.read(), extract_files=True, return_names=True) @@ -298,7 +298,7 @@ def test_unzip_zip_return_names(self): ('foo', b'foo text\n'))) def test_unzip_zip_with_subdir(self): - """ Test the unzip function with a zip containing a subdirectory and returning names.""" + """ Test the unzip function with a zip containing a subdirectory and returning names. Test that the directories themselves are ignored.""" filename = os.path.join(os.path.dirname(__file__), '../assets/subdir.zip') with open(filename, 'rb') as fh: result = utils.unzip(fh.read(), extract_files=True, return_names=True)