Re: Possible bug in qcopy-acl.c

2023-09-01 Thread Ondrej Valousek
about few more syscalls because in most cases we copy files w/o acls. Ondrej Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg> From: Paul Eggert Sent: Friday, September 1, 2023 8:20:12 PM To: Ondrej Valousek Cc: Gnulib bugs Subject: Re: Possib

Possible bug in qcopy-acl.c

2023-09-01 Thread Ondrej Valousek
Hi all, I think we might have a bug in qcopy-acl.c as currently, when we copy files from say NFSv4 to ext4 filesystems, then "cp -p" produces warning that it could not preserve permissions. That makes a sense, but perhaps we should issue "attr_copy_file()" only if the file has a non-trivial

Re: [PATCH] fix NFSv4 acl detection on F39

2023-05-15 Thread Ondrej Valousek
ysg> From: Paul Eggert Sent: Monday, May 15, 2023 11:32:00 PM To: Ondrej Valousek Cc: Gnulib bugs Subject: Re: [PATCH] fix NFSv4 acl detection on F39 On 2023-05-15 12:43, Ondrej Valousek wrote: > You feed listxattr() with a buffer sized like trivial_NFS4

RE: [PATCH] fix NFSv4 acl detection on F39

2023-05-15 Thread Ondrej Valousek
ike trivial_NFS4_attr_buf - that just does not seem to be correct right? That trivial_NFS4_attr_buf serves smth completely different. -Original Message- From: Paul Eggert Sent: Montag, 15. Mai 2023 19:17 To: Ondrej Valousek Cc: Gnulib bugs Subject: Re: [PATCH] fix NFSv4 acl detection on F39 On 2

RE: [PATCH] fix NFSv4 acl detection on F39

2023-05-15 Thread Ondrej Valousek
als the presence of the actual ACLs, so our code thinks that POSIX acls are present instead (which makes no sense on NFSv4). Ondrej -Original Message- From: Paul Eggert Sent: pátek 12. května 2023 21:27 To: Bruno Haible Cc: bug-gnulib@gnu.org; Ondrej Valousek Subject: Re: [PATCH] fix NFSv4

RE: [PATCH] fix NFSv4 acl detection on F39

2023-05-04 Thread Ondrej Valousek
and simple to read patch. -Original Message- From: Paul Eggert Sent: Donnerstag, 4. Mai 2023 00:54 To: Ondrej Valousek ; bug-gnulib@gnu.org Subject: Re: [PATCH] fix NFSv4 acl detection on F39 On 5/2/23 22:44, Ondrej Valousek wrote: > What's the reason for doing that? > I wanted t

Re: [PATCH] fix NFSv4 acl detection on F39

2023-05-02 Thread Ondrej Valousek
What's the reason for doing that? I wanted to save syscalls, not to create more. Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg> From: Paul Eggert Sent: Tuesday, May 2, 2023 11:32:39 PM To: Ondrej Valousek ; bug-gnulib@gnu.org Subject: Re: [PATC

[PATCH] fix NFSv4 acl detection on F39

2023-05-01 Thread Ondrej Valousek
Sending the other proposed patch fixing the NFSv4 acl detection on Fedora39. It's bit longer, but I think should be better. Please review. --- lib/file-has-acl.c | 60 +- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git

Re: [PATCH] fix NFSv4 acl detection on F39

2023-04-29 Thread Ondrej Valousek
? Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg> From: Paul Eggert Sent: Saturday, April 29, 2023 8:35:06 AM To: Ondrej Valousek Cc: bug-gnulib@gnu.org Subject: Re: [PATCH] fix NFSv4 acl detection on F39 On 2023-04-28 13:38, Ondrej Valousek wrote: >

[PATCH] fix NFSv4 acl detection on F39

2023-04-28 Thread Ondrej Valousek
On newer systems like Fedora 39, we can't distinguish from the getxattr(,XATTR_NAME_POSIX_ACL_*,,) which filesystem we are on. The call return either success or ENODATA. It never returns ENOTSUP as previously. Is it intentional? This unfortunately means that we have to check for NFSv4 ACLs all

