GNU bug report logs - #61035
[PATCH] cp: improve help regarding ACLs

Previous Next

Package: coreutils;

Reported by: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>

Date: Tue, 24 Jan 2023 08:45:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

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 61035 in the body.
You can then email your comments to 61035 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-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 24 Jan 2023 08:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 24 Jan 2023 08:45:02 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: bug-coreutils <at> gnu.org
Cc: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
Subject: [PATCH] cp: improve help regarding ACLs
Date: Tue, 24 Jan 2023 09:42:30 +0100
Improve help to clarify ACL handling
---
 src/cp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/cp.c b/src/cp.c
index 016ae8988..73ffd34e9 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -239,6 +239,11 @@ When --reflink[=always] is specified, perform a lightweight copy, where the\n\
 data blocks are copied only when modified.  If this is not possible the copy\n\
 fails, or if --reflink=auto is specified, fall back to a standard copy.\n\
 Use --reflink=never to ensure a standard copy is performed.\n\
+"), stdout);
+      fputs (_("\
+\n\
+--preserve=mode also copies ACLs but only if the destination filesystem\n\
+supports ACLs of the same type (i.e. no Posix <> NFSv4 ACLs conversion)\n\
 "), stdout);
       emit_backup_suffix_note ();
       fputs (_("\
-- 
2.39.0





Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 24 Jan 2023 23:25:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>, 61035 <at> debbugs.gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Tue, 24 Jan 2023 15:23:55 -0800
On 1/24/23 00:42, Ondrej Valousek wrote:

> +"), stdout);
> +      fputs (_("\
> +\n\
> +--preserve=mode also copies ACLs but only if the destination filesystem\n\
> +supports ACLs of the same type (i.e. no Posix <> NFSv4 ACLs conversion)\n\

Doesn't the earlier part of the --help output already say something 
similar when it mentions xattr? It's OK for the --help output to be 
somewhat terse, with longwinded details in the manual.





Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 08:27:02 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, "61035 <at> debbugs.gnu.org"
 <61035 <at> debbugs.gnu.org>
Subject: RE: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 08:26:27 +0000
> Doesn't the earlier part of the --help output already say something similar when it mentions xattr? It's OK for the --help output to be somewhat terse, with > longwinded details in the manual.

No, I do not see a word there about ACLs


Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 09:12:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 01:11:24 -0800
On 2023-01-25 00:26, Ondrej Valousek wrote:
>> Doesn't the earlier part of the --help output already say something similar when it mentions xattr? It's OK for the --help output to be somewhat terse, with > longwinded details in the manual.
> No, I do not see a word there about ACLs

For --preserve[=ATTR_LIST] the usage message says "preserve the 
specified attributes (default: mode,ownership,timestamps), if possible 
additional attributes: context, links, xattr,"





Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 09:26:02 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, "61035 <at> debbugs.gnu.org"
 <61035 <at> debbugs.gnu.org>
Subject: RE: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 09:24:54 +0000
> For --preserve[=ATTR_LIST] the usage message says "preserve the specified attributes (default: mode,ownership,timestamps), if possible additional 
> attributes: context, links, xattr,"

Yes, but that's nothing about ACLs. The aim of this patch is to clarify the current behavior which might not be obvious

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 20:44:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 12:42:57 -0800
On 2023-01-25 01:24, Ondrej Valousek wrote:
>> For --preserve[=ATTR_LIST] the usage message says "preserve the specified attributes (default: mode,ownership,timestamps), if possible additional
>> attributes: context, links, xattr,"
> Yes, but that's nothing about ACLs. The aim of this patch is to clarify the current behavior which might not be obvious

So how about if we change "context, links, xattr" to "ACLs, context, 
links, xattr"? That's shorter.




Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 21:57:02 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, "61035 <at> debbugs.gnu.org"
 <61035 <at> debbugs.gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 21:56:05 +0000
[Message part 1 (text/plain, inline)]
But it's not the same meaning. What I am trying to explain here is that

Cp -p (or cp --preserve=mode) also retains ACLs. This fact is not obvious, but yet it's happening

Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg>

________________________________
Od: Paul Eggert <eggert <at> cs.ucla.edu>
Odesláno: středa 25. ledna 2023 21:43
Komu: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>; 61035 <at> debbugs.gnu.org <61035 <at> debbugs.gnu.org>
Předmět: Re: bug#61035: [PATCH] cp: improve help regarding ACLs

On 2023-01-25 01:24, Ondrej Valousek wrote:
>> For --preserve[=ATTR_LIST] the usage message says "preserve the specified attributes (default: mode,ownership,timestamps), if possible additional
>> attributes: context, links, xattr,"
> Yes, but that's nothing about ACLs. The aim of this patch is to clarify the current behavior which might not be obvious

So how about if we change "context, links, xattr" to "ACLs, context,
links, xattr"? That's shorter.

[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 25 Jan 2023 22:02:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 25 Jan 2023 14:01:45 -0800
On 2023-01-25 13:56, Ondrej Valousek wrote:
> But it's not the same meaning. What I am trying to explain here is that
> 
> Cp -p (or cp --preserve=mode) also retains ACLs. This fact is not obvious, but yet it's happening

Then I'm afraid I don't understand. In what sense do ACLs differ from 
xattr here?




Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Sun, 29 Jan 2023 11:07:01 GMT) Full text and rfc822 format available.

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

From: Kamil Dudka <kdudka <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>, bug-coreutils <at> gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Sun, 29 Jan 2023 12:06:07 +0100
On Wednesday, January 25, 2023 11:01:45 PM CET Paul Eggert wrote:
> On 2023-01-25 13:56, Ondrej Valousek wrote:
> > But it's not the same meaning. What I am trying to explain here is that
> > 
> > Cp -p (or cp --preserve=mode) also retains ACLs. This fact is not obvious, but yet it's happening
> 
> Then I'm afraid I don't understand. In what sense do ACLs differ from 
> xattr here?

As I understand it, `cp -p` now preserves ACLs but not xattr (unlike `cp -a`).

Kamil






Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Sun, 29 Jan 2023 11:07:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Sun, 29 Jan 2023 22:05:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Kamil Dudka <kdudka <at> redhat.com>
Cc: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>, bug-coreutils <at> gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Sun, 29 Jan 2023 14:04:22 -0800
On 2023-01-29 03:06, Kamil Dudka wrote:
> On Wednesday, January 25, 2023 11:01:45 PM CET Paul Eggert wrote:
>> On 2023-01-25 13:56, Ondrej Valousek wrote:
>>> But it's not the same meaning. What I am trying to explain here is that
>>>
>>> Cp -p (or cp --preserve=mode) also retains ACLs. This fact is not obvious, but yet it's happening
>> Then I'm afraid I don't understand. In what sense do ACLs differ from
>> xattr here?
> As I understand it, `cp -p` now preserves ACLs but not xattr (unlike `cp -a`).

OK, the light is slowly dawning on me. Though I'm still confused.

Why are ACLs treated differently from extended attributes? Shouldn't the 
two be treated the same (assuming they're both supported)?

In other words, what's the underlying model and motivation here? It's 
more important to document that, than to document little pieces of it.




Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Sun, 29 Jan 2023 22:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Mon, 30 Jan 2023 07:41:01 GMT) Full text and rfc822 format available.

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

From: Kamil Dudka <kdudka <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>, bug-coreutils <at> gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Mon, 30 Jan 2023 08:40:04 +0100
On Sunday, January 29, 2023 11:04:22 PM CET Paul Eggert wrote:
> On 2023-01-29 03:06, Kamil Dudka wrote:
> > On Wednesday, January 25, 2023 11:01:45 PM CET Paul Eggert wrote:
> >> On 2023-01-25 13:56, Ondrej Valousek wrote:
> >>> But it's not the same meaning. What I am trying to explain here is that
> >>>
> >>> Cp -p (or cp --preserve=mode) also retains ACLs. This fact is not obvious, but yet it's happening
> >> Then I'm afraid I don't understand. In what sense do ACLs differ from
> >> xattr here?
> > As I understand it, `cp -p` now preserves ACLs but not xattr (unlike `cp -a`).
> 
> OK, the light is slowly dawning on me. Though I'm still confused.
> 
> Why are ACLs treated differently from extended attributes? Shouldn't the 
> two be treated the same (assuming they're both supported)?
> 
> In other words, what's the underlying model and motivation here? It's 
> more important to document that, than to document little pieces of it.

I cannot speak for Ondrej.  My understanding is that ACLs can be seen as
extension over permission bits whereas the extended attributes can store
pretty much anything.  I am not saying which approach is (more) correct
though.

Kamil






Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Mon, 30 Jan 2023 07:41:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Mon, 30 Jan 2023 08:20:01 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: Kamil Dudka <kdudka <at> redhat.com>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>,
 "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: RE: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Mon, 30 Jan 2023 08:19:20 +0000
> My understanding is that ACLs can be seen as extension over permission bits whereas the extended attributes can store pretty 
> much anything.  I am not saying which approach is (more) correct though.

Exactly my point as well. 
Also, it is not correct to say "cp -p now preserves ACL" because it ALWAYS preserved Posix ACLs - it was only not obvious from the man page.
Hence my fix there.
The only change we introduced recently is that "cp -p" not only preserves Posix ACLs but also NFSv4 ACLs.





Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Mon, 30 Jan 2023 08:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 31 Jan 2023 18:47:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 Kamil Dudka <kdudka <at> redhat.com>
Cc: "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>,
 "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Tue, 31 Jan 2023 10:46:28 -0800
[Message part 1 (text/plain, inline)]
OK, how about the attached more-ambitious patch instead? I hope it helps 
clarify this confusing area.
[0001-cp-improve-preserve-usage-doc.patch (text/x-patch, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 31 Jan 2023 18:47:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 31 Jan 2023 21:25:01 GMT) Full text and rfc822 format available.

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

From: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Kamil Dudka <kdudka <at> redhat.com>
Cc: "61035 <at> debbugs.gnu.org" <61035 <at> debbugs.gnu.org>,
 "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Tue, 31 Jan 2023 21:23:48 +0000
[Message part 1 (text/plain, inline)]
Yes, that's nice, thanks!
However I think it would be also fair to mention that ACLs will not be converted/translated (I.e. no posix to nfsv4 or vice versa). We are not that clever.

Up to you really.

Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg>
________________________________
From: Paul Eggert <eggert <at> cs.ucla.edu>
Sent: Tuesday, January 31, 2023 7:46:28 PM
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>; Kamil Dudka <kdudka <at> redhat.com>
Cc: 61035 <at> debbugs.gnu.org <61035 <at> debbugs.gnu.org>; bug-coreutils <at> gnu.org <bug-coreutils <at> gnu.org>
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs

OK, how about the attached more-ambitious patch instead? I hope it helps
clarify this confusing area.
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Tue, 31 Jan 2023 21:30:02 GMT) Full text and rfc822 format available.

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 31 Jan 2023 21:58:02 GMT) Full text and rfc822 format available.

Notification sent to Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>:
bug acknowledged by developer. (Tue, 31 Jan 2023 21:58:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 Kamil Dudka <kdudka <at> redhat.com>
Cc: 61035-done <at> debbugs.gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Tue, 31 Jan 2023 13:56:54 -0800
[Message part 1 (text/plain, inline)]
On 1/31/23 13:23, Ondrej Valousek wrote:
> Yes, that's nice, thanks!
> However I think it would be also fair to mention that ACLs will not be converted/translated (I.e. no posix to nfsv4 or vice versa). We are not that clever.

OK, I installed that along with the attached further patch to talk about 
ACL translation (this can be in the manual rather than the man page as 
it's reasonably obscure).
[0001-doc-document-preserve-mode-better.patch (text/x-patch, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#61035; Package coreutils. (Wed, 01 Feb 2023 07:31:01 GMT) Full text and rfc822 format available.

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

From: Kamil Dudka <kdudka <at> redhat.com>
To: Ondrej Valousek <ondrej.valousek.xm <at> renesas.com>,
 Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 61035-done <at> debbugs.gnu.org
Subject: Re: bug#61035: [PATCH] cp: improve help regarding ACLs
Date: Wed, 01 Feb 2023 08:30:18 +0100
On Tuesday, January 31, 2023 10:56:54 PM CET Paul Eggert wrote:
> On 1/31/23 13:23, Ondrej Valousek wrote:
> > Yes, that's nice, thanks!
> > However I think it would be also fair to mention that ACLs will not be converted/translated (I.e. no posix to nfsv4 or vice versa). We are not that clever.
> 
> OK, I installed that along with the attached further patch to talk about 
> ACL translation (this can be in the manual rather than the man page as 
> it's reasonably obscure).

Looks good to me.  Thank you both!

Kamil






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Mar 2023 12:24:07 GMT) Full text and rfc822 format available.

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

Previous Next


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