ports/130023: [patch] databases/mysql41-server: update to 4.1.25

Eygene Ryabinkin rea-fbsd at codelabs.ru
Mon Dec 29 15:40:04 UTC 2008


>Number:         130023
>Category:       ports
>Synopsis:       [patch] databases/mysql41-server: update to 4.1.25
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 29 15:40:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.1-PRERELEASE amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD 7.1-PRERELEASE amd64

>Description:

Although MySQL 4.1 branch is in the externded support phase, i.e. no
tarballs are generated since 4.1.22, improvements and security patches
are still backported from the modern releases.

While evaluating some security bugs (ports/129978, ports/129979) I had
found that this is exceptionally hard to backport the fixes for the
security vulnerabilities to 4.1.22 and to test them with the official
MySQL testsuite.  So, as was noted in the ports/127731, we can just
create 4.1.25 tarball from the Bazaar repository and host it somewhere.

I did exactly this.  I can continue to host the tarball at inse.ru, but
it will be better (if the update in this PR will be committed, of
course) to mirror it at freebsd.org and possibly somewhere else.

>How-To-Repeat:

http://dev.mysql.com/doc/refman/4.1/en/news-4-1-25.html

>Fix:

The following patch upgrades the port to 4.1.25:
--- mysql41-upgrade-to-4.1.25.diff begins here ---
>From 0c1bc8ccc00026bc68791ad300a7fccdd896eb12 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Date: Mon, 29 Dec 2008 18:02:22 +0300

This is not an official distribution, but rather tarball exported from
the official Bazaar repository.  4.1.22 has many security
vulnerabilities that are rather hard to backport, so it is just easier
to host the semi-official tarball at the FreeBSD and 3rd-party servers
and to have all fixes and enhancements since 4.1.22.

Signed-off-by: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
---
 databases/mysql41-server/Makefile                  |   22 +----
 databases/mysql41-server/distinfo                  |    6 +-
 .../mysql41-server/files/patch-Docs::Makefile.in   |   14 ++--
 .../mysql41-server/files/patch-sql::mysqld.cc      |   21 -----
 .../mysql41-server/files/patch-sql_mysql_priv.h    |   11 ---
 .../mysql41-server/files/patch-sql_sql_parse.cc    |   82 --------------------
 databases/mysql41-server/pkg-plist.client          |    2 +-
 7 files changed, 15 insertions(+), 143 deletions(-)
 delete mode 100644 databases/mysql41-server/files/patch-sql_mysql_priv.h
 delete mode 100644 databases/mysql41-server/files/patch-sql_sql_parse.cc

diff --git a/databases/mysql41-server/Makefile b/databases/mysql41-server/Makefile
index 1754134..16e5b7c 100644
--- a/databases/mysql41-server/Makefile
+++ b/databases/mysql41-server/Makefile
@@ -6,11 +6,10 @@
 #
 
 PORTNAME?=	mysql
-PORTVERSION=	4.1.22
-PORTREVISION?=	1
+PORTVERSION=	4.1.25
+PORTREVISION?=	0
 CATEGORIES=	databases
-MASTER_SITES=	${MASTER_SITE_MYSQL}
-MASTER_SITE_SUBDIR=	MySQL-4.1
+MASTER_SITES=	http://inse.ru/fbsd/
 PKGNAMESUFFIX?=	-server
 
 MAINTAINER=	ale at FreeBSD.org
@@ -18,6 +17,7 @@ COMMENT?=	Multithreaded SQL database (server)
 
 SLAVEDIRS=	databases/mysql41-client
 USE_AUTOTOOLS=	libtool:15
+USE_BZIP2=	yes
 
 CONFIGURE_ARGS=	--localstatedir=/var/db/mysql \
 		--without-debug \
@@ -100,11 +100,6 @@ PLIST_SUB+=	NDB=""
 PLIST_SUB+=	NDB="@comment "
 .endif
 
-MAN1=		myisamchk.1 myisamlog.1 myisampack.1 mysqld.1 \
-		mysqld_safe.1 mysql.server.1 perror.1 replace.1
-
-MAN8=		mysqld.8
-
 INFO=		mysql
 
 pre-fetch:
