On Sat Feb 17 00:53:57 2024 +0000, Zebediah Figura wrote:
@zfigura so you're saying we should return `/proc/<wineserver-pid>/fd/<wineserver-fd>` from `get_handle_unix_name` server req handler? Or make FileNameInfo return `Z:\proc\self\fd\<client-fd>` itself? Not necessarily, although I don't think there's any harm in it either? I just don't see the point of trying to dereference symlinks a specific number of times, and thereby complicating the code just to add specific logic for Linux. You would be right if the app used the resolved pathname (`\\?\unix\proc\123\fd\456`) for opening *only*. This will automatically dereference the symlink, and the # of dereferences (before or after `get_handle_unix_name`) will be irrelevant.
OTOH, what if the app doesn't want to dereference (à la O\_NOFOLLOW) it at all? If you allow me to speculate, it could assume the pathname to be fully resolved, and become unhappy if it found out `\\?\unix\proc\123\fd\456` is a symlink. I don't want to speculate here. I'd rather just wait for @insn to come up with a concrete use case,[^1] along with tests.[^2] [^1]: Looks like something along CPython calling GetFileInformationHandle, but I'm not sure how this is relevant. [^2]: Standalone tests (as an MR attachment, outside winetest) should be enough. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5083#note_61567