Web lists-archives.com

Re: How to handle changed user ID

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