os: doInRoot does not resolve relative paths that land on root #73780
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Go version
1.24.2
Output of
go env
in your module/workspace:What did you do?
root.Lstat
to access the root directory using a relative path (subdir/..
)What did you see happen?
When using
os.Root
as follows:I get the following panic:
Following the trace I found it originates in go/src/os/root_openat.go:133. After resolving a
..
path, there is no check to ensurepath
is not empty, causing thepath[i]
lookup to throw a panic.What did you expect to see?
To get
Lstat
results for my root folderThe text was updated successfully, but these errors were encountered: