python / python/cpython

os.lstat doesn't properly set st_reparse_tag for junction on a remote NetApp share

Aperta
#92,327 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

OS-windows type-bug
Lingua principale
Python
Stelle
77.2k
Fork
36k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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.lstat uses GetFileInformationByHandleEx call with FileAttributeTagInfo to get the value of the reparse tag
  • DeviceIoControl with FSCTL_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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando l’implementazione Windows alla base di os.lstat, in particolare la chiamata a GetFileInformationByHandleEx con FileAttributeTagInfo. Riproduci il caso con la junction NetApp e confrontalo con DeviceIoControl usando FSCTL_GET_REPARSE_POINT. Il lavoro è completato quando st_reparse_tag restituisce il reparse tag della junction remota, preservando il comportamento per le condivisioni Windows normali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
operating-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.