]> mj.ucw.cz Git - pciutils.git/commit
windows: Fix setting permissions in grant_process_token_dacl_permissions()
authorPali Rohár <pali@kernel.org>
Wed, 14 Jun 2023 15:43:21 +0000 (17:43 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 18 Feb 2024 14:48:29 +0000 (15:48 +0100)
commit668b22f9427bc81743e4980a962840c8e2dccd0e
treed3b868e2a112bac88eedb017394ab5b04cc499a4
parentd1f3b5cf8f13370fd21583b91cf406ad789530e6
windows: Fix setting permissions in grant_process_token_dacl_permissions()

Rewrite function to always add a new allow granting permissions at first
position in DACL. Normally all deny permissions are before allow
permissions, so previously allow permission could have been overridden by
explicit deny permission. With this change, our newly added allow
permission override any possible deny permission and always grant access
for asked process user.

Also properly handle automatic inheritance model which is in use since
Windows 2000 and handle also special case when DACL is not present which
gives allow access to everyone.
lib/win32-helpers.c