From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ioannis Kappas Newsgroups: gmane.emacs.bugs Subject: bug#51773: 28.0.60; Issue writing files over WebDAV on MS-Windows Date: Thu, 11 Nov 2021 19:22:16 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9473"; mail-complaints-to="usenet@ciao.gmane.io" To: 51773@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 20:25:02 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlFgz-0002J5-VP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 20:25:01 +0100 Original-Received: from localhost ([::1]:48548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlFgy-0006yI-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 14:25:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlFf7-0004kc-VS for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:23:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlFf5-0006Kp-Ax for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:23:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlFf5-0001UG-3K for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 14:23:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Ioannis Kappas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 19:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51773 X-GNU-PR-Package: emacs Original-Received: via spool by 51773-submit@debbugs.gnu.org id=B51773.16366585545623 (code B ref 51773); Thu, 11 Nov 2021 19:23:03 +0000 Original-Received: (at 51773) by debbugs.gnu.org; 11 Nov 2021 19:22:34 +0000 Original-Received: from localhost ([127.0.0.1]:42307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlFec-0001Sd-GB for submit@debbugs.gnu.org; Thu, 11 Nov 2021 14:22:34 -0500 Original-Received: from mail-ot1-f43.google.com ([209.85.210.43]:36588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlFea-0001SR-VY for 51773@debbugs.gnu.org; Thu, 11 Nov 2021 14:22:33 -0500 Original-Received: by mail-ot1-f43.google.com with SMTP id w6-20020a9d77c6000000b0055e804fa524so10380246otl.3 for <51773@debbugs.gnu.org>; Thu, 11 Nov 2021 11:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Y1rDcnHDgxQnFe4u6DbHaSlGEH00P8eWamq0LxWmqTk=; b=gaXg/3uuIrOK65SiHQ/QfUwLAVOV26B6i2bFF6ycxUsxnFxplTuuvudTeTleB5St/k nKj+9HUCb+Mc7Qtv4O/7Oi8sdSxi5x6CTKPtFKDwIiQhrv2rSPUd4W/emPt1GZThz7vu K1ZZ0ExD6RlSeV+0WjZgFaq5C8sw0ZjQ8qcHtSklxNWwjPUytGx76CbyaR7vKRLILUlb rcfjOXUmTKQ9lyO6w9/vOoLl58vkwK3ruh7GK6REcW3MIDdoQBNeoM1Yg3bg+ucExLN6 IDDmNv1+Ay41OmV/aRymTTHJ+xGDOG+5Lnjy/t7ZsTOU+TU+p17VDXqaTiAp1fAVQDQP gEcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Y1rDcnHDgxQnFe4u6DbHaSlGEH00P8eWamq0LxWmqTk=; b=36l28dMtMxRiDZ4+YNVKP3HAcn6zTFRhrJonx20oL9HOArVIADxdGOP9nPe9y+ztVP +TV9pWKHKXRh2cOc6x/EXFS5IbT0xer8UfE5vPtROdjsvzFKpcivY7SQlGfOxgUA+ERP C0Ohy1s1hnXYnr85WcZAsWPPbmIMlY18EnuuJdK0mcdaTaoxoTL9aCqnfrTBqcztsGsD z2pf9v5b21zUmkWV3pCp16W/esVjDNs1uY2+KaZtnHOgEsl13lNXU/UBqDH1M0jsPP/x +Le+38eeuSvne5VrGkqBlv65pP3513Er6CUGeB7Sov1/fTDujbxfqzynAmk36G8AUYPt PuMg== X-Gm-Message-State: AOAM531ZUSK09pc06cP+uMYHATa0XbGX/+P8TgseAo0cu+wCpA8BI1Q4 M5vUeKS20id4CSR1eQLIcp/hBzAE+xTJmadUkU60h80E9vE= X-Google-Smtp-Source: ABdhPJwOIH3OgKOVUYKHpVP0Mm4SJMtevsI4EHGxaBp4RcnNmAsmCQYtu+5qZYGW0Ga8xCTVlDBX3Cvx14LAHrBsy8Y= X-Received: by 2002:a05:6830:442a:: with SMTP id q42mr1639402otv.385.1636658547253; Thu, 11 Nov 2021 11:22:27 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219678 Archived-At: 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