public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: How to handle changed user ID
Date: Thu, 07 Dec 2017 20:08:00 -0000	[thread overview]
Message-ID: <c91f9ac9-d7e0-332f-a6bf-3927cddb1077@SystematicSw.ab.ca> (raw)
In-Reply-To: <03c139ef-2ef9-e4bb-e8d8-11e8a1e00e9c@towo.net>

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

  parent reply	other threads:[~2017-12-07 18:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 14:12 Thomas Wolff
2017-12-07 15:03 ` cyg Simple
2017-12-07 16:43   ` Corinna Vinschen
2017-12-07 20:08 ` Brian Inglis [this message]
2017-12-08  0:16 ` Achim Gratz

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=c91f9ac9-d7e0-332f-a6bf-3927cddb1077@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.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).