DeleteVisitor and symbolic links

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

DeleteVisitor and symbolic links

alistairgrant
Hi Everyone,

I inadvertantly changed the behaviour of DeleteVisitor in Pharo 8.
In Pharo 7 DeleteVisitor will follow all symbolic links when deleting a
directory tree.  This has two consequences:

- A symbolic link that points to its containing directory will result in
  an infinite loop.
- Files may be deleted that are NOT subdirectories of the root
  directory.

The Pharo 8 behaviour of not following symbolic links is how the linux
'rm -r' command behaves, and how I think DeleteVisitor should behave.

As Sean commented in
http://forum.world.st/File-problems-in-Pharo-8-tp5095111p5095176.html
following symbolic links can lead to unexpected behaviour, deleting
files out of the tree, and thus is quite dangerous.

But since it is a change in existing behaviour, I wanted to let everyone
know in case there's something I haven't thought of.

I'll submit a PR that updates the appropriate method and class comments
in a few days.


Cheers,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: DeleteVisitor and symbolic links

Sven Van Caekenberghe-2
Thanks, Alistair, for taking care of all this stuff.

> On 13 Feb 2019, at 18:54, Alistair Grant <[hidden email]> wrote:
>
> Hi Everyone,
>
> I inadvertantly changed the behaviour of DeleteVisitor in Pharo 8.
> In Pharo 7 DeleteVisitor will follow all symbolic links when deleting a
> directory tree.  This has two consequences:
>
> - A symbolic link that points to its containing directory will result in
>  an infinite loop.
> - Files may be deleted that are NOT subdirectories of the root
>  directory.
>
> The Pharo 8 behaviour of not following symbolic links is how the linux
> 'rm -r' command behaves, and how I think DeleteVisitor should behave.
>
> As Sean commented in
> http://forum.world.st/File-problems-in-Pharo-8-tp5095111p5095176.html
> following symbolic links can lead to unexpected behaviour, deleting
> files out of the tree, and thus is quite dangerous.
>
> But since it is a change in existing behaviour, I wanted to let everyone
> know in case there's something I haven't thought of.
>
> I'll submit a PR that updates the appropriate method and class comments
> in a few days.
>
>
> Cheers,
> Alistair
>


Reply | Threaded
Open this post in threaded view
|

Re: DeleteVisitor and symbolic links

Torsten Bergmann
Sven wrote:
> Thanks, Alistair, for taking care of all this stuff.

+1

Reply | Threaded
Open this post in threaded view
|

Re: DeleteVisitor and symbolic links

Nicolas Cellier
+1, following links is insanely dangerous

Le mer. 13 févr. 2019 à 20:59, Torsten Bergmann <[hidden email]> a écrit :
Sven wrote:
> Thanks, Alistair, for taking care of all this stuff.

+1

Reply | Threaded
Open this post in threaded view
|

Re: DeleteVisitor and symbolic links

alistairgrant
In reply to this post by Torsten Bergmann
Hi Sven & Torsten,

On Wed, 13 Feb 2019 at 20:59, Torsten Bergmann <[hidden email]> wrote:
>
> Sven wrote:
> > Thanks, Alistair, for taking care of all this stuff.
>
> +1

Thank you!

Cheers,
Alistair