@@ -131,7 +126,6 @@ post-patch:
 	@${REINPLACE_CMD} -e "s|all: config.h|all: config.h all-local|g" ${WRKSRC}/Makefile.in
 	@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = @server_scripts@ mysql_create_system_tables|g" ${WRKSRC}/scripts/Makefile.in
 	@${REINPLACE_CMD} -e "s|dist_pkgdata_DATA =|dist_pkgdata_DATA = fill_help_tables.sql|g" ${WRKSRC}/scripts/Makefile.in
-	@${REINPLACE_CMD} -e "s|man1_MANS =|man1_MANS = ${MAN1}|g;s|man8_MANS =|man8_MANS = ${MAN8}|g" ${WRKSRC}/man/Makefile.in
 	@${REINPLACE_CMD} -e "s|install-data-am: install-pkgincludeHEADERS|install-data-am:|g" ${WRKSRC}/include/Makefile.in
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/mysys/default.c
 .if defined(WITH_PROC_SCOPE_PTH)
@@ -150,9 +144,6 @@ LATEST_LINK=	mysql41-client
 
 CONFLICTS=	mysql-client-3.* mysql-client-4.[02-9].* mysql-client-5.* mysql-client-6.*
 
-MAN1=		mysql_config.1 mysql.1 mysqladmin.1 mysqlbinlog.1 \
-		mysqlcheck.1 mysqldump.1 mysqlimport.1 mysqlshow.1
-
 USE_LDCONFIG=	${PREFIX}/lib/mysql
 
 CONFIGURE_ARGS+=--without-server
@@ -163,7 +154,6 @@ post-patch:
 	@${REINPLACE_CMD} -e "s|all: config.h|all: config.h all-local|g" ${WRKSRC}/Makefile.in
 	@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = mysql_config mysql_fix_privilege_tables mysqlbug|g" ${WRKSRC}/scripts/Makefile.in
 	@${REINPLACE_CMD} -e "s|dist_pkgdata_DATA =|dist_pkgdata_DATA = mysql_fix_privilege_tables.sql|g" ${WRKSRC}/scripts/Makefile.in
-	@${REINPLACE_CMD} -e "s|man1_MANS =|man1_MANS = ${MAN1}|g" ${WRKSRC}/man/Makefile.in
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/mysys/default.c
 .if defined(WITH_PROC_SCOPE_PTH)
 	@${REINPLACE_CMD} -e "s|PTHREAD_SCOPE_SYSTEM|PTHREAD_SCOPE_PROCESS|g" ${WRKSRC}/tools/mysqlmanager.c
@@ -184,9 +174,6 @@ LATEST_LINK=	mysql41-scripts
 
 CONFLICTS=	mysql-scripts-3.* mysql-scripts-4.[02-9].* mysql-scripts-5.* mysql-scripts-6.*
 
-MAN1=		msql2mysql.1 mysql_zap.1 mysqlaccess.1 mysqlhotcopy.1 \
-		mysqld_multi.1 mysql_fix_privilege_tables.1
-
 SCRIPTS=	msql2mysql mysql_fix_extensions mysql_setpermission \
 		mysql_secure_installation mysql_zap mysqlaccess \
 		mysql_convert_table_format mysql_find_rows mysqlhotcopy \
@@ -196,7 +183,6 @@ post-patch:
 	@${REINPLACE_CMD} -e "s|SUBDIRS =|SUBDIRS = scripts @man_dirs@|g" ${WRKSRC}/Makefile.in
 	@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = ${SCRIPTS}|g" ${WRKSRC}/scripts/Makefile.in
 	@${REINPLACE_CMD} -e "s|install-exec-am install-data-am|install-exec-am|g" ${WRKSRC}/scripts/Makefile.in
-	@${REINPLACE_CMD} -e "s|man1_MANS =|man1_MANS = ${MAN1}|g" ${WRKSRC}/man/Makefile.in
 .endif
 .endif
 # Common part