[PATCH] Improve comments for [q]set-acl.c

2023-01-17 Thread Ondrej Valousek
Hi Bruno, sorry, this patch should be fine now. It improve comments for both functions --- lib/qset-acl.c | 14 +++--- lib/set-acl.c | 18 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/qset-acl.c b/lib/qset-acl.c index c3442d060f..aecab8ead3

Improve support for ACLs in coreutils (ls & chmod) following the Solaris way

2023-01-16 Thread Ondrej Valousek
Hi, As per our conversation with Bruno I was thinking if it would make a sense to extend support of ACLs in gnulib/coreutils, mainly covering "ls" (1st stage) and "chmod" (2nd stage) with the goal to have the ACLs better understandable for end users. For "ls" we would: - Introduce a new

[PATCH] better explain functions [q]set-acl.c

2023-01-16 Thread Ondrej Valousek
Improve comments for both functions --- lib/qset-acl.c | 16 +--- lib/set-acl.c | 13 +++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/qset-acl.c b/lib/qset-acl.c index c3442d060f..0ae026f031 100644 --- a/lib/qset-acl.c +++ b/lib/qset-acl.c @@

[PATCH] better explain functions [q]set-acl.c

2023-01-16 Thread Ondrej Valousek
Improve comments for both functions --- lib/qset-acl.c | 16 +--- lib/set-acl.c | 13 +++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/qset-acl.c b/lib/qset-acl.c index c3442d060f..0ae026f031 100644 --- a/lib/qset-acl.c +++ b/lib/qset-acl.c @@

Re: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-14 Thread Ondrej Valousek
Haible Sent: Saturday, January 14, 2023 8:55:25 AM To: Ondrej Valousek Cc: bug-gnulib@gnu.org Subject: Re: [PATCH] Use xattr (Linux) in qcopy-acl.c > Why this conversation (+the whole one from yesterday) is missing from the > bug-gnulib mail archives? https://jpn01.safelinks.protection

Re: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-13 Thread Ondrej Valousek
Why this conversation (+the whole one from yesterday) is missing from the bug-gnulib mail archives? Zasláno z Outlooku pro Android<https://aka.ms/AAb9ysg> From: Paul Eggert Sent: Saturday, January 14, 2023 2:52:27 AM To: Bruno Haible ; Ondrej Valouse

RE: ACL complexity

2023-01-13 Thread Ondrej Valousek
Still, this wouln't go to Gnulib, but mostly to coreutils, right?

RE: ACL complexity

2023-01-13 Thread Ondrej Valousek
> More generally, I find the semantics and the syntax of ACLs on most systems > to be more demanding than what the average command-line user can grok. Completely agree here, especially true for so-called posix draft ACLs. > While for random features of the OS this would just be a nuisance that

RE: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-13 Thread Ondrej Valousek
, Ondrej -Original Message- From: Bruno Haible Sent: pátek 13. ledna 2023 9:10 To: bug-gnulib@gnu.org; Ondrej Valousek Subject: Re: [PATCH] Use xattr (Linux) in qcopy-acl.c This part > Also, protect against unsafe use of a configure option value. is needed when the user does ./config

RE: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-11 Thread Ondrej Valousek
2023 20:07 To: Bruno Haible ; bug-gnulib@gnu.org; Ondrej Valousek Subject: Re: [PATCH] Use xattr (Linux) in qcopy-acl.c On 2023-01-05 02:32, Bruno Haible wrote: > Yes, this is OK. I can work on the linker dependencies shortly after > your patch is in. Basically it consists in compiling a t

[PATCH] better explain functions [q]set-acl.c

2023-01-09 Thread Ondrej Valousek
Improve comments for both functions --- lib/qset-acl.c | 16 +--- lib/set-acl.c | 13 +++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/qset-acl.c b/lib/qset-acl.c index c3442d060f..0ae026f031 100644 --- a/lib/qset-acl.c +++ b/lib/qset-acl.c @@

RE: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-05 Thread Ondrej Valousek
@gnu.org; Ondrej Valousek Subject: Re: [PATCH] Use xattr (Linux) in qcopy-acl.c Ondrej Valousek wrote: > Why don't we solve the linker problem with the "--as-needed" option? This > will make linker clever enough not to link libraries that are not needed. '--as-needed' is a can of

