Commit 1db1340c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-14578: mysql_install_db install unix_socket plugin when...

MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket

post-merge fixes
parent 53db5edb
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
-- Fill "user" table with default users allowing root access -- Fill "user" table with default users allowing root access
-- from local machine if "user" table didn't exist before -- from local machine if "user" table didn't exist before
CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE user; 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' @@ -51,9 +41,6 @@ INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'
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); IF @auth_root_socket is not null THEN
-- More secure root account using unix sucket auth. IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN
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); INSTALL SONAME 'auth_socket'; END IF; END IF;
--- Anonymous user with no privileges. --- Anonymous user with no privileges.
-INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost',''); -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'; -INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
......
...@@ -174,6 +174,7 @@ IF(INSTALL_LAYOUT MATCHES "STANDALONE") ...@@ -174,6 +174,7 @@ IF(INSTALL_LAYOUT MATCHES "STANDALONE")
SET(scriptdir ${prefix}/${INSTALL_BINDIR}) SET(scriptdir ${prefix}/${INSTALL_BINDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
SET(localstatedir ${prefix}/data) SET(localstatedir ${prefix}/data)
ELSE() ELSE()
SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(prefix "${CMAKE_INSTALL_PREFIX}")
...@@ -182,6 +183,7 @@ ELSE() ...@@ -182,6 +183,7 @@ ELSE()
SET(scriptdir ${INSTALL_BINDIRABS}) SET(scriptdir ${INSTALL_BINDIRABS})
SET(libexecdir ${INSTALL_SBINDIRABS}) SET(libexecdir ${INSTALL_SBINDIRABS})
SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS}) SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS})
SET(pkgplugindir ${INSTALL_PLUGINDIRABS})
SET(localstatedir ${MYSQL_DATADIR}) SET(localstatedir ${MYSQL_DATADIR})
ENDIF() ENDIF()
......
...@@ -307,7 +307,7 @@ then ...@@ -307,7 +307,7 @@ then
langdir="$basedir/sql/share/english" langdir="$basedir/sql/share/english"
srcpkgdatadir="$srcdir/scripts" srcpkgdatadir="$srcdir/scripts"
buildpkgdatadir="$builddir/scripts" buildpkgdatadir="$builddir/scripts"
plugindir="$builddir/plugin/auth_socket/" plugindir="$builddir/plugin/auth_socket"
elif test -n "$basedir" elif test -n "$basedir"
then then
bindir="$basedir/bin" # only used in the help text bindir="$basedir/bin" # only used in the help text
...@@ -336,7 +336,7 @@ then ...@@ -336,7 +336,7 @@ then
cannot_find_file fill_help_tables.sql @pkgdata_locations@ cannot_find_file fill_help_tables.sql @pkgdata_locations@
exit 1 exit 1
fi fi
plugindir="$basedir/@INSTALL_PLUGINDIR@" plugindir=`find_in_dirs --dir auth_socket.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin`
else else
basedir="@prefix@" basedir="@prefix@"
bindir="@bindir@" bindir="@bindir@"
...@@ -344,7 +344,7 @@ else ...@@ -344,7 +344,7 @@ else
mysqld="@libexecdir@/mysqld" mysqld="@libexecdir@/mysqld"
srcpkgdatadir="@pkgdatadir@" srcpkgdatadir="@pkgdatadir@"
buildpkgdatadir="@pkgdatadir@" buildpkgdatadir="@pkgdatadir@"
plugindir="@INSTALL_PLUGINDIR@" plugindir="@pkgplugindir@"
fi fi
# Set up paths to SQL scripts required for bootstrap # Set up paths to SQL scripts required for bootstrap
......
...@@ -48,11 +48,9 @@ REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y' ...@@ -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); 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. -- 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); 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 @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
IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN INSTALL SONAME 'auth_socket'; END IF; END IF;
INSTALL SONAME 'auth_socket'; END IF; END IF; END IF;
-- Anonymous user with no privileges. -- Anonymous user with no privileges.
INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost',''); 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'; INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment