public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Christopher Layne <clayne@anodized.com>, cygwin@cygwin.com
Subject: Re: Issue with cygdrive mount, native symlinks, and noacl option
Date: Fri, 26 Apr 2024 10:25:02 +0300	[thread overview]
Message-ID: <1331116259.20240426102502@yandex.ru> (raw)
In-Reply-To: <2AD67AA7-33D1-43FF-9543-20A687E0D4CC@anodized.com>

Greetings, Christopher Layne!

> I noticed recently while attempting to rsync directories from one drive to
> another that I was getting the familiar "NULL SID", "incorrectly ordered",
> etc. type ownership issues on the destination even though I use noacl for
> cygdrive mounts (I'm aware of the POSIX vs windows ACL issues, etc. hence
> why I use "noacl" for cygdrive). I was able to track down the issue to a
> specific combination of things that creates the problem:

> 1. I have symlinks in / for each drive pointing to /cygdrive/[a-z] via ln -s /cygdrive/<x> /<x>.

Just make cygdrive prefix / in this case.
Portable apps should use /proc/cygdrive/ regardless.

> 2. All symlinks are actually native reparse points as a I run with
> CYGWIN=winsymlinks:nativestrict by default.

> Example:

> clayne@sv590:/ $ ls -lad /[a-z]
> lrwxrwxrwx 1 clayne None 11 Apr 24 12:24 /c -> /cygdrive/c
> lrwxrwxrwx 1 clayne None 11 Apr 24 12:24 /e -> /cygdrive/e
> lrwxrwxrwx 1 clayne None 11 Apr 24 12:24 /f -> /cygdrive/f
> lrwxrwxrwx 1 clayne None 11 Apr 24 12:24 /s -> /cygdrive/s

What is the actual symlink target? (not what is reported by Cygwin)

> 3. I issue the rsync with something like: rsync -avSHP /f/some-dir/ /s/some-dir/

> The issue here is that it appears mount related options such as noacl are
> evaluated differently when native symlinks are used. If I change the
> destination to instead be "/cygdrive/s/dest/dir" then noacl works
> appropriately. On top of all this, if I instead create the /s symlink as a
> "cygwin" style symlink via CYGWIN=winsymlinks things also work correctly -
> that is, the noacl option is used. What I would intuitively expect, atleast
> within the context of acl vs noacl, is for the symlinks to be resolved first
> and then mount options specific to the target resolved based off what the
> symlink actually points to. In the native/nativestrict case, it appears to
> be doing this in reverse and inheriting /'s standard default acl option
> rather than /cygdrive's noacl option.

> Footnotes on workarounds:

> * I know how to workaround using the root-level symlinks in the first place
> by just mounting cygdrive to /, but I'd have to update various scripts which
> already use /cygdrive and I like having the "windows drives" self-contained
> under /cygdrive (even though I frequently use the / level symlinks as shorthand).

See the note above about portable apps.

> * I also know how to avoid the issue entirely by using /cygdrive/<x> for
> the destination but the underlying issue still seems like a bug or an
> oversight to me, particularly given that nativestrict behaves differently
> when it comes to evaluating mount options.

See...

> * Another workaround would be to use non-nativestrict symlinks but I want
> to preserve interoperability with native windows applications outside of
> cygwin and I've learned over the years to just avoid anything that isn't
> nativestrict.

I'm with you here.


-- 
With best regards,
Andrey Repin
Friday, April 26, 2024 10:20:43

Sorry for my terrible english...


      reply	other threads:[~2024-04-26  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 20:50 Christopher Layne
2024-04-26  7:25 ` Andrey Repin [this message]

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=1331116259.20240426102502@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=clayne@anodized.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).