Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#694 closed defect (fixed)

find-files does follow symlinks contradicts documentation

Reported by: Christian Kellermann Owned by: Christian Kellermann
Priority: major Milestone: 4.9.0
Component: unknown Version: 4.7.x
Keywords: Cc:
Estimated difficulty:

Description

Found by Sascha Ziemann:

The documentation for find-files says: By default, symbolic links are
not followed.

Try this:

$ ln -s this .
$ csi -R posix -e '(write (find-files "."))'

$ csi -v

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2011-09-16 on sn-e0692 (Linux)

Change History (7)

comment:1 Changed 11 years ago by Christian Kellermann

Status: newaccepted

Due to the test of (or (null? args) (not (keyword? (car args)))) the code follows the legacy codepath supporting the older call to find-files. This explicitly sets follow symlinks to #f

I have to check whether this has been the default behaviour for older chickens.

comment:2 Changed 11 years ago by Christian Kellermann

Chicken 4.5.0's find-files follows symlinks by default, so the current behaviour is "correct" with respect to keeping backwards compatibility.

On the other hand this will not work for the simple version of the current find-file implementation. My recommendation is to remove the deprecated code path and carry on with life. Everyone will be happy again.

Also note that even in the current implementation the default is to follow symlinks.

comment:3 Changed 11 years ago by felix winkelmann

Yes, the old signature doesn't need to be supported anymore (it was deprecated in 4.6.0, I believe). Also, the documentation should be changed.

comment:4 Changed 11 years ago by Christian Kellermann

You mean we should follow symlinks by default?

comment:5 Changed 11 years ago by Christian Kellermann

I propose we change the behaviour to fit the docs, also see chicken-hackers discussions about this

comment:6 Changed 11 years ago by Christian Kellermann

Resolution: fixed
Status: acceptedclosed

I pushed commit 9aaea62 to master, disabling following symlinks by default

comment:7 Changed 10 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.