From: Cedric Blancher <cedric.blancher@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin tools to read/write NTFS alternate data streams?
Date: Fri, 12 Jan 2024 10:24:35 +0100 [thread overview]
Message-ID: <CALXu0Ud_iskmHcu_ATU0AJGjFfE-PFyUNwQriLRo6F5dgxPxMA@mail.gmail.com> (raw)
In-Reply-To: <ZaAaIs7D7DMO4qw3@calimero.vinschen.de>
On Thu, 11 Jan 2024 at 17:41, Corinna Vinschen via Cygwin
<cygwin@cygwin.com> wrote:
>
> On Jan 11 15:00, Martin Wege via Cygwin wrote:
> > On Mon, Jan 8, 2024 at 3:11 PM Corinna Vinschen via Cygwin
> > <cygwin@cygwin.com> wrote:
> > so this is IMO OK.
>
> Yeah, but...
>
> It's not just an open flag, it requires extending functionality of other
> APIs and, for full support, tools, see
> https://docs.oracle.com/cd/E19253-01/816-5175/6mbba7f02/.
>
> It's also rather weird to call alternate data streams "extended
> attributes", because that's just a small part of streams and it's
> already supported via the Linux functions getxattr(2) and friends, see
> https://man7.org/linux/man-pages/man2/getxattr.2.html
>
> > > Apart from that, this sounds like a nice idea for Cygwin 3.6,
> > > provided somebody implements it, https://cygwin.com/acronyms/#SHTDI
> > >
> > > Assuming we can live without actually having a subdir and just
> > > allowing to open and create a file with the O_XATTR flag, it might be
> > > pretty simple to implement. The path handling code would just have to
> > > drop the colon from the list of characters converted to the private-use
> > > Unicode area.
> > >
> > > Implementing the subdir is a bit more complicated, especially when
> > > taking opendir/readdir of that virtual subdir into account, but it
> > > would certainly be doable.
> >
> > How do other OSes implement the O_XATTR subdir?
>
> IDK. But there are a few points we have to keep in mind from the
> Solaris man page:
>
> - Given fd is an open file descriptor,
>
> openat(fd, ".", O_RDONLY|O_XATTR);
>
> opens the virtual subdir containing the ADS of a file. It's the
> only valid way to open the virtual dir. That's a bit of a relief
> because it simplifies handling this in openat(2).
>
> openat(fd, "foo", ...|O_XATTR);
>
> allows to create or open an ADS for an open file fd.
>
> - unlinkat, renameat, fstatat, fchownat, futimesat and fdopendir need to
> be made ADS-aware. They only work on ADS if the fd arg already
> resolves to an ADS, or if fd is the virtual ADS dir of a file and
> (except in case of fdopendir) the path argument is the name of an
> existing ADS.
>
> - pathconf needs to support a new flag XATTR_ENABLED.
>
> This can be made to work given the current fhandler framework in Cygwin,
> but again, https://cygwin.com/acronyms/#SHTDI
bash has cd -@ to enter a virtual dir with XATTRs, if O_XATTR works.
Aside from that, I volunteer with testing of O_XATTR, on demand with 1
or 2 students too.
Still working on testing the cool and new SEEK_HOLE support in Cygwin
Ced
--
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
next prev parent reply other threads:[~2024-01-12 9:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 3:55 Martin Wege
2023-12-01 9:51 ` Corinna Vinschen
2023-12-18 17:47 ` Martin Wege
2024-01-08 14:09 ` Corinna Vinschen
2024-01-11 14:00 ` Martin Wege
2024-01-11 16:41 ` Corinna Vinschen
2024-01-12 5:15 ` Roland Mainz
2024-01-12 9:24 ` Cedric Blancher [this message]
2024-01-12 9:57 ` Corinna Vinschen
2024-01-12 5:03 ` Roland Mainz
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=CALXu0Ud_iskmHcu_ATU0AJGjFfE-PFyUNwQriLRo6F5dgxPxMA@mail.gmail.com \
--to=cedric.blancher@gmail.com \
--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).