Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] ABCL should not auto-normalize .. found in pathname directory components #672

Open
fosskers opened this issue Jun 16, 2024 · 0 comments

Comments

@fosskers
Copy link

fosskers commented Jun 16, 2024

I maintain a filepath-handling library, and during some tests noticed that ABCL is over-aggressive about how it handles .. on Unix systems. In particular, it seems to be confusing the difference between :up and :back as described in the spec here.

The issue is that in general, for some given filepath, due to the possibility of symlinks, .. cannot be resolved without a filesystem probe. ABCL is not doing such a probe, but instead assuming that all .. are treated as :back. The perhaps safer thing to do is simply insert a :up where ever a .. is seen, which it seems to only being doing when the previously processed path component was not a string.

Example:

(pathname "/foo/bar/.././../baz/test.json")
=> #P"/foo/baz/test.json"

whereas I would have expected #P"/foo/bar/.././../baz/test.json".

Inspect output:

A pathname.
Namestring: "/foo/baz/test.json"
Host: NIL
Device: NIL
Directory: (:ABSOLUTE "foo" "baz")
Name: "test"
Type: "json"
Version: NIL

This occurs in calls to pathname and in usage of #p pathname literals.

Related Clozure/ccl#477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant