unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: shuguang@gmail.com, 29225@debbugs.gnu.org
Subject: bug#29225: Tramp backup-by-copying in a Converting ACL Invalid argument error on Windows 7
Date: Fri, 10 Nov 2017 15:39:39 +0100	[thread overview]
Message-ID: <874lq2kxjo.fsf@gmx.de> (raw)
In-Reply-To: <83mv3up9jq.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Nov 2017 15:06:49 +0200")

[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> I think it should return nil when acl_errno_valid returns false, and
> otherwise signal an error.  It currently calls acl_errno_valid in one
> of the two places where error could happen, but not in the other.  And
> the doc string should be amended to say that.  WDYT?

Seems to work, yes. acl_from_text returns EINVAL for wrong ACLs, so the
error would be suppressed, because acl_errno_valid returns false this case.

I've tested successfully the appended patch on GNU/Linux.

(set-file-acl "/tmp/123" "dummy")

returns nil with the applied patch, and (file-error "Converting ACL"
"Invalid argument" "/tmp/123") w/o the patch.

I cannot test on MS Windows.

I don't know whether we must extend the docstring. Summarizing probable
errors is not the default in Emacs docstrings. And the docstring does
not promise, that no error at all will happen.

If you don't object, I'll commit the patch to emacs-26. Plus minor
changes in Tramp. Maybe I'll find also the time next days, to add the
missing tests for file-acl and set-file-acl in tramp-tests.el. See the
TODO list at the end of that file.

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 384 bytes --]

diff --git a/src/fileio.c b/src/fileio.c
index cc1399e1bd..f538f12f9b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3047,7 +3047,7 @@ support.  */)
   if (STRINGP (acl_string))
     {
       acl = acl_from_text (SSDATA (acl_string));
-      if (acl == NULL)
+      if (acl == NULL && acl_errno_valid (errno))
 	{
 	  report_file_error ("Converting ACL", absname);
 	  return Qnil;

  reply	other threads:[~2017-11-10 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  8:24 bug#29225: Tramp backup-by-copying in a Converting ACL Invalid argument error on Windows 7 Shuguang Sun
2017-11-09 17:18 ` Eli Zaretskii
2017-11-10 12:41   ` Michael Albinus
2017-11-10 13:06     ` Eli Zaretskii
2017-11-10 14:39       ` Michael Albinus [this message]
2017-11-10 15:13         ` Eli Zaretskii
2017-11-12 13:21           ` Michael Albinus
2018-01-17 10:05             ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lq2kxjo.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=29225@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=shuguang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).