X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:subject:references:from:date:in-reply-to
	:message-id:mime-version:content-type; q=dns; s=default; b=KTj1W
	uBA/x05G/HRzoQh8yXwlEfB4jh9lMXq4rIVb6tmdyE1QjrC4SNHPxWinlSafQtVY
	0gn1EAyNa/Zs6StNewJawxaO69Yx+qC3P38FKmrbiUQ/2UyOr8iATqR/8AW+wUX9
	kRVjKD+DCh4oLkTTwKn00c+v0psEilncbHPr4g=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:subject:references:from:date:in-reply-to
	:message-id:mime-version:content-type; s=default; bh=160BLBKHvb5
	Tq0yeSLosNp8sG4E=; b=T+zdjRDCqHENxpLNTGwfU/wSPn3pOZLvxv8jll3EsOk
	zSWGb5fW0Fmf3EksBsnGZFMivFsFnGVRbbcDc9DoqhIeuhmIb9BjaIa9/yeiN82Q
	e4X3ALCKZSiDKCQkIwxzZXZB3SPBAnm8CKStk+2/wFRVdXfgxweOKE/SCivj8v5o
	=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=luther, Principal, Owner, creator
X-HELO: nougat.ucs.ed.ac.uk
To: cygwin@cygwin.com
Subject: Re: Repairing permissions after windows reinstall
References: <f5bh9cdociz.fsf@troutbeck.inf.ed.ac.uk>	<20160628103406.GB22797@calimero.vinschen.de>
From: ht@inf.ed.ac.uk (Henry S. Thompson)
Date: Tue, 28 Jun 2016 12:08:07 +0100
In-Reply-To: <20160628103406.GB22797@calimero.vinschen.de> (Corinna Vinschen's message of "Tue\, 28 Jun 2016 12\:34\:06 +0200")
Message-ID: <f5bd1n1o9k8.fsf@troutbeck.inf.ed.ac.uk>
User-Agent: Gnus/5.1012 (Gnus v5.10.12) XEmacs/21.5-b34 (linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Edinburgh-Scanned: at nougat.ucs.ed.ac.uk    with MIMEDefang 2.60, Sophie, Sophos Anti-Virus, Clam AntiVirus
X-IsSubscribed: yes

Corinna Vinschen writes:

> On Jun 28 11:04, Henry S. Thompson wrote:
>> Good news: My cygwin file tree survived a Windows (10) reinstall
>> Not-so-good news: I have a new SID, so not only do I not own those files
>> any more (that's easily fixed), but I don't have the permissions I
>> should, because they are now held by some miscellaneous old SID.
>> 
>> In fact I see _two_ raw SIDs when I look at the security tab for any
>> directory in the old cygwin tree: one has Full control, and the other
>> just Read & execute.
>> 
>> I presume the first is the old me, what's the second?
>> 
>> Can this be easily fixed, i.e. put me back where I used to be?
>
> Off the top of my head, what you could do is this:
>
> - Generate an /etc/passwd entry for your old user SID by hand.
>   Make sure to use an arbitrary weird UID like 98765.
>
> - Exit and start an elevated shell.
>
> - find . -uid 98765 | xargs chown <newuser name or UID>
>
> Analog for the group if necessary.

Thanks, but ownership is not the problem.  The problem is that the ACLs
(as reported by Windows itself via the Security tab) don't allow the new
me (or OWNER) the necessary (or indeed any) permissions, those are given
to the old SID.

Here's what shows up for /bin:

Advanced Security Settings for bin
Name: C\C64\bin
Owner: ht (LUTHER\ht) ' Change
...
Permission entries:
Type Principal                         Access       lnherite... Applies to
---------------------------------------------------------------------------
Allow S-1-5-21-32...-1001 Full control None This folder only
Allow S-1-5-21-32...-513  Read & ex... None This folder only
Allow Everyone            Read & ex... None This folder, subfolders and files
Allow CREATOR OWNER       Full control None Subfolders and files only
Allow CREATOR GROUP       Read & ex... None Subfolders and files only

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

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

