Commits

Zhang Huangbin  committed 0ae9a1d

Code cleanup.

  • Participants
  • Parent commits d64e870

Comments (0)

Files changed (3)

File iRedMail/conf/global

 # Hostname used in MySQL GRANT command.
 # Usually it's 'localhost', but not in FreeBSD Jail (use ${LOCAL_ADDRESS} or
 # hostname of Jail instead).
-export SQL_HOSTNAME='localhost'
+if [ X"${LOCAL_ADDRESS}" == X'127.0.0.1' ]; then
+    export SQL_HOSTNAME='localhost'
+else
+    export SQL_HOSTNAME="${LOCAL_ADDRESS}"
+fi
 
 # OpenLDAP
 export LDAP_SERVER_HOST="${LOCAL_ADDRESS}"

File iRedMail/functions/mysql.sh

         ECHO_DEBUG "Grant access privilege from ${LOCAL_ADDRESS} ..."
         mysql -u${MYSQL_ROOT_USER} <<EOF
 -- Set root password
-UPDATE mysql.user SET Password = PASSWORD('${MYSQL_ROOT_PASSWD}') WHERE User = 'root';
+USE mysql;
+UPDATE user SET Password = PASSWORD('${MYSQL_ROOT_PASSWD}') WHERE User = 'root';
 -- Allow access from SQL_HOSTNAME with password
 GRANT ALL PRIVILEGES ON *.* TO '${MYSQL_ROOT_USER}'@'${SQL_HOSTNAME}' IDENTIFIED BY '${MYSQL_ROOT_PASSWD}';
+-- Allow GRANT privilege
+UPDATE user SET Grant_priv='Y' WHERE User='${MYSQL_ROOT_USER}' AND Host='${SQL_HOSTNAME}';
 EOF
     fi
 

File iRedMail/functions/packages_freebsd.sh

 OPTIONS_FILE_UNSET+=PGSQL
 OPTIONS_FILE_UNSET+=SQLITE
 OPTIONS_FILE_UNSET+=SQLITE3
-OPTIONS_FILE_UNSET+=ALWAYSTRUE
+OPTIONS_FILE_SET+=ALWAYSTRUE
 OPTIONS_FILE_UNSET+=AUTHDAEMOND
 OPTIONS_FILE_SET+=DEV_URANDOM
 OPTIONS_FILE_SET+=KEEP_DB_OPEN
 OPTIONS_FILE_UNSET+=OBSOLETE_CRAM_ATTR
 OPTIONS_FILE_UNSET+=CRAM
 OPTIONS_FILE_UNSET+=DIGEST
-OPTIONS_FILE_UNSET+=LOGIN
+OPTIONS_FILE_SET+=LOGIN
 OPTIONS_FILE_UNSET+=NTLM
 OPTIONS_FILE_UNSET+=OTP
-OPTIONS_FILE_UNSET+=PLAIN
+OPTIONS_FILE_SET+=PLAIN
 OPTIONS_FILE_UNSET+=SCRAM
 EOF