delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/01/12/00:15:55

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB1D9385840C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1705036554;
bh=Dtx8dgwnlX8iYxZksr3ey6A7uoNBG2todizZNYT7m9U=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=F2ObQ8pZRu4nOpCi4hBaQ0bpxyWbwUVyXSCWvyvpK+N9EfQh4bEKm2FG+bOSxd3ox
gejlJC1J2W3DstbAmo918pKfrk1CpHs3EIIKGJkUlBtSEoet99vlY0mRqNf4prHdKg
3D1K3jbkRGgOFXJE90Igoh1E1ZsB+4bmSuvCumvc=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AB953858D28
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3AB953858D28
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705036533; cv=none;
b=HwaBV7ZTmZsNzZKU/UIrlHQ71YTVIoi1dOqiV3Y2tS55d73zu737kxSYykwLb0LC42NgdUzIBrEPsZ1oiDIAix3DKLcEsypzRJ0/vx9+s6oqNQ/UjDHFfI3XuPKZ1oLWVDSuNv5trtvHKrjMos4PyfgqGUnRM6K1z56wyqhohk8=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1705036533; c=relaxed/simple;
bh=nlzupR+AWroTHVS5BOB7ZQGzyNwufMVN5Zh9WhyVsvI=;
h=MIME-Version:From:Date:Message-ID:Subject:To;
b=v/2iw3NxhwGe0MTi/snoszGD4O0evWrsgLqko2qEQRJd6olBhxnRYw6yS7/fdWyj8aap8vJKrqz9hk7lLyQAw4mOLy4BtHz4sFL0QrS09loWeriNUVSFBvoacO9R4vk2Mpsb+QrNlecCSAogBnAN0D4vB8tfdu57Tq9GMEbesRA=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1705036530; x=1705641330;
h=content-transfer-encoding:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=Qj2PeZj6dym8Aj8LRadv8ARhV+nemuJjJULOzC91mdo=;
b=SEbx4QLJsZaav9/BHEgYmEgObd2DXUg5AEEsRKAHqkzvdCYJZ85/jvi3m3vheK2oe7
d2c/g6XBCrEBp+/Pv5HNuf1LvFU9BY1es3fKQbRGs7oi4FkDv2BLPhUPowM5ooX839iM
L3V2G3+c7nlAM7oyEOFxqF7DscsPUgCuvy6L8X8NymZ3h8ZXqgUgOQSGhz2o18MoYilb
9D8oyV7m/KbzePxWfMEE1MCtdqvE298Ls+2vQ9HnRxGEhU53N/IzAGRLMUnGGeubys3C
ZZo9ucwkFx5U0KvdK6ZLfO5CXk9sqpmgNwI0a1CNTUZW9qe91f9Ry3ByBG2KR6tKlXwS
lgRA==
X-Gm-Message-State: AOJu0Yw6MmkpKZJE5FapZ5IrfvNORT52k6e6Orffpk2x0Mh+YJNidvxi
RkI9ggz/ZYE+OkDH61CgIwzJ2v6s4daneAIihZE5CA2DAGE=
X-Google-Smtp-Source: AGHT+IFGKoFJE7B9HaqaAgbx13yT8VBOR/0FaU944kdYm1pwBWEXq32BVi9d09PaWhzSqFWKrBrRqSJR38LFQlnBjWo=
X-Received: by 2002:a05:6602:4211:b0:7bc:4687:3c8b with SMTP id
cb17-20020a056602421100b007bc46873c8bmr801209iob.40.1705036530178; Thu, 11
Jan 2024 21:15:30 -0800 (PST)
MIME-Version: 1.0
References: <CANH4o6N7UONfYy1ir7WZXpOnthSxF=fcqaPe37dPsdU_AoPoLw AT mail DOT gmail DOT com>
<ZWmsvW0bmko_9Qcc AT calimero DOT vinschen DOT de>
<CANH4o6M7s1h8+atQVdr+uAOgUHKPyomP4zoobvvbW97ebSR=sw AT mail DOT gmail DOT com>
<ZZwCIjfdP6Qh-y5d AT calimero DOT vinschen DOT de>
<CANH4o6NPjo1d-KBxZUo1+tVrZJNcT5ieYX0Hc42ZV0pXLoUtgw AT mail DOT gmail DOT com>
<ZaAaIs7D7DMO4qw3 AT calimero DOT vinschen DOT de>
In-Reply-To: <ZaAaIs7D7DMO4qw3@calimero.vinschen.de>
Date: Fri, 12 Jan 2024 06:15:00 +0100
Message-ID: <CAKAoaQ=wRX2iiL7VvcDz3ki16x7XqEQFw=QWzLLGD=tQVgSdVA@mail.gmail.com>
Subject: Re: Cygwin tools to read/write NTFS alternate data streams?
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,
FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,
KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Roland Mainz via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Roland Mainz <roland DOT mainz AT nrubsig DOT org>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 40C5FtiX003368

On Thu, Jan 11, 2024 at 5:41 PM Corinna Vinschen via Cygwin
<cygwin AT cygwin DOT 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 AT cygwin DOT 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
>
> FTR, I'm generally not a friend of ADS, because they look like a builtin
> security problem.

See below. I'm not 100% happy with that either, but these things
exists in many operating systems, and constantly ignoring them just
because it is not part of POSIX does not serve the users. So far SUN's
Solaris team came up with an API which works with Windows and UNIX
APIs, and it is much better than the alternatives I've seen so far...

> They don't show up in standard directory listings,
> and you can't even see that a file has ADS, except you look for them
> explicitely.  This is a really user-unfriendly interface.

Actually Solaris /usr/bin/ls has option "-@" (basically ls -l plus ADS
support, e.g. ls -l output has an @ displayed after the file
permission bits for files that have alternate data streams).
The plan was to make that the default for ls -l in Solaris 12, but
that plan was ruined by the SUN takeover.

I can make a patch for Cygwin /usr/bin/ls and /usr/bin/find (options
-xattr/-ads) once O_XATTR support is available, and provide an
implementation of runat(1), so people can easily see whether ADS are
around, and access them via runat(1).

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland DOT mainz AT nrubsig DOT org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019