Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#1001 closed change request (fixed)

Do not implicitly expand ~ in pathnames

Reported by: Mario Domenech Goulart Owned by:
Priority: major Milestone: 4.9.0
Component: unknown Version: 4.8.x
Keywords: ##sys#expand-home-path, ~ expansion Cc:
Estimated difficulty:

Description (last modified by Mario Domenech Goulart)

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.

Attachments (2)

0001-added-ep-procedure-to-utils-unit-for-explicitly-expa.patch (3.8 KB) - added by felix winkelmann 12 years ago.
0001-added-ep-procedure-to-utils-unit-for-explicitly-expa-v2.patch (3.8 KB) - added by Mario Domenech Goulart 11 years ago.
Felix's patch modified to be cleanly applied to master as of 2013-07-09

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by Mario Domenech Goulart

Description: modified (diff)
Summary: Should ~ in pathnames be implicit expanded?Do not implicitly expand ~ in pathnames

comment:2 Changed 12 years ago by felix winkelmann

Attached is a patch that provides ep, a procedure performing explicit tilde-expansion in pathnames, a suggestion by sjamaan.

comment:3 Changed 12 years ago by sjamaan

This patch is very complete! Thanks, Felix.

comment:4 Changed 12 years ago by felix winkelmann

Uh, not complete enough. This one adds types.db and import-lib entries.

comment:6 in reply to:  5 Changed 12 years ago by felix winkelmann

comment:7 Changed 12 years ago by Mario Domenech Goulart

Resolution: fixed
Status: newclosed

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.

comment:8 Changed 12 years ago by felix winkelmann

Note that the current behaviour can only be deprecated or too much old code would break.

Changed 11 years ago by Mario Domenech Goulart

Felix's patch modified to be cleanly applied to master as of 2013-07-09

comment:9 Changed 11 years ago by Mario Domenech Goulart

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.

Note: See TracTickets for help on using tickets.