paulk-asert opened a new pull request, #2880:
URL: https://github.com/apache/groovy/pull/2880

   …eaves
   
   Since GROOVY-12125 a symbolic link inside a tree being deleted is removed as 
the link itself and never entered. The guard was Files.isSymbolicLink, which 
does not report a Windows directory junction, so a junction was still traversed 
and the contents of its target deleted. A junction is the link form that 
matters most there: mklink /J needs no privilege, where a Windows symbolic link 
needs one most users do not hold, and it is planted in advance rather than 
raced.
   
   Both implementations, File.deleteDir and the groovy-nio Path.deleteDir, now 
read each node's attributes without following links and treat anything that is 
neither a regular file nor a directory as a leaf: a symbolic link is removed as 
before, and a junction or other reparse point, a pipe, a socket or a device is 
removed as the node it is, never entered or opened. Handed such a node 
directly, deleteDir returns false as it does for any non-directory, and does 
not touch what the node points at.
   
   On POSIX the visible behaviour is unchanged — a pipe inside a tree was 
deleted before and still is, now through the leaf branch, which is covered by 
new mkfifo tests that run on the platforms the build runs on. The junction 
behaviour cannot be exercised on those platforms, so the Windows-gated tests 
are the verification rather than a formality: they create a junction with 
mklink /J, which succeeds unprivileged on the CI runners, delete the enclosing 
tree, and assert the target's contents survive. Until they have run on Windows 
CI, the junction half of this change is implemented to the documented attribute 
behaviour, not demonstrated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to