Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira Legacy
serverJIRA (pbspro.atlassian.net)
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId32008a99-7831-3ff8-9638-3db0cd01164d
keyPP-464

Issue:

When any of the job's attributes has a quote (") in it's value it causes problems to the applications that read the accounting logs as the quotes in the values are not escaped before they get stored in the accounting logs.

...

Before writing to the accounting logs, values of the attributes should be parsed to find if the value needs to be enclosed within quotes or not.

For each value to be recorded in the accounting logs -
  1. need_quotes = 0
  2. if (value has characters that are not alphanumeric)
           need_quotes = 1
  3. if (need_quotes)

                 make quote (") as the first character to be stored for the value.

                 for (each escape character in the value)
                        replace it with two escape characters.

                 for (each quote in the value)

                        replace it with escaped quote (\”)

          else
                 record value without quotes.

B) Reading from the accounting logs.
While reading the values
  1. if (value enclosed within quotes)

                 if (current character is an escape)

                       copy next character to the value.

                 if (current character is an escaped quote)

                       copy only a quote to the value.

                 if (current character is a non-escaped quote)

                       we have reached end of the string, do not copy this quote to the value.

          else

                 copy the value as-is.