public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: ls/stat on OneDrive causes download of files
Date: Fri, 8 Mar 2024 13:52:20 +0100	[thread overview]
Message-ID: <a5ed70b0-8ac4-453f-b5cf-ce8f77f6bdf7@towo.net> (raw)
In-Reply-To: <ZerqWzAr3b_mpork@calimero.vinschen.de>



Am 08.03.2024 um 11:37 schrieb Corinna Vinschen via Cygwin:
> Hi Jeffrey,
>
> On Mar  6 13:55, Jeffrey Altman via Cygwin wrote:
>> On 3/6/2024 12:19 PM, Corinna Vinschen via Cygwin wrote:
>>> We can add an explicit call to
>>>
>>>     RtlSetProcessPlaceholderCompatibilityMode (PHCM_EXPOSE_PLACEHOLDERS);
>>> [...]
>> Files and directories that are placeholders should have either the
>> FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS or FILE_ATTRIBUTE_RECALL_ON_OPEN file
>> attributes set. When these attributes are set, applications and mini filters
>> are advised not to "read" or "open" the files or directories unless they
>> absolutely need to because doing so will cause the placeholder to be
>> replaced by an object containing the actual data which might take a long
>> time to fetch,
> Yesterday I stumbled over a certain NtCreateFile flag:
>
>    FILE_OPEN_NO_RECALL (0x00400000)
>
>      Instructs any filters that perform offline storage or virtualization
>      to not recall the contents of the file as a result of this open.
>
> MS-CIFS described it like this:
>
>    FILE_OPEN_NO_RECALL
>    0x00400000
>
>      In a hierarchical storage management environment, this option
>      requests that the file SHOULD NOT be recalled from tertiary storage
>      such as tape. A file recall can take up to several minutes in a
>      hierarchical storage management environment. The clients can specify
>      this option to avoid such delays.
>
> This sounds like we could simply add this flag to all NtOpenFile
> used for path conversion or stat-like calls, without having to care
> for any file attributes specificially.
>
> Does that make sense?
Sounds good, without even studying the other details...
I speculate some more handling would still be needed to avoid executable
detection via magic tags.

  reply	other threads:[~2024-03-08 12:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  0:54 Marcin Wisnicki
2024-03-06 13:22 ` Corinna Vinschen
2024-03-06 13:28   ` Corinna Vinschen
2024-03-06 13:54     ` Brian Inglis
2024-03-06 17:19       ` Corinna Vinschen
2024-03-06 18:55         ` Jeffrey Altman
2024-03-06 19:14           ` Corinna Vinschen
2024-03-07  9:06           ` Corinna Vinschen
2024-03-08 10:37           ` Corinna Vinschen
2024-03-08 12:52             ` Thomas Wolff [this message]
2024-03-08 13:15               ` Jeffrey Altman
2024-03-08 13:56                 ` Corinna Vinschen
2024-03-08 22:21                   ` Corinna Vinschen
2024-03-08 22:26                     ` Marcin Wisnicki
2024-03-09 20:29                       ` Marcin Wisnicki
2024-03-11 17:04                         ` Corinna Vinschen
2024-03-06 19:00         ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5ed70b0-8ac4-453f-b5cf-ce8f77f6bdf7@towo.net \
    --to=towo@towo.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).