X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF17738418A2
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=pdc.ca
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=pdc.ca
X-Zone-Loop: 17005b4e65a6e3cd8e70738941ae548b08e1011b8b77
X-Originating-IP: [140.82.40.27]
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pdc.ca; s=x
 ;
 h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:
 Message-ID:From:References:To:Subject:Sender:Reply-To:Cc:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=TAHb7LT476vW977+R+2X307tzTdCnoOEkSOXvXKxd4A=; b=qKWsaoiow1YaAJGJnHEISDBtYX
 dwB9rwdj8rJZx55AhgYCUCE9SG/hsChPaIRu8VgFnq39bWtB8Z1/3k5lzw/qBBFLIpLq+0s91vb7O
 68XLdeGvMRdeMEyDuvp+e3tSstFHwCzdeTo1Ebtfg34ZMJzXbRwVRClkaBgbzuZ67DIz7tPkhA9YZ
 Uc+oePPpv0xbsaaHUtFqAdK5WJqCgYcDqGSL/DxsuIc4lqJv43nDfC76ty63uLJo3OFWDZfj+Y9GG
 Xy4HHesNK5Tg6yVyectxeQ+6BZ8qoiS68kvs9JSD+boEKV44TSD1LolsKkgsV+xTwFELltXWNVMrL
 rcNAtEQA==;
Subject: Re: Permissions issues after installing Windows 10
To: cygwin@cygwin.com
References: <26dc3119-0f36-1331-1403-9e994a697d89@pdc.ca>
 <1351760318.20220508183530@yandex.ru>
From: Brent Epp <brent@pdc.ca>
X-Tagtoolbar-Keys: D20220602074349433
Message-ID: <65f61260-7a7f-e7dc-e3f6-4eddead9da74@pdc.ca>
Date: Thu, 2 Jun 2022 07:43:49 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
 Thunderbird/60.0
MIME-Version: 1.0
In-Reply-To: <1351760318.20220508183530@yandex.ru>
Content-Language: en-US
X-AuthUser: brent@pdc.ca
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_INVALID,
 DKIM_SIGNED, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, 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@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 252Cidnu001466



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

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