diff --git a/databases/mysql41-server/distinfo b/databases/mysql41-server/distinfo
index b7e9ff6..6e3fcda 100644
--- a/databases/mysql41-server/distinfo
+++ b/databases/mysql41-server/distinfo
@@ -1,3 +1,3 @@
-MD5 (mysql-4.1.22.tar.gz) = 37b4479951fa0cf052269d27c41ca200
-SHA256 (mysql-4.1.22.tar.gz) = 6bd2436fd0f233bb1518e15975cb4e9fa4434acb53c3c3cd7d4648219abf58e9
-SIZE (mysql-4.1.22.tar.gz) = 17761101
+MD5 (mysql-4.1.25.tar.bz2) = 77f9226fc732c25e144f8014d9f5f8c1
+SHA256 (mysql-4.1.25.tar.bz2) = 65498b23f80f51473ca0e5df6113b0c075c7d19b1205b5c0677e6e1f4e4bb8c4
+SIZE (mysql-4.1.25.tar.bz2) = 11487898
diff --git a/databases/mysql41-server/files/patch-Docs::Makefile.in b/databases/mysql41-server/files/patch-Docs::Makefile.in
index 803cbea..ed4333e 100644
--- a/databases/mysql41-server/files/patch-Docs::Makefile.in
+++ b/databases/mysql41-server/files/patch-Docs::Makefile.in
@@ -1,15 +1,15 @@
---- Docs/Makefile.in.orig	Wed Nov 30 21:37:04 2005
-+++ Docs/Makefile.in	Thu Dec 22 16:03:51 2005
-@@ -324,7 +324,7 @@
- 			INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
- 
- GT = $(srcdir)/Support/generate-text-files.pl
+--- Docs/Makefile.in.orig	2008-12-29 16:52:20.000000000 +0300
++++ Docs/Makefile.in	2008-12-29 17:25:03.000000000 +0300
+@@ -334,7 +334,7 @@
+ vio_libs = @vio_libs@
+ zlib_dir = @zlib_dir@
+ EXTRA_DIST = mysql.info INSTALL-BINARY
 -all: all-am
 +all:
  
  .SUFFIXES:
  $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-@@ -410,7 +410,7 @@
+@@ -419,7 +419,7 @@
  install-data: install-data-am
  uninstall: uninstall-am
  
diff --git a/databases/mysql41-server/files/patch-sql::mysqld.cc b/databases/mysql41-server/files/patch-sql::mysqld.cc
index 69c124f..e79f985 100644
--- a/databases/mysql41-server/files/patch-sql::mysqld.cc
+++ b/databases/mysql41-server/files/patch-sql::mysqld.cc
@@ -9,24 +9,3 @@
  #include <syslog.h>
  #ifdef NEED_SYS_SYSLOG_H
  #include <sys/syslog.h>
