mountmgr: Avoid unnecessary permission prompts on macOS 10.15 and newer.
commit33c8a4254715c5f3b71b23fc657c6ba5eee94ce9
authorBrendan Shanks <bshanks@codeweavers.com>
Tue, 6 Oct 2020 20:36:28 +0000 (6 13:36 -0700)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 13 Oct 2020 20:37:16 +0000 (13 22:37 +0200)
tree460baebca9e2c5ad50b14ee2d640b369997aa25b
parentf7edc328184c4755c81dec5372b3ae5ac7b8c5df
mountmgr: Avoid unnecessary permission prompts on macOS 10.15 and newer.

On macOS 10.15 and newer, trying to open the device node of a removable
drive will trigger an "<app> would like to access files on a removable
volume" permission prompt, even if the user doesn't have permissions
to access the device node (which is almost always the case).

Check the value of access() (recommended by Apple for this purpose)
before opening devices.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/mountmgr.sys/device.c
dlls/mountmgr.sys/diskarb.c