Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6825240

Password.readPassword() echos the input when System.Console is null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • 9
    • 7
    • security-libs
    • None

      Password.readPassword() uses the Console.readPassword() method so that inputs are not echoed on screen. Unfortunately, System.console() goes null when stdin or stdout is redirected. While it's acceptable for the password to be read from a pipe when stdin is redirected, it seems not user-friendly when stdout is redirected and the password input shows on screen.

      $ keytool -export > cert
      Enter keystore password: topsecret

            weijun Weijun Wang
            weijun Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: