Last active
August 29, 2015 13:56
-
-
Save joshcooper/8961050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):008:0> (Puppet::FileSystem.stat('c:/target.txt').mode & 0777).to_s(8) | |
=> "644" | |
irb(main):009:0> (Puppet::Util::Windows::Security.get_mode('c:/target.txt') & 0777).to_s(8) | |
=> "700" | |
... | |
irb(main):018:0> sd = Puppet::Util::Windows::Security.get_security_descriptor('c:/target.txt') | |
=> BUILTIN\Administrators | |
WIN-QP47VOHA2P4\None | |
BUILTIN\Administrators: 0x1f01ff | |
NT AUTHORITY\SYSTEM:(I) 0x1f01ff | |
BUILTIN\Administrators:(I) 0x1f01ff | |
BUILTIN\Users:(I) 0x1200a9 | |
irb(main):019:0> puts sd.inspect | |
BUILTIN\Administrators | |
WIN-QP47VOHA2P4\None | |
BUILTIN\Administrators: 0x1f01ff | |
NT AUTHORITY\SYSTEM:(I) 0x1f01ff | |
BUILTIN\Administrators:(I) 0x1f01ff | |
BUILTIN\Users:(I) 0x1200a9 | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's too bad we don't have anything that pretty prints the
0x1f01ff
;0For the sake of others looking at this,
0x1F01FF
is equivalent toFILE_ALL_ACCESS
0x1200A9
is equal to