From: Simon McVittie Date: Fri, 24 Jun 2022 11:15:14 +0000 (+0100) Subject: doc: avoid Python injection if filenames contain quotes X-Git-Tag: dbus-1.15.0~32^2~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e6e2370e9e154c596c4c531046e1fe79ee2cca11;p=thirdparty%2Fdbus.git doc: avoid Python injection if filenames contain quotes Signed-off-by: Simon McVittie --- diff --git a/doc/Makefile.am b/doc/Makefile.am index 5fe9b1909..315c93495 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -224,6 +224,7 @@ clean-local: rm -f *.1.html rm -f doxygen.stamp +EXTRA_DIST += list-doc-source.py EXTRA_DIST += maintainer-upload-docs.sh EXTRA_DIST += meson.build EXTRA_DIST += meson_post_install.py diff --git a/doc/list-doc-source.py b/doc/list-doc-source.py new file mode 100644 index 000000000..2ed442ca7 --- /dev/null +++ b/doc/list-doc-source.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +# Copyright © 2019-2020 Salamandar +# Copyright 2022 Collabora Ltd. +# SPDX-License-Identifier: MIT + +import glob +import sys + +print('\n'.join(glob.glob(sys.argv[1] + '/*.[ch]'))) diff --git a/doc/meson.build b/doc/meson.build index f7184791d..3b97f4bd8 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -176,9 +176,10 @@ if doxygen.found() dbus_srcs = run_command( python, - '-c', - '''from glob import glob;print('\n'.join(glob('@0@/*.[ch]')))'''.format(meson.project_source_root() / 'dbus'), - check: true).stdout().strip().split('\n') + files('list-doc-source.py'), + meson.project_source_root() / 'dbus', + check: true + ).stdout().strip().split('\n') dbus_srcs += dbus_arch_deps_h doxygen_tgt = custom_target('doxygen',