[ 
https://issues.apache.org/jira/browse/GROOVY-12359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111841#comment-18111841
 ] 

ASF GitHub Bot commented on GROOVY-12359:
-----------------------------------------

codecov-commenter commented on PR #2880:
URL: https://github.com/apache/groovy/pull/2880#issuecomment-5551438744

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2880?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `71.42857%` with `6 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 71.0984%. Comparing base 
([`65ac2ab`](https://app.codecov.io/gh/apache/groovy/commit/65ac2abf7554b4d6622527739c9338bc94ba4047?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`3ea1a65`](https://app.codecov.io/gh/apache/groovy/commit/3ea1a659b438805ce94fe9e1cad28f82fda50438?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2880?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...codehaus/groovy/runtime/ResourceGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FResourceGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvUmVzb3VyY2VHcm9vdnlNZXRob2RzLmphdmE=)
 | 72.7273% | [2 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...rg/apache/groovy/nio/extensions/NioExtensions.java](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&filepath=subprojects%2Fgroovy-nio%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fnio%2Fextensions%2FNioExtensions.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LW5pby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ3Jvb3Z5L25pby9leHRlbnNpb25zL05pb0V4dGVuc2lvbnMuamF2YQ==)
 | 70.0000% | [2 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2880/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2880        +/-   ##
   ==================================================
   + Coverage     71.0924%   71.0984%   +0.0060%     
   - Complexity      37341      37349         +8     
   ==================================================
     Files            1579       1579                
     Lines          135466     135477        +11     
     Branches        25100      25104         +4     
   ==================================================
   + Hits            96306      96322        +16     
   + Misses          30484      30480         -4     
   + Partials         8676       8675         -1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2880?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...codehaus/groovy/runtime/ResourceGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FResourceGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvUmVzb3VyY2VHcm9vdnlNZXRob2RzLmphdmE=)
 | `82.3529% <72.7273%> (-0.4130%)` | :arrow_down: |
   | 
[...rg/apache/groovy/nio/extensions/NioExtensions.java](https://app.codecov.io/gh/apache/groovy/pull/2880?src=pr&el=tree&filepath=subprojects%2Fgroovy-nio%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fnio%2Fextensions%2FNioExtensions.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LW5pby9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ3Jvb3Z5L25pby9leHRlbnNpb25zL05pb0V4dGVuc2lvbnMuamF2YQ==)
 | `65.3933% <70.0000%> (+0.3933%)` | :arrow_up: |
   
   ... and [7 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2880/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> deleteDir: treat Windows directory junctions as leaves, as symbolic links 
> already are
> -------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12359
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12359
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> Since GROOVY-12125, {{File.deleteDir()}} and the {{groovy-nio}} 
> {{Path.deleteDir()}} treat a symbolic link as a leaf: the link is removed, 
> and the directory it points at is not entered. The guard is 
> {{Files.isSymbolicLink}}, and its own comment records the gap this ticket 
> closes:
> {code:java}
> // never follow a symbolic link into its target; remove the link itself.
> // Note: Files.isSymbolicLink does not detect Windows directory junctions
> // (reparse points), which are therefore still traversed.
> {code}
> A junction inside a tree being deleted is followed, and the *target's* 
> contents are deleted. Two things make this the half of the link problem worth 
> code rather than documentation:
> * creating a junction needs no privilege — {{mklink /J}} works for any user, 
> where Windows symbolic links require a privilege most users do not hold, so 
> the unprivileged local actor's tool is exactly the one the guard misses;
> * it needs no timing — a junction is planted in advance and waits, unlike the 
> check-then-delete race, which requires writing into the tree concurrently 
> during deletion and is out of scope here (the threat model's local adversary 
> is not granted that; addressed separately).
> h3. Proposed change
> Replace the symlink-only test at both decision points (the root check and the 
> per-child check) in both implementations with an attribute read that refuses 
> to treat any reparse point as an ordinary directory:
> {code:java}
> BasicFileAttributes attrs = Files.readAttributes(path, 
> BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
> boolean leaf = attrs.isSymbolicLink() || attrs.isOther();   // symlink, 
> junction, or other reparse point
> {code}
> On POSIX, {{isOther()}} is false for ordinary files and directories, so 
> behaviour there does not change. A junction is then deleted as the link node 
> it is, matching the existing symlink behaviour.
> h3. Verification
> Junctions do not exist on POSIX, so this cannot be exercised on the 
> development machine; the expected {{isOther()}} attribute behaviour for a 
> junction is confirmed by the test rather than assumed in advance. The 
> regression test is Windows-gated: it creates a junction with {{cmd /c mklink 
> /J}} — which succeeds unprivileged on the CI runners — points it at a 
> directory holding a marker file, deletes the enclosing tree, and asserts the 
> marker survives and the junction node is gone. On other platforms the test is 
> skipped; the existing symlink tests from GROOVY-12125 continue to cover the 
> POSIX side.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to