Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OneDrive better #209

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

dscho
Copy link
Collaborator

@dscho dscho commented Mar 9, 2024

This backports f6b56ab and 2100c6e, avoiding to hydrate OneDrive files (or for that matter, other files marked as "offline", i.e. not-yet-downloaded), just for the sake of determining whether the files are to be considered executable by inspecting the first line in case it is #!/bin/sh.

This fixes #206.

Chances are high that Cygwin recalls offline files from remote
storage, even if the file is only accessed during stat(2) or
readdir(3).

To avoid this
- make sure Cygwin is placeholder-aware,
- open files in path_conv handling, as well as in stat(2)/readdir(3)
  scenarios with FILE_OPEN_NO_RECALL, and
- during symlink checking or testing for executablility, don't even
  try to open the file if one of the OFFLINE attributes is set.

Reported-by: Marcin Wisnicki <mwisnicki@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add FILE_OPEN_NO_RECALL to NtOpenFile calls trying to fetch
or write file security descriptors so as not to recall them
from offline storage inadvertently.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Mar 9, 2024
@dscho dscho marked this pull request as ready for review March 9, 2024 23:04
@dscho
Copy link
Collaborator Author

dscho commented Mar 9, 2024

@mwisnicki could I ask you to test the artifact of this PR's build (i.e. unpack the usr\bin\msys-2.0.dll from that install.zip over your MSYS2 installation's, then try ls with a OneDrive folder)?

@mwisnicki
Copy link

Works correctly. Thank you.

@dscho dscho merged commit 6f45a7c into msys2:msys2-3.4.10 Mar 23, 2024
2 checks passed
@dscho dscho deleted the better-onedrive-support-msys2 branch March 23, 2024 22:34
dscho added a commit to dscho/MSYS2-packages that referenced this pull request Mar 23, 2024
With this change, files are no longer "hydrated" (read: downloaded on
the fly) when calling `ls` _just_ to determine whether the files in
question have a `#!` line that makes them executable.

This commit brings the changes from
msys2/msys2-runtime#209 to MSYS2-packages.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/MSYS2-packages that referenced this pull request Jul 8, 2024
Looks like we haven't updated `MSYS2-packages`' `msys2-runtime-3.4`
directory in quite a while. This roll-up integrates:

- msys2/msys2-runtime#205
- msys2/msys2-runtime#209
- msys2/msys2-runtime#210
- msys2/msys2-runtime#192

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/MSYS2-packages that referenced this pull request Jul 9, 2024
Looks like we haven't updated `MSYS2-packages`' `msys2-runtime-3.4`
directory in quite a while. This roll-up integrates:

- msys2/msys2-runtime#192
- msys2/msys2-runtime#205
- msys2/msys2-runtime#209
- msys2/msys2-runtime#210
- msys2/msys2-runtime#220

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ls/stat on OneDrive causes download of files
3 participants