diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-06-18 11:51:27 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-06-21 10:15:27 +0200 |
commit | 1db1340c0c5302e16c88528d89f583f4f1b7bc90 (patch) | |
tree | acea1e8310de537d8988db94f5de3cca0c1bb6b4 | |
parent | 53db5edbcf7cc736e9102f3b5c15907278c42450 (diff) | |
download | mariadb-git-1db1340c0c5302e16c88528d89f583f4f1b7bc90.tar.gz |
MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
post-merge fixes
-rwxr-xr-x | debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch | 8 | ||||
-rw-r--r-- | scripts/CMakeLists.txt | 2 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 6 | ||||
-rw-r--r-- | scripts/mysql_system_tables_data.sql | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch b/debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch index 183212ef678..a961cfce8a0 100755 --- a/debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch +++ b/debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch @@ -27,10 +27,10 @@ -- Fill "user" table with default users allowing root access -- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE user; -@@ -48,9 +38,6 @@ REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y' - REPLACE INTO tmp_user_nopasswd VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0); - -- More secure root account using unix sucket auth. - INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),'','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'unix_socket','','N', 'N','', 0); +@@ -51,9 +41,6 @@ INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root' + IF @auth_root_socket is not null THEN + IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN + INSTALL SONAME 'auth_socket'; END IF; END IF; --- Anonymous user with no privileges. -INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index fc133f53b37..fb09e459f87 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -174,6 +174,7 @@ IF(INSTALL_LAYOUT MATCHES "STANDALONE") SET(scriptdir ${prefix}/${INSTALL_BINDIR}) SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) + SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR}) SET(localstatedir ${prefix}/data) ELSE() SET(prefix "${CMAKE_INSTALL_PREFIX}") @@ -182,6 +183,7 @@ ELSE() SET(scriptdir ${INSTALL_BINDIRABS}) SET(libexecdir ${INSTALL_SBINDIRABS}) SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS}) + SET(pkgplugindir ${INSTALL_PLUGINDIRABS}) SET(localstatedir ${MYSQL_DATADIR}) ENDIF() diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9e3bc35423a..0a596e1e03b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -307,7 +307,7 @@ then langdir="$basedir/sql/share/english" srcpkgdatadir="$srcdir/scripts" buildpkgdatadir="$builddir/scripts" - plugindir="$builddir/plugin/auth_socket/" + plugindir="$builddir/plugin/auth_socket" elif test -n "$basedir" then bindir="$basedir/bin" # only used in the help text @@ -336,7 +336,7 @@ then cannot_find_file fill_help_tables.sql @pkgdata_locations@ exit 1 fi - plugindir="$basedir/@INSTALL_PLUGINDIR@" + plugindir=`find_in_dirs --dir auth_socket.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin` else basedir="@prefix@" bindir="@bindir@" @@ -344,7 +344,7 @@ else mysqld="@libexecdir@/mysqld" srcpkgdatadir="@pkgdatadir@" buildpkgdatadir="@pkgdatadir@" - plugindir="@INSTALL_PLUGINDIR@" + plugindir="@pkgplugindir@" fi # Set up paths to SQL scripts required for bootstrap diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index e5efd48f918..2835a7f8b77 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -48,11 +48,9 @@ REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y' REPLACE INTO tmp_user_nopasswd VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0); -- More secure root account using unix socket auth. INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),'','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'unix_socket','','N', 'N','', 0); --- Need aria support to lookup information_schema.plugins (result is tmptable) IF @auth_root_socket is not null THEN - IF exists (SELECT 1 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'aria' AND support IN ('YES', 'DEFAULT', 'ENABLED')) THEN - IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN - INSTALL SONAME 'auth_socket'; END IF; END IF; END IF; + IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN + INSTALL SONAME 'auth_socket'; END IF; END IF; -- Anonymous user with no privileges. INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost',''); INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; |