https://bugs.winehq.org/show_bug.cgi?id=50036
--- Comment #10 from Erich E. Hoover erich.e.hoover@gmail.com --- Created attachment 68679 --> https://bugs.winehq.org/attachment.cgi?id=68679 Open a reparse point, but ignore it if the reparse tag is 'WINE'
(In reply to Zebediah Figura from comment #7)
... It's worth pointing out that we really could use tests for what happens when you call various file functions with FILE_FLAG_OPEN_REPARSE_POINT. The trick is that we need to make sure that even if a system32 file is opened therewith, all operations should treat it as if it wasn't.
I actually have a small number of tests for this flag already with some todos. But anyway, as a quick proof of concept I've attached a patch (requires the staging patches) that shows how this can be done*. This is not a full implementation, just demonstrating that FILE_FLAG_OPEN_REPARSE can be used to open regular reparse points and still ignore "special" ones. The key bit goes into server/fd.c (along with minor changes to decode_symlink): === if ((options & FILE_OPEN_REPARSE_POINT) && !(flags & O_CREAT)) { ULONG reparse_tag = 0;
decode_symlink( name, &reparse_tag, NULL); if (reparse_tag != *(uint32_t *)"WINE" ) flags |= O_SYMLINK; } === If I can make some time I'll try to put together a proper implementation so that I can test having system dll symlinks with a real prefix.
* This is rather hacky (futimens has issues with symlinks, so a very basic utimensat call is thrown in its place) and it also includes a fix for converting signed 32-bit time_t ( https://source.winehq.org/patches/data/196350 ) to fix some test issues.