gpt4 book ai didi

.net - 为什么不设置FileSystemRights Synchronize权限?

转载 作者:行者123 更新时间:2023-12-03 12:52:02 25 4
gpt4 key购买 nike

来自.Net开发背景,在(NTFS)文件系统安全方面经验不足,我对System.Security.AccessControl.FileSystemRights中的大多数权限很清楚。

但是,FileSystemRights.Synchronize是一个异常(exception)。从文档中:

Specifies whether the application can wait for a file handle to synchronize with the completion of an I/O operation.



或者像 someone else解释的那样:

The Synchronize permission allows or denies different threads to wait on the handle for the file or folder and synchronize with another thread that may signal it. This permission applies only to multiple-threaded, multiple-process programs.



所以我的问题是:
  • 以上说明正确吗?
  • 如果是,为什么而不是设置“同步”权限(如果授予读取访问权限)?
  • 最佳答案

    经过研究后回答我自己的问题:

  • 是的,这是正确的。要从高级编辑权限对话框中引用Microsoft的“权限输入对话框”帮助屏幕,请执行以下操作:

  • [Synchronize] Allows or denies different threads to wait on the handle for the file or folder and synchronize with another thread that may signal it. This permission applies only to multithreaded, multiprocess programs.


  • 您不能不能通过用户界面设置“同步”权限。它总是具有其他权利。仅使用.Net API(以及最可能的其他API),您可以选择不设置“同步”权限。

  • 这些是您可以在权限对话框中设置的粗略权限,以及它们包括的FileSystemRights:
  • 完全控制(选择所有粗略权限):
  • FullControl(所有文件系统权限,包括同步)
  • Modify(还选择“读取并执行”,“列出文件夹内容”,“读取”,“写入”):
  • 修改
  • 同步
  • 读取并执行(还选择列出文件夹内容,读取):
  • ReadAndExecute
  • 同步
  • 列出文件夹内容:
  • ReadAndExecute
  • 同步
  • 阅读:
  • 阅读
  • 同步
  • 写:
  • 同步

  • 这些是您可以在高级权限对话框中设置的细化权限,以及它们包括的FileSystemRights:
  • 完全控制:
  • FullControl(所有文件系统权限,包括同步)
  • 遍历文件夹/执行文件:
  • ExecuteFile
  • 同步
  • 列出文件夹/读取数据:
  • ReadData
  • 同步
  • 读取属性:
  • ReadAttributes
  • 同步
  • 读取扩展属性:
  • ReadExtendedAttributes
  • 同步
  • 创建文件/写入数据:
  • CreateFiles
  • 同步
  • 创建文件夹/追加数据:
  • AppendData
  • 同步
  • 写属性:
  • WriteAttributes
  • 同步
  • 编写扩展属性:
  • WriteExtendedAttributes
  • 同步
  • 删除子文件夹和文件:
  • DeleteSubdirectoriesAndFiles
  • 同步
  • 删除:
  • 删除
  • 同步
  • 读取权限:
  • ReadPermissions
  • 同步
  • 更改权限:
  • 更改权限
  • 同步
  • 取得所有权:
  • 获取所有权
  • 同步

  • 请注意,有些FileSystemRights由于其位掩码而包含其他权限。这些权限与您可以在粗略权限对话框中设置的权限相对应。 FileSystemRights值和它们包括的其他值:
  • 阅读:
  • ReadPermissions
  • ReadAttributes
  • ReadExtendedAttributes
  • ListDirectory/ReadData
  • ReadAndExecute(读取+ ExecuteFile):
  • ReadPermissions
  • ReadAttributes
  • ReadExtendedAttributes
  • ListDirectory/ReadData
  • ExecuteFile/遍历
  • 写:
  • WriteAttributes
  • WriteExtendedAttributes
  • CreateDirectories/AppendData
  • CreateFiles/WriteData
  • 修改(ReadAndExecute + Write + Delete):
  • ReadPermissions
  • ReadAttributes
  • ReadExtendedAttributes
  • ListDirectory/ReadData
  • ExecuteFile/遍历
  • WriteAttributes
  • WriteExtendedAttributes
  • CreateDirectories/AppendData
  • CreateFiles/WriteData
  • 删除
  • FullControl:包括所有内容。

  • 还有一些FileSystemRight共享相同的值,并且可以互换使用。他们是:
  • ListDirectory,ReadData:1个
  • CreateFiles,WriteData:2
  • CreateDirectories,AppendData:4
  • ExecuteFile,遍历:32
  • 关于.net - 为什么不设置FileSystemRights Synchronize权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35548400/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com