Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2065

Change 1482211 causes shell error if bin/openejb is given more than one argument

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.6.0
    • 4.7.0
    • None
    • Any OS with a POSIX shell (sh, ksh, bash, etc)

    Description

      $@ is always word-split, even inside doublequotes. Hence line 83:

      if [ "x$@" = "xdebug" ]; then

      throws a shell syntax error (in bash "too many arguments", in BSD sh "unexpected operator" ) if the script is given multiple arguments (such as those documented in README.txt) because "x$@" is expanded to x$1 $2 [...] $n NOT "x$1 $2 [...] $n"

      The cleanest fix is to change line 83 to:

      if [ "$1" = "debug" ]; then

      This is a precise check for whether the first argument to the script is "debug" and clearly that's the only relevant argument in such a case, as the "then" clause causes any other args to be ignored.

      Attachments

        1. openejb.patch
          1 kB
          Bill Cole

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            billcole Bill Cole
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified