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

JDK-8259786: initialize last parameter of getpwuid_r #2098

Closed
wants to merge 5 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Jan 15, 2021

We have a couple of calls to getpwuid_r in the codebase, like
g= getpwuid_r(getuid(), &resbuf, pwd_buf, sizeof(pwd_buf), &pwd);

Usually we NULL-check pwd after the call because we do not fully trust the return code of the function (it is documented in the codebase why we do not fully trust the return code) . However we miss to initialize pwd at some places before the call, which might we a little problematic and should be improved (at other places we already initialize it).

This triggers also Sonar warnings like :
https://sonarcloud.io/project/issues?id=jdk&open=AXaE0dsA8L9hkQskGEbA&resolved=false&types=BUG

Aside from this issue , should we in other issue , unify the OS versions of static char* get_user_name(uid_t uid) in posix code (currently we have it for bsd, linux, aix but the functions look very similar ?


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2098/head:pull/2098
$ git checkout pull/2098

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 15, 2021

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 15, 2021
@openjdk
Copy link

openjdk bot commented Jan 15, 2021

@MBaesken The following labels will be automatically applied to this pull request:

  • hotspot-runtime
  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added security security-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org labels Jan 15, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 15, 2021

Webrevs

@hseigel
Copy link
Member

hseigel commented Jan 15, 2021

Hi Matthias,
These changes look good, but could you hold off on making these changes until pull request #2037, which consolidates the perfMemory_{aix,bsd,linux].cpp files into one perfMemory_posix.cpp file, has been integrated?
Thanks, Harold

@MBaesken
Copy link
Member Author

Hi Matthias,
These changes look good, but could you hold off on making these changes until pull request #2037, which consolidates the perfMemory_{aix,bsd,linux].cpp files into one perfMemory_posix.cpp file, has been integrated?
Thanks, Harold

Hi Harold, thanks for reviewing . I will wait until your change is in .
Good to see that you already started consolidating the perfmem code into posix, my question

Aside from this issue , should we in other issue , unify the OS versions of static char* get_user_name(uid_t uid) in posix code
(currently we have it for bsd, linux, aix but the functions look very similar ?

was pointing into the same direction but looks like you already started the effort !
Thanks, Matthias

@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@MBaesken this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8259786
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Jan 20, 2021
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Jan 20, 2021
@openjdk openjdk bot removed the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 20, 2021
@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 20, 2021
@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@MBaesken 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:

8259786: initialize last parameter of getpwuid_r

Reviewed-by: mdoerr, hseigel

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 4 new commits pushed to the master branch:

  • 70b5b31: 8257664: HTMLEditorKit: Wrong CSS relative font sizes
  • 0b01d69: 8260005: Shenandoah: Remove unused AlwaysTrueClosure in ShenandoahConcurrentRootScanner::roots_do()
  • 0529480: 8259867: Move encoding checks into ZipCoder
  • 7c32ffe: 8258383: vmTestbase/gc/g1/unloading/tests/unloading_compilation_level[1,2,3] time out without TieredCompilation

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 20, 2021
Copy link
Member

@hseigel hseigel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good!
Thanks, Harold

@MBaesken
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Jan 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 20, 2021
@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@MBaesken Since your change was applied there have been 4 commits pushed to the master branch:

  • 70b5b31: 8257664: HTMLEditorKit: Wrong CSS relative font sizes
  • 0b01d69: 8260005: Shenandoah: Remove unused AlwaysTrueClosure in ShenandoahConcurrentRootScanner::roots_do()
  • 0529480: 8259867: Move encoding checks into ZipCoder
  • 7c32ffe: 8258383: vmTestbase/gc/g1/unloading/tests/unloading_compilation_level[1,2,3] time out without TieredCompilation

Your commit was automatically rebased without conflicts.

Pushed as commit 52ed2aa.

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

@MBaesken MBaesken deleted the JDK-8259786 branch Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated security security-dev@openjdk.org
3 participants