On Mon Sep 26 20:25:30 2022 +0000, Joel Holdsworth wrote:
Hi Zebediah - thanks for taking a look. I don't mind narrowinging the commit series down. This patch set is mainly trying to get these attribute flags working:
- `FILE_ATTRIBUTE_HIDDEN`
- `FILE_ATTRIBUTE_SYSTEM`
- `FILE_ATTRIBUTE_READONLY` (to a lesser extent - because this is
already quite well represented by UNIX access permissions) The trouble is that while we want to seamlessly integrate with the underlying filesystems, the availability of different methods varies between operating systems and filesystems. This version of the patch set offers three strategies, and I found a two more possible methods that should be added today ([1](https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html) [2](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/n...) ). The code attempts to store the flags by all available methods at once for a given file, and ORs the flags together from any available source, in the hopes we can deliver the most complete coverage to the user. However, because there is no fallback method, it is currenly not possible to guaruantee that the attributes will always be stored and retrieved correctly in all scenaries. If we only include the first four patches, the patch set will only support storage in Samba-formatted Extended File Attributes. If we unmark the associated test cases as `todo_wine`, the test will break on certain operating systems or certain mount flag choices. There is no support for Extended Attributes on FreeBSD or NetBSD, for example, and the MacOS Extended Atrribute APIs differ from the Linux ones. One approach is to fall back to using a `.dosattributes` directory when no other storage method is available, and store the attributes in files inside there. However, I didn't want to implement this functionality before having a conversation with the Wine project developers. I have been in conversation with @ehoover in the last couple of days concerning his work on Junction Points, which is a related topic to DOS attributes, and also causes issues for Msys2 in its own right. His strategy is to store the required metadata in a [`.REPARSE_POINT` hidden directory](https://github.com/wine-staging/wine-staging/blob/master/patches/ntdll-Junct...). There is also the storage of [NT extended-attribute (EA)](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntif...) values to consider, when we move toward a non-stub implementation of this feature. Perhaps it would be preferable to produce a design that can be encompass all these issues. Do we need to resolve this design question here and now? Or can we just proceed with Linux-only Extended Attributes in the short term? I think it would be good if we could get some feedback from the project maintainers on these questions. Do you have any thoughts?
@jhol I believe that @zfigura's suggestion to just merge the first four patches is in-line with what AJ has previously said. If I had to summarize his comments, I would say that they are to: 1. move the code out of ports and into file (already done) 2. submit the initial request for the support of one key platform (Linux, first four patches) 3. make sure the "key platform" support is extensible (already done) 4. submit additional requests for each additional platform, one at a time
If you want to add a "fallback" behavior (which I think is reasonable), then I would suggest that that be treated as an "additional platform" after you have the initial support in place. Others might have a different opinion.