]> source.dussan.org Git - sonarqube.git/commitdiff
Fix minor safety issues in built-in patches (#3155)
authorJanos Gyerik <janos.gyerik@sonarsource.com>
Thu, 15 Mar 2018 11:05:01 +0000 (12:05 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Mar 2018 11:05:01 +0000 (12:05 +0100)
* Add shebang line for all patches

* Properly double-quote variables used on the command line

* Use different debug port for debug CE and Web

* Add double-quotes around long -agentlib option too

scripts/patches/README.md
scripts/patches/debug_ce.sh
scripts/patches/debug_web.sh
scripts/patches/mysql.sh
scripts/patches/postgres.sh

index 709c7bb81d515591e0c8ecd2924d58829f526c4b..25db7196408e68283962f1b58a46e17c6f521261 100644 (file)
@@ -34,8 +34,9 @@ Example scripts
 
     SQ_HOME=$1
 
-    echo "enabling debug in conf/sonar.properties, listening on port 5005"
-    set_property sonar.web.javaAdditionalOpts -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 "$SQ_HOME/conf/sonar.properties"
+    port=5005
+    echo "enabling debug in conf/sonar.properties, listening on port $port"
+    set_property sonar.web.javaAdditionalOpts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$port" "$SQ_HOME/conf/sonar.properties"
 
 ### Views
 
index aafeadaf8c76029b1b949a44692783b38e1b042a..f0ea04eb9c37a475d3ec8e4210304704073ee9a6 100755 (executable)
@@ -1,8 +1,11 @@
+#!/usr/bin/env bash
+
 set -euo pipefail
 
 source scripts/property_utils.sh
 
 SQ_HOME=$1
 
-echo "enabling debug on compute engine, listening on port 5005"
-set_property sonar.ce.javaAdditionalOpts -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 $SQ_HOME/conf/sonar.properties
+port=5006
+echo "enabling debug on compute engine, listening on port $port"
+set_property sonar.ce.javaAdditionalOpts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$port" "$SQ_HOME/conf/sonar.properties"
index 831a6dd5b17adf7fa2bf85639563cd2837871bea..ae06f2b9485ce3eb409b0ff9e6c0819a273ac359 100755 (executable)
@@ -1,8 +1,11 @@
+#!/usr/bin/env bash
+
 set -euo pipefail
 
 source scripts/property_utils.sh
 
 SQ_HOME=$1
 
-echo "enabling debug on web server, listening on port 5005"
-set_property sonar.web.javaAdditionalOpts -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 $SQ_HOME/conf/sonar.properties
+port=5005
+echo "enabling debug on web server, listening on port $port"
+set_property sonar.web.javaAdditionalOpts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$port" "$SQ_HOME/conf/sonar.properties"
index 59931e77b94ad738cbb247fa75f299a8d63df7d8..ce0f260d6159a7e73bbec9cae18b8995db22ee99 100755 (executable)
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 set -euo pipefail
 
 source scripts/property_utils.sh
@@ -5,6 +7,6 @@ source scripts/property_utils.sh
 SQ_HOME=$1
 
 echo "configuring mysql"
-set_property sonar.jdbc.url "jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" $SQ_HOME/conf/sonar.properties
-set_property sonar.jdbc.username sonarqube $SQ_HOME/conf/sonar.properties
-set_property sonar.jdbc.password sonarqube $SQ_HOME/conf/sonar.properties
+set_property sonar.jdbc.url "jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" "$SQ_HOME/conf/sonar.properties"
+set_property sonar.jdbc.username sonarqube "$SQ_HOME/conf/sonar.properties"
+set_property sonar.jdbc.password sonarqube "$SQ_HOME/conf/sonar.properties"
index 0f3b10559ac6ca2f809a97b13bfb2363bf360799..5465c4584680a2e81ae41d799042c3dd7bd7cd63 100755 (executable)
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 set -euo pipefail
 
 source scripts/property_utils.sh
@@ -5,6 +7,6 @@ source scripts/property_utils.sh
 SQ_HOME=$1
 
 echo "configuring postgres"
-set_property sonar.jdbc.url jdbc:postgresql://localhost:5432/sonarqube $SQ_HOME/conf/sonar.properties
-set_property sonar.jdbc.username sonarqube $SQ_HOME/conf/sonar.properties
-set_property sonar.jdbc.password sonarqube $SQ_HOME/conf/sonar.properties
+set_property sonar.jdbc.url jdbc:postgresql://localhost:5432/sonarqube "$SQ_HOME/conf/sonar.properties"
+set_property sonar.jdbc.username sonarqube "$SQ_HOME/conf/sonar.properties"
+set_property sonar.jdbc.password sonarqube "$SQ_HOME/conf/sonar.properties"