1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00
libvirt/scripts
Daniel Henrique Barboza 33ddfaf4e6 scripts/check-aclrules.py: check ACL for domain_driver.c ACL callers
This script works under two specific conditions. For each opened file,
search for all functions that has ACL calls and store them, and see
if there is a vir*DriverPtr struct declared in it. For each implementation
found, check if there is an ACL verification inside it, and error out if
none was found. The script also supports the concept of stub, where another
function takes the responsibility for the ACL call instead of the
original API.

Unfortunately this is not enough to cover the new scenario we have now,
with domain_driver.c containing helper functions that execute the ACL
calls. The script does not store state between files because, until now,
it wasn't needed to - APIs and stubs and vir*DriverPtr declarations were
always in the same file. Also, the script will not check for ACL in functions
that does not belong to a vir*DriverPtr interface. What we have now in
domain_driver.c breaks both assumptions: the functions are in a different
file, and there is no vir*DriverPtr being implemented in the file that
uses these functions.

This patch changes check-aclrules.py to accomodate this scenario. The helpers
that have ACL checks are stored beforehand in aclFuncHelpers, allowing other
files to use them to recognize a stub situation. In case the current file
being analyzed is domain_driver.c itself, we'll do a manual check using
aclFuncHelpers to verify that these functions indeed have ACL checks.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2021-02-17 15:56:53 -03:00
..
apibuild.py tests: Add simple test for virDomainMigrateCheckNotLocal 2020-09-04 10:20:49 +02:00
augeas-gentest.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
check-aclperms.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
check-aclrules.py scripts/check-aclrules.py: check ACL for domain_driver.c ACL callers 2021-02-17 15:56:53 -03:00
check-driverimpls.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
check-drivername.py libvirt: add stateShutdownPrepare/stateShutdownWait to drivers 2020-09-07 09:33:58 +03:00
check-file-access.py meson: tests: add file access test setup 2020-08-03 09:27:06 +02:00
check-remote-protocol.py scripts: ignore whitespace in pdwtags output 2020-12-02 10:30:01 +00:00
check-symfile.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
check-symsorting.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
cocci-macro-file.h scripts: introduce a macro file for coccinelle 2019-10-21 12:51:54 +02:00
dtrace2systemtap.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
esx_vi_generator.py esx: separate header and source file generation 2020-09-23 13:23:18 +02:00
genaclperms.py docs: rewrite polkit docs generator in Python 2019-12-20 14:23:40 +00:00
genpolkit.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
gensystemtap.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
group-qemu-caps.py scripts: Actually print filename of offending file 2021-01-15 15:26:16 +01:00
header-ifdef.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
hvsupport.py docs: xsl: Unify stylability of main container element 2020-11-16 14:04:04 +01:00
hyperv_wmi_generator.py hyperv: enable use of g_autoptr for the rest of the CIM/WMI classes 2021-01-22 14:04:24 -05:00
meson-dist.py meson: generate and distribute spec files and AUTHORS 2020-08-03 09:27:06 +02:00
meson-gen-authors.py AUTHORS: Convert to reStructuredText 2020-09-02 13:20:03 +02:00
meson-gen-def.py meson: scripts: introduce meson-gen-def.py script 2020-08-03 09:27:04 +02:00
meson-gen-sym.py meson: scripts: introduce meson-gen-sym.py script 2020-08-03 09:27:04 +02:00
meson-install-dirs.py meson: src: install empty directories 2020-08-03 09:27:05 +02:00
meson-install-symlink.py scripts: Fix meson-install-symlink.py overwriting existing links 2020-08-05 13:11:16 +02:00
meson-install-web.py meson: add rule to build and install only web documentation 2020-08-03 09:27:06 +02:00
meson-python.sh meson: add runutf8 env vars and meson-python.sh script 2020-08-03 09:27:00 +02:00
meson-timestamp.py meson: docs: generate docs timestamp 2020-08-03 09:27:06 +02:00
meson.build scripts: meson-html-gen: Remove 2020-10-19 12:40:51 +02:00
mock-noinline.py src: add G_GNUC_NO_INLINE annotations for mocked symbols 2020-08-04 17:58:08 +01:00
prohibit-duplicate-header.py build: only support python3 binary 2019-12-04 13:13:01 +00:00
test-wrap-argv.py scripts: Actually print filename of offending file 2021-01-15 15:26:16 +01:00