Repairing permissions after windows reinstall
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Jun 28 11:45:00 GMT 2016
On Jun 28 12:08, Henry S. Thompson wrote:
> 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.
Ok, hmm. In that case you could check the current permissions
with getfacl and then call setfacl with a modified ACL giving the
owner the permissions of user 98765 while at the same time remove
the entry for user 98765. It's just a bit of shell script hacking.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160628/b7e6a697/attachment.sig>
More information about the Cygwin
mailing list