Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4094

Syntax error in columnstore-post-install in 1.5.2: -bash: [: too many arguments

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.5.2
    • 6.3.1
    • None
    • None
    • 2021-17

    Description

      columnstore-post-install has a syntax error in 1.5.2. The problem is with the following line:

      https://github.com/mariadb-corporation/mariadb-columnstore-engine/blob/columnstore-1.5.2-1/oam/install_scripts/columnstore-post-install.in#L18

      It results in errors like this:

      /usr/bin/columnstore-post-install: line 18: [: too many arguments
      strings: /proc/1502/environ: Permission denied
      strings: '/proc/0/environ': No such file
      error: process ID out of range
      

      The problem appears to happen because $pid is not surrounded in quotes.

      It is easy enough to reproduce with the following bash snippet:

      $ while [ -z "$ENV_VAR" -a $pid != 1 ]; do
      > ENV_VAR=test
      > pid=2
      > done
      -bash: [: too many arguments
      

      It is fixed by quoting $pid. For example:

      $ while [ -z "$ENV_VAR" -a "$pid" != 1 ]; do
      > ENV_VAR=test
      > pid=2
      > done
      

      This is with the following bash version and OS:

      $ bash --version
      GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
      Copyright (C) 2016 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
       
      This is free software; you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
      $ cat /etc/os-release 
      NAME="Ubuntu"
      VERSION="18.04.3 LTS (Bionic Beaver)"
      ID=ubuntu
      ID_LIKE=debian
      PRETTY_NAME="Ubuntu 18.04.3 LTS"
      VERSION_ID="18.04"
      HOME_URL="https://www.ubuntu.com/"
      SUPPORT_URL="https://help.ubuntu.com/"
      BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
      PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
      VERSION_CODENAME=bionic
      UBUNTU_CODENAME=bionic
      

      Attachments

        Issue Links

          Activity

            People

              GeoffMontee Geoff Montee (Inactive)
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.