Summary
Do not implicitly expand ~ in pathnames
Metadata
- Id: f99edfdbbbfca1a098fdcf502dfbda5f594c068d
- Trac id: 1001
- Type: change request
- Reporter: mario
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone: 4.9.0
- Version: 4.8.x
- Changetime: 2013-12-09 12:57:22 UTC
- Created: 2013-03-29 02:23:16 UTC
- Keywords: ##sys#expand-home-path, ~ expansion
Attachments
- f99edfdbbbfca1a098fdcf502dfbda5f594c068d/attachments/0001-added-ep-procedure-to-utils-unit-for-explicitly-expa.patch
- f99edfdbbbfca1a098fdcf502dfbda5f594c068d/attachments/0001-added-ep-procedure-to-utils-unit-for-explicitly-expa-v2.patch
Description
Some procedures available in Chicken implicitly expand ~ to the user home directory if it is the first character in pathnames. They also expand environment variables if pathnames start with $.
The expansions are performed by ##sys#expand-home-path (library.scm).
Florian Zumbiehl submited a patch to chicken-hackers proposing the removal of ##sys#expand-home-path. It received some modifications by other contributors. The most recent version of that patch at the time of this writing is here.
This change is controversial, since it may break code that rely on the implicit expansion of pathnames. On the other hand, implicit expansion of pathnames may lead to unexpected behaviors or even security vulnerabilities (examples).
Another source of controversy is that some people consider the implicit expansion of pathnames as a convenience and other people consider it inconvenient.
Alternatives to minimize or work around the possible breakage caused by the removal of the implicit expansion of pathnames have been proposed along the chicken-hackers thread in question.
It seems that there is a consensus on the removal of the implicit expansion of environment variables in pathnames, so this change request is to eliminate the implicit expansion of ~ in pathnames, which is performed by some procedures provided by the Chicken core.
The discussion period is open and will end on 2013-04-11, when the official poll will be conducted.
Changes and comments
[2013-03-29 02:34:40 UTC] mario changed description
[2013-03-29 02:34:40 UTC] mario changed summary
[2013-03-29 21:16:14 UTC] felix wrote:
Attached is a patch that provides `ep`, a procedure performing explicit tilde-expansion in pathnames, a suggestion by sjamaan.
[2013-03-29 21:22:44 UTC] sjamaan wrote:
This patch is very complete! Thanks, Felix.
[2013-03-30 14:32:52 UTC] felix attached 0001-added-ep-procedure-to-utils-unit-for-explicitly-expa.patch (description=#f)
[2013-03-30 14:33:38 UTC] felix wrote:
Uh, not complete enough. This one adds types.db and import-lib entries.
[2013-04-19 00:22:44 UTC] mario wrote:
~ be implicitly expanded in pathnames?; Yes; No)]
[2013-04-19 09:54:15 UTC] felix wrote:
Replying to mario: > ~ be implicitly expanded in pathnames?; Yes; No)]
[2013-04-26 02:02:46 UTC] mario set resolution to fixed
[2013-04-26 02:02:46 UTC] mario wrote:
This poll has been closed. Since all voters opted for "no", CHICKEN procedures won't implicitly expand ~ in pathnames.
Now, back to polishing patches to implement that.
[2013-04-26 02:02:46 UTC] mario changed status from new to closed
[2013-04-27 13:32:29 UTC] felix wrote:
Note that the current behaviour can only be deprecated or too much old code would break.
[2013-07-09 19:22:01 UTC] mario attached 0001-added-ep-procedure-to-utils-unit-for-explicitly-expa-v2.patch (description=Felix's patch modified to be cleanly applied to master as of 2013-07-09)
[2013-12-09 12:57:22 UTC] mario wrote:
We have decided to remove the implicit expansions from the core and implement the expansions in an egg. See http://lists.gnu.org/archive/html/chicken-hackers/2013-11/msg00077.html for the discussion and decisions.
The current situation at the time of this writing is: 4.9.0 will deprecate implicit expansions and 4.10.0 will remove them.