GNU bug report logs - #51773
28.0.60; Issue writing files over WebDAV on MS-Windows

Previous Next

Package: emacs;

Reported by: Ioannis Kappas <ioannis.kappas <at> gmail.com>

Date: Thu, 11 Nov 2021 19:17:02 UTC

Severity: normal

Found in version 28.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51773 in the body.
You can then email your comments to 51773 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51773; Package emacs. (Thu, 11 Nov 2021 19:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ioannis Kappas <ioannis.kappas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Nov 2021 19:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ioannis Kappas <ioannis.kappas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.60; Issue writing files over WebDAV on MS-Windows
Date: Thu, 11 Nov 2021 19:16:19 +0000
Hi,

There appears to be an issue with Emacs on MS-Windows that prevents
writing to files over WebDAV with the following error message:

  Getting ACLs: Input/output error, //<server>//...//<filename>

To reproduce

1. C-x f to a UNC path or mapped drive pointing to a WebDAV server.
2. Insert some text and C-x s to save the file.
3. The above error message appears, the buffer is still marked as
modified and any other attempt to save the file fails with the same
error.

Analysis to follow.

In GNU Emacs 28.0.60 (build 2, x86_64-w64-mingw32)
 of 2021-11-11
Repository revision: 6dae01ad6da1bcbced062c0d46a6759c7a0570e4
Repository branch: emacs-28
Windowing system distributor 'Microsoft Corp.', version 10




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51773; Package emacs. (Thu, 11 Nov 2021 19:23:03 GMT) Full text and rfc822 format available.

Message #8 received at 51773 <at> debbugs.gnu.org (full text, mbox):

From: Ioannis Kappas <ioannis.kappas <at> gmail.com>
To: 51773 <at> debbugs.gnu.org
Subject: 28.0.60; Issue writing files over WebDAV on MS-Windows
Date: Thu, 11 Nov 2021 19:22:16 +0000
The issue is caused by the ERROR_INVALID_FUNCTION error returned by
w32.c:get_security_info()'s GetSecurityInfo win32 fn when it is called
on a WebDAV file.

The caller w32.c:acl_get_file() doesn't know how to handle the error
and returns it as is, causing the write to fail and the error message to be
displayed.

Looking at the caller, it does have a clause to return ENOSUP for WebDAV files:

  else if (err == ERROR_NOT_SUPPORTED
   /* ERROR_ACCESS_DENIED is what we get for a volume
      mounted by WebDAV, which evidently doesn't
      support ACLs.  */
   || err == ERROR_ACCESS_DENIED)
    errno = ENOTSUP;


Thus a solution, which I have tested it to work, is to add the
ERROR_INVALID_FUNCTION to the predicate

diff --git a/src/w32.c b/src/w32.c
index 9fe698d28d..0e066b12e7 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6614,10 +6614,11 @@ acl_get_file (const char *fname, acl_type_t type)
     || err == ERROR_INVALID_NAME)
      errno = ENOENT;
    else if (err == ERROR_NOT_SUPPORTED
-    /* ERROR_ACCESS_DENIED is what we get for a volume
-       mounted by WebDAV, which evidently doesn't
-       support ACLs.  */
-    || err == ERROR_ACCESS_DENIED)
+    /* ERROR_ACCESS_DENIED or ERROR_INVALID_FUNCTION is
+       what we get for a volume mounted by WebDAV,
+       which evidently doesn't support ACLs.  */
+    || err == ERROR_ACCESS_DENIED
+    || err == ERROR_INVALID_FUNCTION)
      errno = ENOTSUP;
    else
      errno = EIO;

Please let me know if you require more info.

Thanks




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 11 Nov 2021 19:44:02 GMT) Full text and rfc822 format available.

Notification sent to Ioannis Kappas <ioannis.kappas <at> gmail.com>:
bug acknowledged by developer. (Thu, 11 Nov 2021 19:44:02 GMT) Full text and rfc822 format available.

Message #13 received at 51773-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ioannis Kappas <ioannis.kappas <at> gmail.com>
Cc: 51773-done <at> debbugs.gnu.org
Subject: Re: bug#51773: 28.0.60; Issue writing files over WebDAV on MS-Windows
Date: Thu, 11 Nov 2021 21:43:26 +0200
> From: Ioannis Kappas <ioannis.kappas <at> gmail.com>
> Date: Thu, 11 Nov 2021 19:22:16 +0000
> 
> Thus a solution, which I have tested it to work, is to add the
> ERROR_INVALID_FUNCTION to the predicate
> 
> diff --git a/src/w32.c b/src/w32.c
> index 9fe698d28d..0e066b12e7 100644
> --- a/src/w32.c
> +++ b/src/w32.c
> @@ -6614,10 +6614,11 @@ acl_get_file (const char *fname, acl_type_t type)
>      || err == ERROR_INVALID_NAME)
>       errno = ENOENT;
>     else if (err == ERROR_NOT_SUPPORTED
> -    /* ERROR_ACCESS_DENIED is what we get for a volume
> -       mounted by WebDAV, which evidently doesn't
> -       support ACLs.  */
> -    || err == ERROR_ACCESS_DENIED)
> +    /* ERROR_ACCESS_DENIED or ERROR_INVALID_FUNCTION is
> +       what we get for a volume mounted by WebDAV,
> +       which evidently doesn't support ACLs.  */
> +    || err == ERROR_ACCESS_DENIED
> +    || err == ERROR_INVALID_FUNCTION)
>       errno = ENOTSUP;
>     else
>       errno = EIO;
> 
> Please let me know if you require more info.

Thanks, installed on the emacs-28 branch (there was one more place
which needed the same fix, a few lines above the one you fixed).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Dec 2021 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.