setfacl can kill a drive

Steven Penny svnpenn@gmail.com
Fri Apr 10 07:15:00 GMT 2015


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



More information about the Cygwin mailing list