[Groonga-mysql-commit] mroonga/mroonga at b4e1206 [master] Fix not using eval

Back to archive index

yoku0825 null+****@clear*****
Mon Nov 2 14:54:36 JST 2015


yoku0825	2015-11-02 14:54:36 +0900 (Mon, 02 Nov 2015)

  New Revision: b4e120636fc767c4f33d7ec72bfcfb34976b17d5
  https://github.com/mroonga/mroonga/commit/b4e120636fc767c4f33d7ec72bfcfb34976b17d5

  Merged a378bb1: Merge pull request #80 from yoku0825/fix_not_using_eval_in_rpm

  Message:
    Fix not using eval

  Modified files:
    packages/rpm/centos/mysql57-community-mroonga.spec.in

  Modified: packages/rpm/centos/mysql57-community-mroonga.spec.in (+3 -11)
===================================================================
--- packages/rpm/centos/mysql57-community-mroonga.spec.in    2015-11-01 11:52:52 +0900 (42997a3)
+++ packages/rpm/centos/mysql57-community-mroonga.spec.in    2015-11-02 14:54:36 +0900 (f257c28)
@@ -146,25 +146,17 @@ if [ "$1" = 2 ] ; then
 fi
 
 if [ -n "$password_option" -a "$stop_after_installation" = "1" ]; then
-  sql="ALTER USER user() IDENTIFIED BY '$auto_generated_password'"
-  command="$mysql_command -u root -p'$auto_generated_password' \
-    --connect-expired-password -e \"$sql\""
-  # TODO: Remove needless "eval" use
-  eval $command
-  password_option="-p'$auto_generated_password'"
+  $mysql_command -u root -p"$auto_generated_password" --connect-expired-password -e "ALTER USER user() IDENTIFIED BY '$auto_generated_password'"
 fi
 
-command="$mysql_command -u root $password_option < ${install_sql}"
+command="$mysql_command -u root $password_option'$auto_generated_password' < ${install_sql}"
 echo $command
 eval $command || \
 	(echo "run the following command to register Mroonga:"; \
 	 echo "  $command")
 
 if [ "$stop_after_installation" = "1" ]; then
-  sql="ALTER USER root �� localhost PASSWORD EXPIRE"
-  command="$mysql_command -u root -p'$auto_generated_password' -e \"$sql\""
-  # TODO: Remove needless "eval" use
-  eval $command
+  $mysql_command -u root -p"$auto_generated_password" -e "ALTER USER root �� localhost PASSWORD EXPIRE"
   /sbin/service mysqld stop
 fi
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index