Carriage return characters are in the Tomcat/Jira Data Center JVM startup scripts

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Data Center - Other
    • None
    • 1

      Current situation:

      In Jira Data Center running on Linux, the scripts that start the Tomcat (catalina) process end up embedding a invalid character (carriage return, ASCII 0x0d) in the middle of the command line.

      ~$ cat /proc/${TOMCAT_PID}/cmdline | xxd | grep 0d
      000003e0: 2d55 4e4e 414d 4544 0d00 2d58 583a 496e  -UNNAMED..-XX:In 

      While this has not caused any malfunction in Jira or prevent it running, it can prevent some security scanning tools from being able to tell if Tomcat is running. It has noted to be present in 11.3.4 and 11.3.6 versions of Jira.

      Steps to reproduce:
      1. Start Jira Datacenter on a Linux host
      2. Determine the process ID of the Tomcat/Catalina process:
      TOMCAT_PID=$(ps auxww | grep -i catalina | grep -v grep | awk '{print $2}')
      3. Examine the virtual file /proc/${TOMCAT_PID}/cmdline with a hex editor and look for the carriage return (ASCII 0x0d) character:
      cat /proc/${TOMCAT_PID}/cmdline | xxd | grep 0d
      4. Note the carriage return character after the last "ALL-UNNAMED" entry in the command line.

      Workaround:

      Update /opt/atlassian/jira/bin/set-opens.sh and change the line:

      JVM_OPENS=$(cat $PRGDIR/java-opens.txt)

      to:

      JVM_OPENS=$(tr -d '\r' < $PRGDIR/java-opens.txt)

      which will strip out any carriage return characters in Linux only

              Assignee:
              Unassigned
              Reporter:
              Mateo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: