Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10966

Wildfly Elytron Tool, credential-store command doesn't support redirection (<, <<) when multiple options are missing which show prompts.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.DR19
    • 7.1.0.DR18
    • Security
    • None

    Description

      Wildfly Elytron Tool, credential-store command doesn't support redirection (<, <<) when multiple options are missing which show prompts.

      User omit --password and --secret options and then get two (four: there is confirmation) prompts but user isn't able to redirect data to second one.

      Expected behaviour is that it must work.

      It is general problem, but other commands have only one option with prompt.

      How to reproduce

      java -jar  wildfly-elytron-tool.jar credential-store --add secret_alias --create -l cs001.jceks  --summary << EOF
      pass123
      pass123
      secret_value
      secret_value
      EOF
      

      has this output:

      Exception encountered executing the command:
      java.lang.Exception: java.io.IOException: Stream closed
              at org.wildfly.security.tool.Command.prompt(Command.java:115)
              at org.wildfly.security.tool.CredentialStoreCommand.execute(CredentialStoreCommand.java:184)
              at org.wildfly.security.tool.ElytronTool.main(ElytronTool.java:75)
      Caused by: java.io.IOException: Stream closed
              at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170)
              at java.io.BufferedInputStream.read(BufferedInputStream.java:336)
              at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
              at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
              at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
              at java.io.InputStreamReader.read(InputStreamReader.java:184)
              at java.io.BufferedReader.fill(BufferedReader.java:161)
              at java.io.BufferedReader.readLine(BufferedReader.java:324)
              at java.io.BufferedReader.readLine(BufferedReader.java:389)
              at org.wildfly.security.tool.Command.prompt(Command.java:100)
              ... 2 more
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-ivassile Ilia Vassilev
              hsvabek_jira Hynek Švábek (Inactive)
              Hynek Švábek Hynek Švábek (Inactive)
              Hynek Švábek Hynek Švábek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: