LoginSignup
1

More than 5 years have passed since last update.

Windows ACE の AccessMask(マスク)ビットフラグの対応関係

Last updated at Posted at 2014-12-20

Windows のアクセス権を示す ACL, ACE のビットフラグ位置と、
その名前の位置関係がわかりにくいので一覧にしています。

複数のフラグがついた汎用の名前があることや、ディレクトリ用とフォルダ用で別々の列挙体があることなどが見て取れます。

一覧表示のための PowerShell スクリプトも添付しました。


ListDirectory                  :        1  =                      1  =  0x00000001  ~  2^ 0
ReadData                       :        1  =                      1  =  0x00000001  ~  2^ 0
WriteData                      :        2  =                     10  =  0x00000002  ~  2^ 1
CreateFiles                    :        2  =                     10  =  0x00000002  ~  2^ 1
CreateDirectories              :        4  =                    100  =  0x00000004  ~  2^ 2
AppendData                     :        4  =                    100  =  0x00000004  ~  2^ 2
ReadExtendedAttributes         :        8  =                   1000  =  0x00000008  ~  2^ 3
WriteExtendedAttributes        :       16  =                  10000  =  0x00000010  ~  2^ 4
Traverse                       :       32  =                 100000  =  0x00000020  ~  2^ 5
ExecuteFile                    :       32  =                 100000  =  0x00000020  ~  2^ 5
DeleteSubdirectoriesAndFiles   :       64  =                1000000  =  0x00000040  ~  2^ 6
ReadAttributes                 :      128  =               10000000  =  0x00000080  ~  2^ 7
WriteAttributes                :      256  =              100000000  =  0x00000100  ~  2^ 8
Write                          :      278  =              100010110  =  0x00000116  ~  2^ 8
Delete                         :    65536  =      10000000000000000  =  0x00010000  ~  2^16
ReadPermissions                :   131072  =     100000000000000000  =  0x00020000  ~  2^17
Read                           :   131209  =     100000000010001001  =  0x00020089  ~  2^17
ReadAndExecute                 :   131241  =     100000000010101001  =  0x000200A9  ~  2^17
Modify                         :   197055  =     110000000110111111  =  0x000301BF  ~  2^17
ChangePermissions              :   262144  =    1000000000000000000  =  0x00040000  ~  2^18
TakeOwnership                  :   524288  =   10000000000000000000  =  0x00080000  ~  2^19
Synchronize                    :  1048576  =  100000000000000000000  =  0x00100000  ~  2^20
FullControl                    :  2032127  =  111110000000111111111  =  0x001F01FF  ~  2^20
foreach ($name in [enum]::GetNames([System.Security.AccessControl.FileSystemRights])) 
 { 
  $mask = [int][System.Security.AccessControl.FileSystemRights]$name;
  [String]::Format("{0,-30} : {1,8}  =  {2,21}  =  0x{1:X8}  ~  2^{3,2:0}", @(
     ($name ), # 名前
     ($mask), # 値
     ([System.Convert]::ToString(($mask), 2)), # 2進数文字列
     ([System.Math]::Log($mask,2) - 0.499) # 先頭ビット位置
     ))
 }

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1