You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All paths set in these environment variables must be absolute. If an implementation encounters a relative path in any of these variables it should consider the path invalid and ignore it.
So os.UserConfigDir and os.UserCacheDir don't conform the specification.
The text was updated successfully, but these errors were encountered:
seankhliao
changed the title
os: UserConfigDir and UserCacheDir don't check relative paths in the environment variables
os: UserConfigDir and UserCacheDir should disallow relative paths in the environment variables
Jul 16, 2024
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Jul 22, 2024
Go version
go version go1.22.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Run the following code by
go run
.And run the following code too.
What did you see happen?
Both codes panicked:
What did you expect to see?
Both codes should not panic.
os.UserConfigDir
andos.UserCacheDir
should return errors when the corresponding XDG environment variables contain relative paths.The documens are saying that
However, XDG Base Directory Specification is saying that
So
os.UserConfigDir
andos.UserCacheDir
don't conform the specification.The text was updated successfully, but these errors were encountered: