FogBugz (Case [Issue]20307) File System - File names should not be canonicalised by default

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FogBugz (Case [Issue]20307) File System - File names should not be canonicalised by default

Pharo Issue Tracker
FogBugz Notification
avatar
Alistair Grant opened Case 20307: File names should not be canonicalised by default and assigned it to Alistair Grant:
Bug in Project:  File System: 1. Pharo Image  •  You are subscribed to this case
Pharo's behaviour until recently (11 Aug 2017) has been inconsistent in
canonicalising paths.

Previously Paths were canonicalised during initial creation, but are not when
extending the path with #/. Since 11 Aug (Fogbugz #13217), paths are
always canonicalised.

Neither situation is good as it can lead to incorrect results with
symbolic links, e.g. (based on Ubuntu, which has a memory based file
system at /dev/shm):

$ cd /dev/shm
$ mkdir -p d1/d2/d3/d4
$ touch d1/t1.txt d1/d2/t2.txt d1/d2/d3/t3.txt d1/d2/d3/d4/t4.txt
$ pushd d1 && ln -s d2/d3 ./s3 && popd

$ ls -l d1
total 0
drwxrwxr-x 3 alistair alistair 80 Aug 10 07:22 d2
lrwxrwxrwx 1 alistair alistair 5 Aug 10 07:22 s3 -> d2/d3
-rw-rw-r-- 1 alistair alistair 0 Aug 10 07:22 t1.txt

$ ls d1/t1.txt
d1/t1.txt

$ ls d1/s3/../t1.txt
ls: cannot access 'd1/s3/../t1.txt': No such file or directory

$ ls d1/s3/../t2.txt
d1/s3/../t2.txt

Attempting the same in Pharo:

'/dev/shm/d1' asFileReference children
" an Array(File @ /dev/shm/d1/s3 File @ /dev/shm/d1/t1.txt File @ /dev/shm/d1/d2)"

'/dev/shm/d1/t1.txt' asFileReference exists " true"

'/dev/shm/d1/s3/../t1.txt' asFileReference exists " true" -> WRONG!!!

'/dev/shm/d1/s3/../t2.txt' asFileReference exists " false" -> WRONG!!!

The soon to be added PR introduces #canonicalize to FileReference
and Path, and removes it from #resolve: and friends.

I'll add the link to the PR once I've submitted it.

Thanks,
Alistair
Priority Priority: 3 – Must Fix Status Status: Work Needed
Assigned To Assigned to: Alistair Grant Milestone Milestone: Pharo7.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want FogBugz notifications anymore? Update your preferences.

FogBugz

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker