delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/12/18/12:47:38

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 166AE385802A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1702921657;
bh=KVpg9Ph7PpT49jNIuED7aAh17dBvSUujO1eG2XMzhEc=;
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=TQ8yO5iwoOJIPmQ//yw3GbCBZuDmoeYnZP1FMOsnb2YenJ0pZwhKmubQqajgIDaE9
9dr0HDNAPVgw1jaKDcA3lmkjv1PQUioTRL9WWj/UymgwBIaJbg112msWsDPDIxa2EA
CuJqDsknl5otVj1cjm/8j+A3pG4INYfX6jr7NvTg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 643B038582B6
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 643B038582B6
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702921643; cv=none;
b=RVKL7S2vGjhbEBAfXClHEB6xu1XaGQofSiNReMRKlX79uJI9fP75jlHlbjWEYX7Hf1WpJxVQeTaw/ZNAD45dKj2uT9HYlPwvAoI1OknoxzMfNY0QvmV7vv3MWvISvkHcMrGl9yfupDpSz+Z58WJGxAKytcPdfUCsKdjed3XfsXg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1702921643; c=relaxed/simple;
bh=x0wI9nEBiqPFOzluhJb+7cZrq8VYzjl5mqfucRDv+gw=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=eXO+obQ9i119ZmkNPeiDHtnMdYefxA0ipTxnPhozg+3kNe51pmm3xz+6qut+sj6vYD4Jc6O1IAusIbVgZF9BHMFP7sTnnAuaLdS0CVXAEgI8b0h6lYI2LzUwRkE7j9ZJs5U3fYhdxa0U5Du7Na+j0IhDXQMnttSj++Mtu3MKY+k=
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=1702921641; x=1703526441;
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=wdMW/1aUddkyRZyS5UOcO4EglEt9QtCrKQFIVwZmM9U=;
b=KOi6TBY/KhzkZJLOohuC3EtpMJgWTiszWj4WkZiG8btb/MtO2Gjuqopv7vOSziwKmt
tnk5TMytQTAdgUEgI1WKmsFY4kGRPghXzEO04ToaXkPkpmqnLJ1sZSHUourqxXbyNRle
EHc6gaANpCxkCc9ixbz3UZt9rfCO5+GuWkY5E90FTvGMlZ6PIlQDP7GUqhHn60a/b3MG
ERHtgn632bvkml8qf/Jcj+eHBvA/G0NulF6XE2gCAz1crCRsjcgGXNzHWG6tE4vcg8Ib
CoNktI3+fQwTRAjW8WKmWyxpxwSzh5fRKHQKPL5yQYxwlEa0XstNSHDvhpUyoKm0hPOx
EJTA==
X-Gm-Message-State: AOJu0YwNzK6C2deamqs+drMM9/DvOXbwKg9u4FDeeQZKl3M6sNaZBnCS
XBl6VOVOVSG3eicZXAr/PsRGSKiV8F/wS+blznetycX6
X-Google-Smtp-Source: AGHT+IEWwg1So/UJ4K0OPPYE/6VZ9ekoAeqk9Wd9KUWvWv4j2VFZdP43nGTaWbCKnaVd2TLCFUdAHpGxbZT+tf36EZg=
X-Received: by 2002:a05:6870:7e02:b0:203:2141:ffc1 with SMTP id
wx2-20020a0568707e0200b002032141ffc1mr3878427oab.18.1702921641592; Mon, 18
Dec 2023 09:47:21 -0800 (PST)
MIME-Version: 1.0
References: <CANH4o6N7UONfYy1ir7WZXpOnthSxF=fcqaPe37dPsdU_AoPoLw AT mail DOT gmail DOT com>
<ZWmsvW0bmko_9Qcc AT calimero DOT vinschen DOT de>
In-Reply-To: <ZWmsvW0bmko_9Qcc@calimero.vinschen.de>
Date: Mon, 18 Dec 2023 18:47:00 +0100
Message-ID: <CANH4o6M7s1h8+atQVdr+uAOgUHKPyomP4zoobvvbW97ebSR=sw@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=-0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham 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: Martin Wege via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Martin Wege <martin DOT l DOT wege AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3BIHlbOB003208

On Fri, Dec 1, 2023 at 10:52 AM Corinna Vinschen via Cygwin
<cygwin AT cygwin DOT com> wrote:
>
> On Nov 30 04:55, Martin Wege via Cygwin wrote:
> > Hello,
> >
> > Does Cygwin have tools (modified /usr/bin/dd ?) to read/write NTFS
> > alternate data streams?
>
> No.  As you know, the colon is translated to a normal filename
> character, and there's no POSIX-like API to expose ADS raw to user
> space.
>
> There is, however, an old function we still expose to user space
> for backward compat:
>
>   #include <sys/cygwin.h>
>
>   int cygwin_attach_handle_to_fd (char *name,
>                                   int fd,
>                                   HANDLE handle,
>                                   mode_t bin,
>                                   DWORD myaccess);
>
> This allows to sneak in a HANDLE into a Cygwin file descriptor
> representation, kind of like this:
>
>   HANDLE h;
>   int fd;
>
>   h = CreateFile ("foo:bar", GENERIC_READ, FILE_SHARE_VALID_FLAGS,
>                   NULL, OPEN_EXISTING, 0, NULL);
>   if (h != INVALID_HANDLE_VALUE)
>     {
>       fd = cygwin_attach_handle_to_fd ("foo", -1, h, 0, GENERIC_READ);
>       if (fd < 0)
>         bail_out;
>     }
>
> For the bin parameter, only 0, O_BINARY or O_TEXT are acceptable,
> for myaccess, only GENERIC_READ and/or GENERIC_WRITE are acceptable.

Could this be abstracted into O_XATTR support, i.e. openat() file with
O_XATTR, and then have access to the alternate data streams in a
(virtual) subdir?

Thanks,
Martin

-- 
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