Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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) # 先頭ビット位置
     ))
 }
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away