aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Wilson <diegowilson@google.com>2020-06-25 21:27:58 +0000
committerDiego Wilson <diegowilson@google.com>2020-06-25 21:27:58 +0000
commit091ceb2bb2d4af87e3eb4ccdcfff3ad41db025ca (patch)
tree8092d81ddae8bbdfb74542f0428d30451211f1c4
parent89f7385f3b685b41d3db5a46c74abf74705bf8a9 (diff)
downloadoj-libjdwp-091ceb2bb2d4af87e3eb4ccdcfff3ad41db025ca.tar.gz
Disallow input file write access to jdigen.py
jdigen.py does not need write access to its input file. This is especially important in environments where the source is read-only. Fixes: 158693674 Test: lunch aosp_arm64 && make -j out/soong/.intermediates/external/oj-libjdwp/jdi_generated_properties/gen/jdi.java Change-Id: Ic41debc8760df2f6e9df4c959d013361d0606eae
-rw-r--r--etc/jdigen.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/jdigen.py b/etc/jdigen.py
index a5ba1a562..d8ce8afcc 100644
--- a/etc/jdigen.py
+++ b/etc/jdigen.py
@@ -51,7 +51,7 @@ public final class jdi extends ListResourceBundle {{
INSTANCE_FORMAT = '{{ "{key}", "{value}" }},\n'
VALUES = ""
-with open(args[1], 'r+') as inp:
+with open(args[1], 'r') as inp:
for l in inp.readlines():
key, value = l.split('=')
VALUES += INSTANCE_FORMAT.format(key = key.strip(), value = value.strip())