Announcement

Collapse
No announcement yet.

Bug report : pts_test_installer.php breaks quoted args with internal spaces

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug report : pts_test_installer.php breaks quoted args with internal spaces

    There is a bug in the installer wrapper.
    When installing, for example, the sqlite test on CentOS 6, one of the parameters to gcc is:
    "-DPACKAGE_STRING=\"sqlite 3.7.3\""
    After this goes through the wrapper, this becomes two args:
    "-DPACKAGE_STRING=\"sqlite"
    "3.7.3\""
    which predictably fails.


    pts-core/objects/client/pts_test_installer.php at line 481 (in the 4.0 distro)

    479: // Write the main mask for the compiler
    480: file_put_contents($main_compiler,
    481: '#!/bin/bash' . PHP_EOL . 'COMPILER_OPTIONS="$@"' . PHP_EOL . $env_var_check . PHP_EOL . 'echo $COMPILER_OPTIONS >> ' . $mask_dir . $compiler_type . '-options-' . $compiler_name . PHP_EOL . $compiler_path . ' $COMPILER_OPTIONS' . PHP_EOL);


    change the final appearance of $COMPILER_OPTIONS to "$@" (with the quotes):

    '#!/bin/bash' . PHP_EOL . 'COMPILER_OPTIONS="$@"' . PHP_EOL . $env_var_check . PHP_EOL . 'echo $COMPILER_OPTIONS >> ' . $mask_dir . $compiler_type . '-options-' . $compiler_name . PHP_EOL . $compiler_path . ' "$@"' . PHP_EOL);

    this fixes it with no change in functionality.
    the same issue still exists in the current 4.2 download.

  • #2
    Originally posted by _rubio_ View Post
    There is a bug in the installer wrapper.
    When installing, for example, the sqlite test on CentOS 6, one of the parameters to gcc is:
    "-DPACKAGE_STRING=\"sqlite 3.7.3\""
    After this goes through the wrapper, this becomes two args:
    "-DPACKAGE_STRING=\"sqlite"
    "3.7.3\""
    which predictably fails.


    pts-core/objects/client/pts_test_installer.php at line 481 (in the 4.0 distro)

    479: // Write the main mask for the compiler
    480: file_put_contents($main_compiler,
    481: '#!/bin/bash' . PHP_EOL . 'COMPILER_OPTIONS="$@"' . PHP_EOL . $env_var_check . PHP_EOL . 'echo $COMPILER_OPTIONS >> ' . $mask_dir . $compiler_type . '-options-' . $compiler_name . PHP_EOL . $compiler_path . ' $COMPILER_OPTIONS' . PHP_EOL);


    change the final appearance of $COMPILER_OPTIONS to "$@" (with the quotes):

    '#!/bin/bash' . PHP_EOL . 'COMPILER_OPTIONS="$@"' . PHP_EOL . $env_var_check . PHP_EOL . 'echo $COMPILER_OPTIONS >> ' . $mask_dir . $compiler_type . '-options-' . $compiler_name . PHP_EOL . $compiler_path . ' "$@"' . PHP_EOL);

    this fixes it with no change in functionality.
    the same issue still exists in the current 4.2 download.
    Fixed in Git for 4.2, thanks.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment

    Working...
    X