Skip to content

std::path::posix::Path should not automatically normalize #14028

@alanfalloon

Description

@alanfalloon

Because of symlinks, on POSIX systems, in general you can't claim that foo/bar/../baz is the same path as foo/baz. If foo/bar is a symlink with target flip/flop then the abspath of foo/bar/../baz is actually foo/flip/baz. Normalizing the path symbolically changes the meaning of the path. (reducing // to / is still valid though)

Other issues like #11650 are symptoms of this issue, execvp is not the only call that changes behaviour when path components are stripped out.

The std::path::posix::Path module needs to leave the paths un-normalized internally, and re-introduce an explicit normpath method (distinct from os::make_absolute for the reasons outlined above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions