From fa2feb1b5cb35d94fe24ead838660868b3e46c65 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Tue, 22 Nov 2022 12:17:05 +0000 Subject: [PATCH] pyodbc: write .odbcinst.init file in /tmp/ (#9034) This is in contrast to writing it in /etc/, which the fuzzer does not have permission to in the bots. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51308 Signed-off-by: David Korczynski Signed-off-by: David Korczynski --- projects/pyodbc/fuzz_curs_exec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/pyodbc/fuzz_curs_exec.py b/projects/pyodbc/fuzz_curs_exec.py index 324c6d082..7f9ad1536 100644 --- a/projects/pyodbc/fuzz_curs_exec.py +++ b/projects/pyodbc/fuzz_curs_exec.py @@ -48,9 +48,10 @@ def TestOneInput(data): def main(): # Write the odbcinst.ini file dir_path = os.path.dirname(os.path.realpath(__file__)) - with open("/etc/odbcinst.ini", "w") as f: + with open("/tmp/odbcinst.ini", "w") as f: f.write("[FUZZ]\n") f.write("Driver=%s/fuzzodbc.so\n"%(dir_path)) + os.environ['ODBCSYSINI'] = '/tmp/' atheris.instrument_all() atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)