RFR: 8215916: The failure reason of an optional JAAS LoginModule is not logged [v11]

Weijun Wang weijun at openjdk.org
Thu Aug 18 13:48:27 UTC 2022


On Thu, 18 Aug 2022 13:18:15 GMT, Jayashree Huttanagoudar <duke at openjdk.org> wrote:

>> test/jdk/javax/security/auth/login/LoginContext/OptionalJaas/UnixNTPlatform.java line 85:
>> 
>>> 83:         byte[] byes = stream.toByteArray();
>>> 84:         String s = new String(byes);
>>> 85:         System.out.printf("-- error -- %n%s%n", s);
>> 
>> The test should ensure the stack trace is included in the debug output. Please check the content of `s`. Make sure this test succeeds after the code change and fails before it.
>
>> The test should ensure the stack trace is included in the debug output. Please check the content of `s`. Make sure this test succeeds after the code change and fails before it.
> 
> I have made an attempt to include what you suggested. I didn't get how will this test case fails without my fix. In other words this test case seems to pass overall with or without fix. The difference is with my fix the stack trace is printed and without the fix stack trace is not printed.

You can just call `if (!s.contains("Failed in attempt")) throw new RuntimeException()`. The substring should always be there in the "cross-platform" case. Maybe you can drop the other 2 cases since they are not related to this bug.

-------------

PR: https://git.openjdk.org/jdk/pull/9159



More information about the security-dev mailing list