Skip to content

Commit

Permalink
Only use FileId128 when it is non-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Mar 28, 2023
1 parent e55554d commit 7a30dba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Python/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,13 @@ _Py_stat_basic_info_to_stat(FILE_STAT_BASIC_INFORMATION *info,
/* File systems with less than 128-bits zero pad into this field */
id_128_to_ino file_id;
file_id.id = info->FileId128;
result->st_ino = file_id.st_ino;
result->st_ino_high = file_id.st_ino_high;
if (file_id.st_ino && file_id.st_ino_high) {
result->st_ino = file_id.st_ino;
result->st_ino_high = file_id.st_ino_high;
} else {
result->st_ino = info->FileId.QuadPart;
result->st_ino_high = 0;
}
/* bpo-37834: Only actual symlinks set the S_IFLNK flag. But lstat() will
open other name surrogate reparse points without traversing them. To
detect/handle these, check st_file_attributes and st_reparse_tag. */
Expand Down

0 comments on commit 7a30dba

Please sign in to comment.