Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable #863

Closed
wants to merge 3 commits into from

Conversation

toddjonker
Copy link
Contributor

@toddjonker toddjonker commented Jul 22, 2024

This is a clean backport of openjdk/jdk@36ac839 originally authored by @bplb and reviewed by @AlanBateman

It also includes this follow-up fix:

Additional testing:

  • New regression test fails without the fix, passes with it
  • linux-x86_64-server-release: JTREG_KEYWORDS="\!headful & \!external-dep & \!printer" make test TEST="tier1 tier2 tier3"

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • JDK-8317128 needs maintainer approval
  • Commit message must refer to an issue
  • JDK-8073061 needs maintainer approval

Issues

  • JDK-8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable (Bug - P4 - Approved)
  • JDK-8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException (Bug - P3 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/863/head:pull/863
$ git checkout pull/863

Update a local copy of the PR:
$ git checkout pull/863
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/863/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 863

View PR using the GUI difftool:
$ git pr show -t 863

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/863.diff

Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Jul 22, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 22, 2024

Hi @toddjonker, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user toddjonker" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Jul 22, 2024

@toddjonker This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable
8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException

Reviewed-by: phh

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 6 new commits pushed to the master branch:

  • 108c2e4: 8334166: Enable binary check
  • 5acb022: 6355567: AdobeMarkerSegment causes failure to read valid JPEG
  • 6196ed1: 8332113: Update nsk.share.Log to be always verbose
  • 785ae1f: 8315965: Open source various AWT applet tests
  • 7e7b0f3: 8312049: runtime/logging/ClassLoadUnloadTest can be improved
  • 8150179: 8242564: javadoc crashes:: class cast exception com.sun.tools.javac.code.Symtab$6

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@phohensee) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 36ac83904c9e81a01822b0e36ef677cae2808709 8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable Jul 22, 2024
@openjdk
Copy link

openjdk bot commented Jul 22, 2024

This backport pull request has now been updated with issue from the original commit.

@toddjonker
Copy link
Contributor Author

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Jul 23, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 23, 2024

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@toddjonker toddjonker marked this pull request as ready for review July 24, 2024 16:01
@toddjonker toddjonker marked this pull request as draft July 24, 2024 22:57
@toddjonker
Copy link
Contributor Author

Putting back into draft; I missed the follow-up fix https://bugs.openjdk.org/browse/JDK-8317128

…ccessDeniedException

6c6beba2569a2f9f3fd5d6988360ffd8680de821
@openjdk openjdk bot removed the clean label Jul 24, 2024
@toddjonker
Copy link
Contributor Author

/issue add 8317128

@openjdk
Copy link

openjdk bot commented Jul 24, 2024

@toddjonker
Adding additional issue to issue list: 8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException.

@toddjonker toddjonker marked this pull request as ready for review July 26, 2024 17:48
@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Aug 9, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 9, 2024
@mlbridge
Copy link

mlbridge bot commented Aug 9, 2024

Webrevs

@openjdk
Copy link

openjdk bot commented Aug 12, 2024

⚠️ @toddjonker This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@toddjonker
Copy link
Contributor Author

/approval request 8073061 Backport of data-loss defect in Files.copy(); originally authored by @bplb and reviewed by @AlanBateman
Passes headless tests tiers 1-3

@toddjonker
Copy link
Contributor Author

/approval request 8317128 Backport of bugfix for regression caused by JDK-8073061

Passes headless tests tiers 1-3

@openjdk
Copy link

openjdk bot commented Aug 12, 2024

@toddjonker
8073061: The approval request has been created successfully.
8317128: The approval request has been created successfully.

@openjdk
Copy link

openjdk bot commented Aug 12, 2024

@toddjonker
8073061: The approval request has been updated successfully.
8317128: The approval request has been updated successfully.

@openjdk openjdk bot added the approval label Aug 12, 2024
@toddjonker
Copy link
Contributor Author

/approval 8073061 request Backport of data-loss defect in Files.copy(); originally authored by @bplb and reviewed by @AlanBateman
Passes headless tests tiers 1-3

@toddjonker
Copy link
Contributor Author

/approval 8317128 request Backport of bugfix for regression caused by JDK-8073061

Passes headless tests tiers 1-3

@openjdk
Copy link

openjdk bot commented Aug 12, 2024

@toddjonker
8073061: The approval request has been updated successfully.

@openjdk
Copy link

openjdk bot commented Aug 12, 2024

@toddjonker
8317128: The approval request has been updated successfully.

@jerboaa
Copy link
Contributor

jerboaa commented Aug 13, 2024

/approve yes

@openjdk
Copy link

openjdk bot commented Aug 13, 2024

@jerboaa
8073061: The approval request has been approved.
8317128: The approval request has been approved.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels Aug 13, 2024
@toddjonker
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 13, 2024
@openjdk
Copy link

openjdk bot commented Aug 13, 2024

@toddjonker
Your change (at version a3bb19e) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 14, 2024

Going to push as commit 590715f.
Since your change was applied there have been 6 commits pushed to the master branch:

  • 108c2e4: 8334166: Enable binary check
  • 5acb022: 6355567: AdobeMarkerSegment causes failure to read valid JPEG
  • 6196ed1: 8332113: Update nsk.share.Log to be always verbose
  • 785ae1f: 8315965: Open source various AWT applet tests
  • 7e7b0f3: 8312049: runtime/logging/ClassLoadUnloadTest can be improved
  • 8150179: 8242564: javadoc crashes:: class cast exception com.sun.tools.javac.code.Symtab$6

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 14, 2024
@openjdk openjdk bot closed this Aug 14, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 14, 2024
@openjdk
Copy link

openjdk bot commented Aug 14, 2024

@shipilev @toddjonker Pushed as commit 590715f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@toddjonker toddjonker deleted the filedelete branch August 14, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants