Commit fd5acd68 authored by Alexandre Julliard's avatar Alexandre Julliard

mountmgr: Move the macOS device access check to the Unix library.

parent e54f6d8f
......@@ -915,13 +915,7 @@ static BOOL get_volume_device_info( struct volume *volume )
if (!unix_device)
return FALSE;
#ifdef __APPLE__
if (access( unix_device, R_OK ))
{
WARN("Unable to open %s, not accessible\n", debugstr_a(unix_device));
return FALSE;
}
#endif
if (MOUNTMGR_CALL( check_device_access, volume->device->unix_device )) return FALSE;
if (!(name = wine_get_dos_file_name( unix_device )))
{
......
......@@ -319,6 +319,15 @@ static NTSTATUS match_unixdev( void *args )
return !stat( params->device, &st ) && st.st_rdev == params->unix_dev;
}
static NTSTATUS check_device_access( void *args )
{
#ifdef __APPLE__
const char *unix_device = args;
if (access( unix_device, R_OK )) return STATUS_ACCESS_DENIED;
#endif
return STATUS_SUCCESS;
}
static NTSTATUS detect_serial_ports( void *args )
{
const struct detect_ports_params *params = args;
......@@ -434,6 +443,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
get_volume_dos_devices,
read_volume_file,
match_unixdev,
check_device_access,
detect_serial_ports,
detect_parallel_ports,
set_shell_folder,
......
......@@ -145,6 +145,7 @@ enum mountmgr_funcs
unix_get_volume_dos_devices,
unix_read_volume_file,
unix_match_unixdev,
unix_check_device_access,
unix_detect_serial_ports,
unix_detect_parallel_ports,
unix_set_shell_folder,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment