From b66fb35ffb3f6a0bdec889ba4080641001186121 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sat, 30 Jan 2021 18:24:07 +0000 Subject: [PATCH] Layers: Document the choice of mode for cached files --- volatility3/framework/layers/resources.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/volatility3/framework/layers/resources.py b/volatility3/framework/layers/resources.py index d99f7135c..63cfd9570 100644 --- a/volatility3/framework/layers/resources.py +++ b/volatility3/framework/layers/resources.py @@ -142,6 +142,8 @@ class ResourceAccessor(object): block = fp.read(block_size) cache_file.close() # Re-open the cache with a different mode + # Since we don't want people thinking they're able to save to the cache file, + # open it in read mode only and allow breakages to happen if they wanted to write curfile = open(temp_filename, mode = "rb") # Determine whether the file is a particular type of file, and if so, open it as such