os.lstat doesn't properly set st_reparse_tag for junction on a remote NetApp share
未关闭
还没有人认领这个 Issue。
OS-windows
type-bug
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
Bug report
\\192.168.10.198\vol1\sub is a junction on NetApp share, but in Python 3.10.4 st_reparse_tag is set to 0:
>>> path = "\\\\192.168.10.198\\vol1\\sub"
>>> os.lstat(path).st_reparse_tag
0
>fsutil reparsepoint query \\192.168.10.198\vol1\sub
Reparse Tag Value : 0xa0000003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 98
Print Name offset: 100
Print Name Length: 98
Substitute Name: \??\Volume{804BBB02-0000-0000-6270-052200000040}\
Print Name: \??\Volume{804BBB02-0000-0000-6270-052200000040}\
I checked in the Python code that:
os.lstatusesGetFileInformationByHandleExcall withFileAttributeTagInfoto get the value of the reparse tagDeviceIoControlwithFSCTL_GET_REPARSE_POINT, which is also used in Python source code, works fine- the problem doesn't affect regular remote Windows shares (NTFS filesystem)
Your environment
- CPython versions tested on: 3.10.4
- Operating system and architecture: Windows 2019, NetApp share
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查 os.lstat 背后的 Windows 实现,尤其是使用 FileAttributeTagInfo 调用 GetFileInformationByHandleEx 的部分。针对 NetApp junction 重现该情况,并将其与使用 FSCTL_GET_REPARSE_POINT 的 DeviceIoControl 进行比较。完成的标准是 st_reparse_tag 报告远程 junction 的 reparse tag,同时保持对普通 Windows 共享的行为不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100