public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brent Epp <brent@pdc.ca>
To: cygwin@cygwin.com
Subject: Re: Permissions issues after installing Windows 10
Date: Thu, 2 Jun 2022 07:43:49 -0500	[thread overview]
Message-ID: <65f61260-7a7f-e7dc-e3f6-4eddead9da74@pdc.ca> (raw)
In-Reply-To: <1351760318.20220508183530@yandex.ru>



On 2022-05-08 10:35, Andrey Repin wrote:
> Greetings, Brent Epp!
>
>> I recently (finally) installed Windows 10 on my system (clean install).
>> All of my files are stored in on a secondary drive/partition, on which
>> cygwin is also installed.  I expected to be able to just pick up where I
>> left off, but I'm getting all sorts of permissions issues with cygwin.  I
>> did run the cygwin setup again to reinstall/upgrade.
>> First, I had restore my cygwin home directory from a backup, since it was
>> giving me permissions errors on .bash_history, .ssh, etc, but the biggest
>> headache is with git repos.  First, it gives a "fatal: unsafe repository"
>> error.  If I add it to the safe directories list, it git still has to
>> reindex the repo every time I run `git status`, and it still fails when I try to enter a commit.
>> It seems most or everything is owned by "Administrators".  The only way
>> I've been able to fix this is to go through the Windows advanced permissions
>> dialog, change the owner to my user, and set all sub-objects to inheritable
>> permissions, but I'm very leery about mass changes like this.
>> Why did this happen?  And is there a better/safer/correct way to fix this?
> The only way is to install a clean copy of Cygwin and carefully copy your
> changes over. This will ensure that all permissions are set correctly, and all
> programs are rebased correctly as well.
> This is because Windows uses a very different file access control that that of
> simple POSIX permissions, on top of which Cygwin emulates them.
> If you want your pain to be somewhat less in the future, move your home away
> from Cygwin directory and use noacl flag on it, which will defer permissions
> control to the underlying OS layer.
> I'm using my Windows profile as Cygwin home, but your mileage may vary.
Thanks, I did try a clean install of cygwin.  This has not resolved the 
issue.

I think what's happened is that some of all files modified by by various 
command line programs (git, rsync, etc.) in cygwin have ended up with 
permissions that didn't carry across with the new Windows installation.  
In the [Security] tab for these files or directories, under "Group or 
user names", it lists the owner as "Account Unknown(S-...)".  In some 
cases, these files are completely inaccessible and I can't even take 
ownership or change the permissions.  I have to either restore them from 
a backup or boot to a Linux environment to access them.

  - Brent

  reply	other threads:[~2022-06-02 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 15:00 Brent Epp
2022-05-08 15:35 ` Andrey Repin
2022-06-02 12:43   ` Brent Epp [this message]
2022-06-02 15:14     ` Bill Stewart
2022-06-03 12:23       ` Brent Epp
2022-06-03 12:47         ` Achim Gratz
2022-06-03 16:42         ` Bill Stewart

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=65f61260-7a7f-e7dc-e3f6-4eddead9da74@pdc.ca \
    --to=brent@pdc.ca \
    --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).