Merge pull request #87878 from Izorkin/mariadb-update

mariadb: 10.4.12 -> 10.4.13
This commit is contained in:
Florian Klink 2020-06-05 15:15:36 +02:00 committed by GitHub
commit 47d4cd2c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 87 additions and 38 deletions

View File

@ -5,20 +5,34 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
}; };
nodes = { nodes = {
mysql = mysql57 =
{ pkgs, ... }: { pkgs, ... }:
{ {
users.users.testuser = { };
users.users.testuser2 = { };
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.initialDatabases = [ services.mysql.initialDatabases = [
{ name = "testdb"; schema = ./testdb.sql; } { name = "testdb3"; schema = ./testdb.sql; }
{ name = "empty_testdb"; }
]; ];
# note that using pkgs.writeText here is generally not a good idea, # note that using pkgs.writeText here is generally not a good idea,
# as it will store the password in world-readable /nix/store ;) # as it will store the password in world-readable /nix/store ;)
services.mysql.initialScript = pkgs.writeText "mysql-init.sql" '' services.mysql.initialScript = pkgs.writeText "mysql-init.sql" ''
CREATE USER 'passworduser'@'localhost' IDENTIFIED BY 'password123'; CREATE USER 'testuser3'@'localhost' IDENTIFIED BY 'secure';
GRANT ALL PRIVILEGES ON testdb3.* TO 'testuser3'@'localhost';
''; '';
services.mysql.ensureDatabases = [ "testdb" "testdb2" ];
services.mysql.ensureUsers = [{
name = "testuser";
ensurePermissions = {
"testdb.*" = "ALL PRIVILEGES";
};
} {
name = "testuser2";
ensurePermissions = {
"testdb2.*" = "ALL PRIVILEGES";
};
}];
services.mysql.package = pkgs.mysql57; services.mysql.package = pkgs.mysql57;
}; };
@ -30,16 +44,30 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
# Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled # Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
users.users.testuser = { };
users.users.testuser2 = { };
services.mysql.enable = true; services.mysql.enable = true;
services.mysql.initialDatabases = [ services.mysql.initialDatabases = [
{ name = "testdb"; schema = ./testdb.sql; } { name = "testdb3"; schema = ./testdb.sql; }
{ name = "empty_testdb"; }
]; ];
# note that using pkgs.writeText here is generally not a good idea, # note that using pkgs.writeText here is generally not a good idea,
# as it will store the password in world-readable /nix/store ;) # as it will store the password in world-readable /nix/store ;)
services.mysql.initialScript = pkgs.writeText "mysql-init.sql" '' services.mysql.initialScript = pkgs.writeText "mysql-init.sql" ''
CREATE USER 'passworduser'@'localhost' IDENTIFIED BY 'password123'; CREATE USER 'testuser3'@'localhost' IDENTIFIED BY 'secure';
GRANT ALL PRIVILEGES ON testdb3.* TO 'testuser3'@'localhost';
''; '';
services.mysql.ensureDatabases = [ "testdb" "testdb2" ];
services.mysql.ensureUsers = [{
name = "testuser";
ensurePermissions = {
"testdb.*" = "ALL PRIVILEGES";
};
} {
name = "testuser2";
ensurePermissions = {
"testdb2.*" = "ALL PRIVILEGES";
};
}];
services.mysql.package = pkgs.mysql80; services.mysql.package = pkgs.mysql80;
}; };
@ -81,17 +109,49 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
testScript = '' testScript = ''
start_all() start_all()
mysql.wait_for_unit("mysql") mysql57.wait_for_unit("mysql")
mysql.succeed("echo 'use empty_testdb;' | mysql -u root") mysql57.succeed(
mysql.succeed("echo 'use testdb; select * from tests;' | mysql -u root -N | grep 4") "echo 'use testdb; create table tests (test_id INT, PRIMARY KEY (test_id));' | sudo -u testuser mysql -u testuser"
# ';' acts as no-op, just check whether login succeeds with the user created from the initialScript )
mysql.succeed("echo ';' | mysql -u passworduser --password=password123") mysql57.succeed(
"echo 'use testdb; insert into tests values (41);' | sudo -u testuser mysql -u testuser"
)
# Ensure testuser2 is not able to insert into testdb as mysql testuser2
mysql57.fail(
"echo 'use testdb; insert into tests values (22);' | sudo -u testuser2 mysql -u testuser2"
)
# Ensure testuser2 is not able to authenticate as mysql testuser
mysql57.fail(
"echo 'use testdb; insert into tests values (22);' | sudo -u testuser2 mysql -u testuser"
)
mysql57.succeed(
"echo 'use testdb; select test_id from tests;' | sudo -u testuser mysql -u testuser -N | grep 41"
)
mysql57.succeed(
"echo 'use testdb3; select * from tests;' | mysql -u testuser3 --password=secure -N | grep 4"
)
mysql80.wait_for_unit("mysql") mysql80.wait_for_unit("mysql")
mysql80.succeed("echo 'use empty_testdb;' | mysql -u root") mysql80.succeed(
mysql80.succeed("echo 'use testdb; select * from tests;' | mysql -u root -N | grep 4") "echo 'use testdb; create table tests (test_id INT, PRIMARY KEY (test_id));' | sudo -u testuser mysql -u testuser"
# ';' acts as no-op, just check whether login succeeds with the user created from the initialScript )
mysql80.succeed("echo ';' | mysql -u passworduser --password=password123") mysql80.succeed(
"echo 'use testdb; insert into tests values (41);' | sudo -u testuser mysql -u testuser"
)
# Ensure testuser2 is not able to insert into testdb as mysql testuser2
mysql80.fail(
"echo 'use testdb; insert into tests values (22);' | sudo -u testuser2 mysql -u testuser2"
)
# Ensure testuser2 is not able to authenticate as mysql testuser
mysql80.fail(
"echo 'use testdb; insert into tests values (22);' | sudo -u testuser2 mysql -u testuser"
)
mysql80.succeed(
"echo 'use testdb; select test_id from tests;' | sudo -u testuser mysql -u testuser -N | grep 41"
)
mysql80.succeed(
"echo 'use testdb3; select * from tests;' | mysql -u testuser3 --password=secure -N | grep 4"
)
mariadb.wait_for_unit("mysql") mariadb.wait_for_unit("mysql")
mariadb.succeed( mariadb.succeed(

View File

@ -1,12 +0,0 @@
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt
index a556b870..918a26f9 100644
--- a/plugin/auth_pam/CMakeLists.txt
+++ b/plugin/auth_pam/CMakeLists.txt
@@ -22,7 +22,6 @@ IF(HAVE_PAM_APPL_H)
COMPONENT Server)
ENDIF()
IF(TARGET auth_pam OR TARGET auth_pam_v1)
- ADD_SUBDIRECTORY(testing)
ADD_LIBRARY(pam_user_map MODULE mapper/pam_user_map.c)
TARGET_LINK_LIBRARIES(pam_user_map pam)
SET_TARGET_PROPERTIES (pam_user_map PROPERTIES PREFIX "")

View File

@ -23,14 +23,14 @@ mariadb = server // {
}; };
common = rec { # attributes common to both builds common = rec { # attributes common to both builds
version = "10.4.12"; version = "10.4.13";
src = fetchurl { src = fetchurl {
urls = [ urls = [
"https://downloads.mariadb.org/f/mariadb-${version}/source/mariadb-${version}.tar.gz" "https://downloads.mariadb.org/f/mariadb-${version}/source/mariadb-${version}.tar.gz"
"https://downloads.mariadb.com/MariaDB/mariadb-${version}/source/mariadb-${version}.tar.gz" "https://downloads.mariadb.com/MariaDB/mariadb-${version}/source/mariadb-${version}.tar.gz"
]; ];
sha256 = "0252b9rxxz1ljjv6ni0wwgy14j8qmmdd2sq0a65dslx2ib9y3wgy"; sha256 = "1pwibmm52sc04qxp832pc3ylxw9wq90fjc7nxpcyp3yys49bpfs5";
name = "mariadb-${version}.tar.gz"; name = "mariadb-${version}.tar.gz";
}; };
@ -72,6 +72,8 @@ common = rec { # attributes common to both builds
"-DINSTALL_SUPPORTFILESDIR=share/doc/mysql" "-DINSTALL_SUPPORTFILESDIR=share/doc/mysql"
"-DINSTALL_MYSQLTESTDIR=OFF" "-DINSTALL_MYSQLTESTDIR=OFF"
"-DINSTALL_SQLBENCHDIR=OFF" "-DINSTALL_SQLBENCHDIR=OFF"
"-DINSTALL_PAMDIR=share/pam/lib/security"
"-DINSTALL_PAMDATADIR=share/pam/etc/security"
"-DWITH_ZLIB=system" "-DWITH_ZLIB=system"
"-DWITH_SSL=system" "-DWITH_SSL=system"
@ -94,7 +96,7 @@ common = rec { # attributes common to both builds
rm "$out"/bin/{mariadb_config,mysql_config} rm "$out"/bin/{mariadb_config,mysql_config}
rm -r $out/include rm -r $out/include
rm -r $out/lib/pkgconfig rm -r $out/lib/pkgconfig
rm -r $out/share/{aclocal,pkgconfig} rm -r $out/share/aclocal
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -160,10 +162,7 @@ server = stdenv.mkDerivation (common // {
++ optional stdenv.hostPlatform.isLinux linux-pam ++ optional stdenv.hostPlatform.isLinux linux-pam
++ optional (!stdenv.hostPlatform.isDarwin) mytopEnv; ++ optional (!stdenv.hostPlatform.isDarwin) mytopEnv;
patches = common.patches ++ [ patches = common.patches ++ optionals stdenv.hostPlatform.isDarwin [
# Disable build unused plugin pam_mariadb_mtr.so. See https://jira.mariadb.org/browse/MDEV-21654
./cmake-disable-auth-pam-testing.patch
] ++ optionals stdenv.hostPlatform.isDarwin [
./cmake-without-plugin-auth-pam.patch ./cmake-without-plugin-auth-pam.patch
]; ];
@ -202,6 +201,9 @@ server = stdenv.mkDerivation (common // {
chmod +x "$out"/bin/wsrep_sst_common chmod +x "$out"/bin/wsrep_sst_common
rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest} rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest}
rm -r "$out"/data # Don't need testing data rm -r "$out"/data # Don't need testing data
mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security
mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security
rm -r "$out"/OFF
'' + optionalString withStorageMroonga '' '' + optionalString withStorageMroonga ''
mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
'' + optionalString (!stdenv.hostPlatform.isDarwin) '' '' + optionalString (!stdenv.hostPlatform.isDarwin) ''

View File

@ -10,13 +10,13 @@ let
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "mariadb-galera"; pname = "mariadb-galera";
version = "26.4.3"; version = "26.4.5";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "codership"; owner = "codership";
repo = "galera"; repo = "galera";
rev = "release_${version}"; rev = "release_${version}";
sha256 = "1r0b4kxgqrivnwm4hprnpscb16v6l6j8cnvk4i8c64fig1ly8g3j"; sha256 = "10sir0hxxglw9jsjrclfgrqm8n5zng6rwj2fgff141x9n9l55w7l";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -48,7 +48,6 @@ in stdenv.mkDerivation rec {
install -m 444 "LICENSE" "$out/$GALERA_LICENSE_DIR/GPLv2" install -m 444 "LICENSE" "$out/$GALERA_LICENSE_DIR/GPLv2"
install -m 444 "asio/LICENSE_1_0.txt" "$out/$GALERA_LICENSE_DIR/LICENSE.asio" install -m 444 "asio/LICENSE_1_0.txt" "$out/$GALERA_LICENSE_DIR/LICENSE.asio"
install -m 444 "www.evanjones.ca/LICENSE" "$out/$GALERA_LICENSE_DIR/LICENSE.crc32c" install -m 444 "www.evanjones.ca/LICENSE" "$out/$GALERA_LICENSE_DIR/LICENSE.crc32c"
install -m 444 "chromium/LICENSE" "$out/$GALERA_LICENSE_DIR/LICENSE.chromium"
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {