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:from:subject:reply-to:to:references:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=guKbkf5V+IWXnHdA
	zaIz10P2bIVkwu0sDP+4JUZJMd0cHSwAgz0LEuDU5E6AhL6z3PorsY12hK+/ATz7
	/kuH0YgDWfSgTIOc2bCyGt0PSLCGpo3zXjpO2Gxj0iQcR7+/zsQVQqYeRrKFV7BB
	Wi8QyoKtCNwzOT548HzmGZfAFMk=
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:from:subject:reply-to:to:references:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=L9iEKBQuMn28THkkUQyil1
	HUVCA=; b=J/yqCWAHlFV7iwn7HbaxHUkAh95KtjJU+AeYulnFil+TkBlbKTOsf/
	OI5lIrvzTGBq1I5PZsVNVJdVclEA46qJ+aA/+hPSFndePKcQdkQLZYj4l5NXaYTE
	EI5RmN6ZOPF+7z4+hESJ4TtdpFFbBTomhExkTqIzk2aICowwFfuPA=
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=-0.2 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=calgary, Alberta, alberta, Calgary
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=JuuBlIwC c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=N659UExz7-8A:10 a=O0a6LyQiMEY-FOTG0lkA:9 a=pILNOxqGKmIA:10
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Subject: Re: How to handle changed user ID
Reply-To: Brian.Inglis@SystematicSw.ab.ca
To: cygwin@cygwin.com
References: <03c139ef-2ef9-e4bb-e8d8-11e8a1e00e9c@towo.net>
Message-ID: <c91f9ac9-d7e0-332f-a6bf-3927cddb1077@SystematicSw.ab.ca>
Date: Thu, 7 Dec 2017 11:50:48 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0
MIME-Version: 1.0
In-Reply-To: <03c139ef-2ef9-e4bb-e8d8-11e8a1e00e9c@towo.net>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-CMAE-Envelope: MS4wfKosJ6fJgYck2MfYz+NMKQYk1i8rwe+aP1hVLSivoz92FL1dEFhR59A7GyQDuHFdUYuB9r+oXLPXXu1aXvvIdGsb1iFFc/o3UexcK5Zp3f9q4vKDxQD4 P67Ou5R/RGD94lR2bN2XFJMpIsZGCYdx7m4MELjcOJ2XusQx9S1aXjGCCKWgDttLWDdpCthWc0tmGQ==
X-IsSubscribed: yes

On 2017-12-07 00:50, Thomas Wolff wrote:
> I had to delete a corrupted Windows account and recreate it.
> For cygwin, the new account, although with the same name, has a different
> user id.

That id is the Cygwin hash of the Windows user id registry key; compare entries
from:
	$ getent passwd ; mkpasswd

> Of course, this creates access problems for existing files (even if they 
> appear to have the same user in ls -l, because the *old user* is still listed
> in /etc/passwd).

And should be shown if you use:
	$ ls -n ...
> Is there a canonical solution to this problem, other than running 
> chown -R $USER ~ ?
> Can the new user be forced to use the previous user ID?

Have you changed all file ownerships in Windows?

Have you tried renaming your id files out of the way so that Cygwin uses SAM/AD?
	$ mv /etc/passwd{,.save} ; mv /etc/group{,.save}
I did that a couple of years ago and had no problems since.
If you uncommented any lines or made any changes to /etc/nsswitch.conf, comment
them out again, if they affect .

If that doesn't work, rename the originals out of the way, as above, and run:
	$ mkpasswd > /etc/passwd ; mkgroup > /etc/group.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

