aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2020-05-23 08:50:22 +0300
committerEli Zaretskii2020-05-23 08:50:22 +0300
commita10254dd46da920d14dd990714d0f21fd508d07d (patch)
tree118e90a8102d3439dc0d65de9a8d24b76fa8a0f5 /src
parentc0aa2f2abf732ddb9d1f393c5989b14e047d63d7 (diff)
downloademacs-a10254dd46da920d14dd990714d0f21fd508d07d.tar.gz
emacs-a10254dd46da920d14dd990714d0f21fd508d07d.zip
Fix accessing files on networked drives on MS-Windows
* src/w32.c (acl_get_file): Set errno to ENOTSUP if get_file_security returns ERROR_NOT_SUPPORTED. (Bug#41463)
Diffstat (limited to 'src')
-rw-r--r--src/w32.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/w32.c b/src/w32.c
index 62c53fd7711..78e75f0937e 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6398,7 +6398,15 @@ acl_get_file (const char *fname, acl_type_t type)
6398 if (!get_file_security (fname, si, psd, sd_len, &sd_len)) 6398 if (!get_file_security (fname, si, psd, sd_len, &sd_len))
6399 { 6399 {
6400 xfree (psd); 6400 xfree (psd);
6401 errno = EIO; 6401 err = GetLastError ();
6402 if (err == ERROR_NOT_SUPPORTED)
6403 errno = ENOTSUP;
6404 else if (err == ERROR_FILE_NOT_FOUND
6405 || err == ERROR_PATH_NOT_FOUND
6406 || err == ERROR_INVALID_NAME)
6407 errno = ENOENT;
6408 else
6409 errno = EIO;
6402 psd = NULL; 6410 psd = NULL;
6403 } 6411 }
6404 } 6412 }
@@ -6409,6 +6417,8 @@ acl_get_file (const char *fname, acl_type_t type)
6409 be encoded in the current ANSI codepage. */ 6417 be encoded in the current ANSI codepage. */
6410 || err == ERROR_INVALID_NAME) 6418 || err == ERROR_INVALID_NAME)
6411 errno = ENOENT; 6419 errno = ENOENT;
6420 else if (err == ERROR_NOT_SUPPORTED)
6421 errno = ENOTSUP;
6412 else 6422 else
6413 errno = EIO; 6423 errno = EIO;
6414 } 6424 }