From 60afeaa5d6430636bbd6e91a5b7c3a09e6facb66 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 23 Jun 2022 19:27:24 +0100 Subject: [PATCH] test: Avoid arbitrary Python injection if compiled in a path with quotes Signed-off-by: Simon McVittie --- test/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/meson.build b/test/meson.build index e1d14fec..e65c5c38 100644 --- a/test/meson.build +++ b/test/meson.build @@ -76,7 +76,9 @@ test_env.set('DBUS_TEST_UNINSTALLED', '1') xdgdir = custom_target('gen-xdgdir', command: [ - python, '-c', 'import os; os.makedirs("@0@", exist_ok=True)'.format(meson.current_build_dir() / 'XDG_RUNTIME_DIR') + python, '-c', + 'import os, sys; os.makedirs(sys.argv[1], exist_ok=True)', + meson.current_build_dir() / 'XDG_RUNTIME_DIR', ], output: 'XDG_RUNTIME_DIR' )