This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: setfacl can kill a drive
- From: Steven Penny <svnpenn at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 10 Apr 2015 02:14:59 -0500
- Subject: Re: setfacl can kill a drive
- Authentication-results: sourceware.org; auth=none
- References: <CAAXzdLUZvdNw_UyOXMa5ozoGuG7zjPnz=rRLELFBoEF8+miZUA at mail dot gmail dot com> <CAAXzdLUgnjfeA=LkrdUp68zHterj5hj5BtLqh0W=TCAn1zPrpQ at mail dot gmail dot com> <20150409074328 dot GO2819 at calimero dot vinschen dot de> <CAAXzdLV4=f5hbmKH_6r6GM=cF4bw0QXqkmivZCh2M4y5ATagxA at mail dot gmail dot com> <CADi7v6++4rbLPD0ZuCMrnONs+kYFMFf6hhS_0SXVGSNwoMTtNg at mail dot gmail dot com> <CAAXzdLWbVS9g4zbn9WBVinighLy1NkA++iWm1MEyTd3b0bWrHw at mail dot gmail dot com> <CAAXzdLWFNJXTS5P7ZKufcBS6bSMjxsEmZvKToQZOV5Z0_0fT-Q at mail dot gmail dot com>
On Thu, Apr 9, 2015 at 10:38 PM, Steven Penny wrote:
> $ icacls 'C:\.' /restore 'C:\acl.txt'
> C:\.\.: Access is denied.
I believe the following commands will fix it. After setfacl trashes the
permissions, you need to temporarily take ownership of "C:\", restore the
permissions then set the owner back. Of course this is contingent on either
having backed up the permissions beforehand, or perhaps transferring them from
a clean virtual machine.
icacls 'C:\.' /save 'C:\acl.txt'
setfacl --remove-all /cygdrive/c
takeown /f 'C:\.'
icacls 'C:\.' /grant users:f
icacls 'C:\acl.txt' /grant users:f
icacls 'C:\.' /restore 'C:\acl.txt'
icacls 'C:\.' /setowner 'NT SERVICE\TrustedInstaller'
--
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