---- sql/mysqld.cc	2007-11-29 10:52:36 +0000
-+++ sql/mysqld.cc	2008-02-29 09:55:00 +0000
-@@ -390,6 +390,7 @@
- char compiled_default_collation_name[]= MYSQL_DEFAULT_COLLATION_NAME;
- char *language_ptr, *default_collation_name, *default_character_set_name;
- char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
-+char mysql_unpacked_real_data_home[FN_REFLEN];
- struct passwd *user_info;
- char server_version[SERVER_VERSION_LENGTH];
- char *mysqld_unix_port, *opt_mysql_tmpdir;
-@@ -6896,6 +6897,9 @@
-     pos[1]= 0;
-   }
-   convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS);
-+  (void) fn_format(buff, mysql_real_data_home, "", "",
-+                   (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS));
-+  (void) unpack_dirname(mysql_unpacked_real_data_home, buff);
-   convert_dirname(language,language,NullS);
-   (void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir
-   (void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
-
diff --git a/databases/mysql41-server/files/patch-sql_mysql_priv.h b/databases/mysql41-server/files/patch-sql_mysql_priv.h
deleted file mode 100644
index a02b313..0000000
--- a/databases/mysql41-server/files/patch-sql_mysql_priv.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- sql/mysql_priv.h	2007-11-09 12:05:01 +0000
-+++ sql/mysql_priv.h	2008-02-29 09:55:00 +0000
-@@ -890,6 +890,7 @@
- extern time_t start_time;
- extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- 	    mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
-+	    mysql_unpacked_real_data_home[],
-             def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
- #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
- extern MY_TMPDIR mysql_tmpdir_list;
-
diff --git a/databases/mysql41-server/files/patch-sql_sql_parse.cc b/databases/mysql41-server/files/patch-sql_sql_parse.cc
deleted file mode 100644
index 418d6d2..0000000
--- a/databases/mysql41-server/files/patch-sql_sql_parse.cc
+++ /dev/null
@@ -1,82 +0,0 @@
---- sql/sql_parse.cc	2007-06-12 12:47:36 +0000
-+++ sql/sql_parse.cc	2008-02-29 09:55:00 +0000
-@@ -65,7 +65,8 @@
- 			       const char *table_name);
-              
- static TABLE_LIST* get_table_by_alias(TABLE_LIST* tl, const char* db,
--  const char* alias);      
-+  const char* alias);
-+static bool test_if_data_home_dir(const char *dir);
- 
- const char *any_db="*any*";	// Special symbol for check_access
- 
-@@ -2531,6 +2532,20 @@
-                    "INDEX DIRECTORY option ignored");
-     create_info.data_file_name= create_info.index_file_name= NULL;
- #else
-+
-+    if (test_if_data_home_dir(lex->create_info.data_file_name))
-+    {
-+      my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECORY");
-+      res= -1;
-+      break;
-+    }
-+    if (test_if_data_home_dir(lex->create_info.index_file_name))
-+    {
-+      my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECORY");
-+      res= -1;
-+      break;
-+    }
-+
-     /* Fix names if symlinked tables */
-     if (append_file_to_dir(thd, &create_info.data_file_name,
- 			   create_table->real_name) ||
-@@ -5920,3 +5935,47 @@
-     return negated;
-   return new Item_func_not(expr);
- }
-+
-+
-+/*
-+  Check if path does not contain mysql data home directory
-+
-+  SYNOPSIS
-+    test_if_data_home_dir()
-+    dir                     directory
-+    conv_home_dir           converted data home directory
-+    home_dir_len            converted data home directory length
-+
-+  RETURN VALUES
-+    0	ok
-+    1	error  
-+*/
-+
-+static bool test_if_data_home_dir(const char *dir)
-+{
-+  char path[FN_REFLEN], conv_path[FN_REFLEN];
-+  uint dir_len, home_dir_len= strlen(mysql_unpacked_real_data_home);
-+  DBUG_ENTER("test_if_data_home_dir");
-+
-+  if (!dir)
-+    DBUG_RETURN(0);
-+
-+  (void) fn_format(path, dir, "", "",
-+                   (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS));
-+  dir_len= unpack_dirname(conv_path, dir);
-+
-+  if (home_dir_len <= dir_len)
-+  {
-+    if (lower_case_file_system)
-+    {
-+      if (!my_strnncoll(default_charset_info, (const uchar*) conv_path,
-+                        home_dir_len,
-+                        (const uchar*) mysql_unpacked_real_data_home,
-+                        home_dir_len))
-+        DBUG_RETURN(1);
-+    }
-+    else if (!memcmp(conv_path, mysql_unpacked_real_data_home, home_dir_len))
-+      DBUG_RETURN(1);
-+  }
-+  DBUG_RETURN(0);
-+}
-
diff --git a/databases/mysql41-server/pkg-plist.client b/databases/mysql41-server/pkg-plist.client
index 94d6384..556634e 100644
--- a/databases/mysql41-server/pkg-plist.client
+++ b/databases/mysql41-server/pkg-plist.client
@@ -11,6 +11,7 @@ bin/mysqlmanager-pwgen
 bin/mysqlmanagerc
 bin/mysqlshow
 bin/mysqltest
+include/mysql/abi_check
 include/mysql/errmsg.h
 include/mysql/keycache.h
 include/mysql/m_ctype.h
@@ -25,7 +26,6 @@ include/mysql/my_list.h
 include/mysql/my_net.h
 include/mysql/my_no_pthread.h
 include/mysql/my_pthread.h
-include/mysql/my_semaphore.h
 include/mysql/my_sys.h
 include/mysql/my_xml.h
 include/mysql/mysql.h
-- 
1.6.0.5
--- mysql41-upgrade-to-4.1.25.diff ends here ---

I had tested its compilability, run the whole testsuite and tested good
packaging for databases/mysql41-*.  Andrew, Eugene, Alex, anyone -- if
you'll be so kind to test this update, it will be very good.

This patch should fix ports/129979 from the mysql-4.1 side.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list