Re: RFR: JDK-8259786: initialize last parameter of getpwuid_r [v4]
On Wed, 20 Jan 2021 12:05:03 GMT, Matthias Baesken wrote: >> We have a couple of calls to getpwuid_r in the codebase, like >> g= getpwuid_r(getuid(), , pwd_buf, sizeof(pwd_buf), ); >> >> 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=AXaE0dsA8L9hkQskGEbA=false=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 ? > > Matthias Baesken has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains five commits: > > - bring initialization to perfMemory_posix > - Merge branch 'master' into JDK-8259786 > - More revert > - revert perfMemory changes > - JDK-8259786 Changes look good! Thanks, Harold - Marked as reviewed by hseigel (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/2098
Re: RFR: JDK-8259786: initialize last parameter of getpwuid_r [v4]
On Wed, 20 Jan 2021 12:05:03 GMT, Matthias Baesken wrote: >> We have a couple of calls to getpwuid_r in the codebase, like >> g= getpwuid_r(getuid(), , pwd_buf, sizeof(pwd_buf), ); >> >> 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=AXaE0dsA8L9hkQskGEbA=false=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 ? > > Matthias Baesken has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains five commits: > > - bring initialization to perfMemory_posix > - Merge branch 'master' into JDK-8259786 > - More revert > - revert perfMemory changes > - JDK-8259786 Marked as reviewed by mdoerr (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/2098
Re: RFR: JDK-8259786: initialize last parameter of getpwuid_r [v4]
> We have a couple of calls to getpwuid_r in the codebase, like > g= getpwuid_r(getuid(), , pwd_buf, sizeof(pwd_buf), ); > > 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=AXaE0dsA8L9hkQskGEbA=false=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 ? Matthias Baesken has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: - bring initialization to perfMemory_posix - Merge branch 'master' into JDK-8259786 - More revert - revert perfMemory changes - JDK-8259786 - Changes: https://git.openjdk.java.net/jdk/pull/2098/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=2098=03 Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/2098.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2098/head:pull/2098 PR: https://git.openjdk.java.net/jdk/pull/2098