This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Repairing permissions after windows reinstall


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]