Re: [PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-04 Thread Ondrej Valousek
> Perhaps you can fix this by fixing the Link sections of the relevant modules to use $(LIB_HAS_ACL) instead of $(LIB_ACL). That is, for each module where you added $(LIB_XATTR), replace its $(LIB_ACL) with $(LIB_HAS_ACL) if the only reason it needed $(LIB_ACL) was to copy attributes. Nope.

[PATCH] Use xattr (Linux) in qcopy-acl.c

2023-01-04 Thread Ondrej Valousek
Hi Bruno, Please review now. Ondrej --- lib/qcopy-acl.c | 36 ++- m4/xattr.m4 | 42 + modules/acl | 1 + modules/acl-tests | 6 +++--- modules/copy-file | 1 +

[PATCH] Use xattr (Linux) in copy-acl.c

2023-01-04 Thread Ondrej Valousek
Hi Paul/Bruno, Thanks for valuable input. I have included your suggestions in the following patch. Hope it looks fine now. Ondrej --- lib/qcopy-acl.c | 33 + m4/xattr.m4 | 45 + modules/qcopy-acl | 2 ++ 3 files

[PATCH] Use xattr (Linux) in copy-acl.c

2023-01-03 Thread Ondrej Valousek
The following patch is aiming to improve & simplify ACL handling in copy-acl.c Changes/Benefits: * we no longer try to decode ACLs, instead we just copy the whole xattr with ACLs making the code simpler and faster * side effect is support for NFSv4 acls Disadvantages: * it pulls in dependency on

RE: [PATCH] ACL handling simplification + support for NFSv4

2023-01-02 Thread Ondrej Valousek
> What happens if you try to copy ACLs from a filesystem using NFSv4 ACLs to > one using POSIXish ACLs, or vice versa? It fails, we can't do ACL conversion. > Why is this call needed? Won't a successful attr_copy_file mean that the > chmod_or_fchmod is unnecessary? I.e., can't we do the

[PATCH] ACL handling simplification + support for NFSv4

2022-12-30 Thread Ondrej Valousek
The following patch is aiming to improve & simplify ACL handling in copy-acl.c Changes/Benefits: * we no longer try to decode ACLs, instead we just copy the whole xattr with ACLs making the code simpler and faster * side effect is support for NFSv4 acls Disadvantages: * I agree the patch is

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-12-28 Thread Ondrej Valousek
Paul Eggert Sent: středa 28. prosince 2022 5:13 To: Ondrej Valousek Cc: Gnulib bugs Subject: Re: [PATCH] Basic support for checking NFSv4 ACLs in Linux Some static checking helped find an off-by-one bug that I introduced to your Gnulib patch. The bug caused file_has_acl to sometimes incorrectly re

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-12-24 Thread Ondrej Valousek
ave tested it on various ACL enabled NFSv4 servers (Linux/ Solaris/ Netapp) and it seems to work OK. Thanks, Ondrej -Original Message- From: Paul Eggert Sent: sobota 24. prosince 2022 0:32 To: Ondrej Valousek Cc: Gnulib bugs Subject: Re: [PATCH] Basic support for checking NFSv4 ACLs in Linux

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-12-02 Thread Ondrej Valousek
Hi Bruno, Thanks for the input, I think it should be OK now, please take a look. Thanks, Ondrej --- doc/acl-nfsv4.txt | 17 + lib/acl-internal.c | 95 ++ lib/acl-internal.h | 3 ++ lib/file-has-acl.c | 24 4 files changed, 135

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-12-01 Thread Ondrej Valousek
Hi Bruno, Could you review one more time? Thanks, Ondrej --- doc/acl-nfsv4.txt | 17 + lib/acl-internal.c | 95 ++ lib/acl-internal.h | 3 ++ lib/file-has-acl.c | 24 4 files changed, 135 insertions(+), 9 deletions(-) create

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-12-01 Thread Ondrej Valousek
Hi Bruno, Just sending the modified patch (fixed formatting + few suggestions from Andreas included) Does it look OK now? Thanks, Ondrej --- doc/acl-nfsv4.txt | 17 + lib/acl-internal.c | 95 ++ lib/acl-internal.h | 3 ++ lib/file-has-acl.c

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-27 Thread Ondrej Valousek
problem I mentioned earlier? I.e. currently the code pulls dependency on libacl which is not needed and I do not know how to solve it in the config/make script? Thanks, Ondrej -Original Message- From: Andreas Grünbacher Sent: pátek 25. listopadu 2022 11:17 To: Ondrej Valousek Cc: bug

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-24 Thread Ondrej Valousek
Hi GNU lib maintainers, Attaching the final version of patch introducing a basic checks for non-trivial NFSv4 style ACLs. It is substantially longer unfortunately - that's why I put most of the code to acl-internal.c where I think it should be (as similar function for AIX already exists there).

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-16 Thread Ondrej Valousek
> I'm not really sure what to do about ACE4_READ_NAMED_ATTRS and > ACE4_WRITE_NAMED_ATTRS; those are not the same as Linux extended attributes. > This will need a bit of testing against various NFSv4 servers to give > reasonable results. Can we just commit the code as-is without the extra

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-15 Thread Ondrej Valousek
> This would correspond to a mode attribute of "--rwx" according to the > above statement, Well I do not think so as the RFC also states that EVERYONE@ means literally everyone (including group and owner), so the above example would indeed return rwxrwxrwx. Anyhow, would the code I

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-15 Thread Ondrej Valousek
> * If an ALLOW entry has any mask bits set that don't correspond to the UNIX > rwx permissions, we don't have a trivial ACL. Do we really have to do this? I mean from RFC8881: " The server that supports both mode and ACL must take care to synchronize the MODE4_*USR, MODE4_*GRP, and MODE4_*OTH

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-14 Thread Ondrej Valousek
Hi Andreas/all Would you support the following version of the patch? It is substantially longer unfortunately - that's why I put most of the code to acl-internal.c where I think it should be (as similar function for AIX already exists there). The benefit of this is fairly improved robustness of

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-11 Thread Ondrej Valousek
Hi Andreas, > Historically, I've suggested taking care of these kinds of things in the > richacl project, but that effort has been shot down upstream, and that > project has been dead for a long time. I think I have complete picture now. I also think that eventually I can eventually fix

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-09 Thread Ondrej Valousek
As per suggestions from Andreas, I am attaching a simplified version of the patch implementing basic checks for non-trivial NFSv4 acls --- lib/file-has-acl.c | 24 1 file changed, 24 insertions(+) diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-11-07 Thread Ondrej Valousek
2022 20:37 To: Ondrej Valousek ; Bruno Haible ; bug-gnulib@gnu.org Cc: Andreas Gruenbacher Subject: Re: [PATCH] Basic support for checking NFSv4 ACLs in Linux On 2022-10-31 01:05, Ondrej Valousek wrote: > I do not quite understand why we are not calling acl_extended_file() > any more on

RE: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-10-31 Thread Ondrej Valousek
not quite understand why we are not calling acl_extended_file() any more on Linux. Maybe to simplify code & one less dependency? Any suggestions here? -Original Message- From: Paul Eggert Sent: neděle 30. října 2022 19:37 To: Ondrej Valousek ; Bruno Haible ; bug-gnulib@gnu.org Subje

Re: [PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-10-28 Thread Ondrej Valousek
ibrary, we just call getxattr() function directly. Does it help you to understand it now? Thanks Ondrej Získat Outlook pro Android<https://aka.ms/AAb9ysg> From: Bruno Haible Sent: Thursday, October 27, 2022 9:52:32 PM To: bug-gnulib@gnu.org Cc: Ondrej Valou

[PATCH] Basic support for checking NFSv4 ACLs in Linux

2022-10-27 Thread Ondrej Valousek
--- lib/file-has-acl.c | 24 1 file changed, 24 insertions(+) diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index e02f0626a..a6144e52e 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -32,6 +32,10 @@ #if GETXATTR_WITH_POSIX_ACLS # include # include