RFR: 8339347: keytool -importpass insists prompting the user even if there is no terminal

Hai-May Chao hchao at openjdk.org
Wed Sep 4 23:29:49 UTC 2024


On Wed, 4 Sep 2024 16:10:50 GMT, Hai-May Chao <hchao at openjdk.org> wrote:

> Given the changes to the System.console() behavior, where it no longer returns null when a write pipe is connected to the Java process, keytool needs to be updated to determine whether an interactive terminal is attached.

The `Password::readPassword(InputStream in, boolean isEchoOn)` is used to control whether characters are echoed on the screen as the user types the password. In this `keytool` use case, `Password::readPassword(InputStream in)` works as expected (i.e. reading passwords from stdin without any need to control echo), and I'd think additional echo handling seems not relevant here.

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

PR Comment: https://git.openjdk.org/jdk/pull/20855#issuecomment-2330317128


More information about the security-dev mailing list