This was observed in a SpectrumScale storage with CentOS.
Vim warns of a read only file, for a file with mode 0000 despite GPFS ACL via NFSv4 ACLs grants full access.
(This came up due to the fact that the storage does not seem to set Unix permission on files that inherited permissions when they were created via CIFS, but only ACLs).
Vim determines actual status of writability.
Python's f.writeable() is able to determine the status correctly, so I assume the information is more or less trivially there.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2020 16:13:17) Included patches: 1-207, 209-629
CentOS Linux release 7.9.2009 (Core)
TERM=xterm-256color
zsh 5.0.2 (x86_64-redhat-linux-gnu)
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The ACL methods are generally system specific. It probably requires some configure check, code changes, using a library, etc. Not trivial.
I have now also written this small C program, which is also able to tell the difference correctly:
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if(access(argv[1], W_OK) == 0) {
printf("%s writeable\n", argv[1]);
return 0;
} else {
printf("%s not writeable\n", argv[1]);
return 1;
}
}
I don't understand why systems don't provide the correct mode bits, so
that it's not up to each invididual application to implement the ACL
stuff.
In principle I agree with you, and I have asked our system partner to file that as an issue with IBM. However, there are situation that cannot be modeled with mode bits, e.g. multiple user based permissions, so I have kind of settled with this a s a "nice-to-have" from IBM, not not a deal breaker. Funny think is that mode bits ARE set when explicitly setting the permissions via CIFS instead of inheriting them, but that is completely OT.
Anyway, thinking about it, the question is probably what the read-only warning from vim is really supposed to mean. Since there is :w!, it cannot be meant es "you definitely cannot write here!" anyway, right? In the minimum interpretation is is just "there is no write bit for you, are you sure you are supposed to write here?" (which would be especially relevant for root).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This is true for Posix ACL, but apparently not for NFSv4 ACL, which this is about.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
I would have second the motion. I (and my researchers) see this behavior on NSFv4 file systems as well (ours is AcLOnly and not mixed with Posix. Under it all is GPFS).
It flags a file as read only, require a ! to bypass. But is really false. Nano edits files without complaint.
Other VIM nuances related to ACLs
mmeditacl does not create the flag (and it uses the default editor. In my case VIM)—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
It is annoying. It trips up other Linux utils and tools as well to be fair. cp will warn and still copy the file unless you use the --preserve=xattr flag
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()