Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions amdsmi_cli/amdsmi_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,11 @@ def _has_read_access(self, path: str) -> Tuple[bool, Optional[int], Optional[str
if os.geteuid() == 0:
return True, None, None

# Use os.access to check read permission (including ACLs) without
# opening the path, to avoid potential issues with device nodes.
if os.access(path, os.R_OK):
return True, None, None

mode = st.st_mode
uid = st.st_uid
gid = st.st_gid
Expand Down
Loading