Since we're a forensics program, make sure we only read unless we know the user REALLY wants to write.

This commit is contained in:
Mike Auty
2016-05-22 19:21:24 +01:00
parent 16bed2aa94
commit 9faa13820a
+3 -1
View File
@@ -62,7 +62,9 @@ class FileLayer(interfaces.layers.DataLayerInterface):
def __init__(self, context, config_path, name, filename):
interfaces.layers.DataLayerInterface.__init__(self, context, config_path, name)
self._file = open(filename, "r+b")
# FIXME: Add "+" to the mode once we've determined whether write mode is enabled
mode = "rb"
self._file = open(filename, mode)
self._size = os.path.getsize(filename)
@property