Bug 36658 - Delete task follows symlinks - bad behavior
Summary: Delete task follows symlinks - bad behavior
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.5
Hardware: Other Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
Keywords: PatchAvailable
: 22632 (view as bug list)
Depends on:
Reported: 2005-09-14 18:43 UTC by Jens Elkner
Modified: 2008-11-12 21:14 UTC (History)
2 users (show)

delete dir [do not] follow symlinks patch (4.05 KB, patch)
2005-09-14 18:45 UTC, Jens Elkner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Elkner 2005-09-14 18:43:28 UTC
If one uses <delete dir="${build.dir}"/> the delete task follows symlinks and
thus deletes files, which shouldn't be deleted. If one uses a fileset and
disables followsymlinks, symlinks are not followed, however the links itself are
not deleted and thus the delete task does not do, what it should.

I'll attach a fix suggestion for the <delete dir="${build.dir}"/> task (since
this is actually, what I really need), for filesets it probably needs a little
bit more work ...
Comment 1 Jens Elkner 2005-09-14 18:45:37 UTC
Created attachment 16406 [details]
delete dir [do not] follow symlinks patch

Handles not nested filesets
Comment 2 Stefan Bodewig 2008-09-04 06:31:57 UTC
*** Bug 22632 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Bodewig 2008-11-12 21:14:47 UTC
<delete> now has an attribute removeNotFollowedSymlinks that removes the remaining links.

A combination of followsymlinks="false" and removeNotFollowedSymlinks="true" is what the original report would need.

svn revision 713641