head 1.32; access; symbols OPENPKG_E1_MP_HEAD:1.24 OPENPKG_E1_MP:1.24 OPENPKG_E1_MP_2_STABLE:1.23.2.1 OPENPKG_E1_FP:1.23.2.1 OPENPKG_2_STABLE_MP:1.24 OPENPKG_2_STABLE_20061018:1.23.2.1 OPENPKG_2_STABLE_20060622:1.23 OPENPKG_2_STABLE:1.23.0.2 OPENPKG_2_STABLE_BP:1.23 OPENPKG_2_5_RELEASE:1.18 OPENPKG_2_5_SOLID:1.18.0.2 OPENPKG_2_5_SOLID_BP:1.18 OPENPKG_2_4_RELEASE:1.15 OPENPKG_2_4_SOLID:1.15.0.4 OPENPKG_2_4_SOLID_BP:1.15 OPENPKG_CW_FP:1.15 OPENPKG_2_3_RELEASE:1.15 OPENPKG_2_3_SOLID:1.15.0.2 OPENPKG_2_3_SOLID_BP:1.15 OPENPKG_2_2_RELEASE:1.7 OPENPKG_2_2_SOLID:1.7.0.4 OPENPKG_2_2_SOLID_BP:1.7 OPENPKG_2_1_RELEASE:1.7 OPENPKG_2_1_SOLID:1.7.0.2 OPENPKG_2_1_SOLID_BP:1.7 OPENPKG_2_0_RELEASE:1.5 OPENPKG_2_0_SOLID:1.5.0.2 OPENPKG_2_0_SOLID_BP:1.5 OPENPKG_1_3_RELEASE:1.3.2.4 OPENPKG_1_3_SOLID:1.3.2.4.0.2 OPENPKG_1_3_SOLID_BP:1.3.2.4 OPENPKG_1_STABLE_MP:1.5 OPENPKG_1_2_RELEASE:1.3 OPENPKG_1_2_SOLID:1.3.0.4 OPENPKG_1_2_SOLID_BP:1.3 OPENPKG_1_STABLE:1.3.0.2 OPENPKG_1_STABLE_BP:1.3 OPENPKG_1_1_RELEASE:1.1 OPENPKG_1_1_SOLID:1.1.0.2 OPENPKG_1_1_SOLID_BP:1.1; locks; strict; comment @# @; 1.32 date 2009.02.07.18.55.12; author rse; state Exp; branches; next 1.31; commitid 0BgXFYzRnXRQcxBt; 1.31 date 2008.11.28.21.10.12; author rse; state Exp; branches; next 1.30; commitid 5zjSaDmRuGREeqst; 1.30 date 2008.08.09.16.50.52; author rse; state Exp; branches; next 1.29; commitid hpDZ3iqNhF8Um8et; 1.29 date 2007.12.06.17.51.33; author cs; state Exp; branches; next 1.28; commitid 4L9l1DixUzFXDoIs; 1.28 date 2007.11.12.23.19.45; author cs; state Exp; branches; next 1.27; commitid lHjjlLpsQrHnelFs; 1.27 date 2007.07.12.16.42.31; author cs; state Exp; branches; next 1.26; commitid Hd57xLu3WTveZups; 1.26 date 2007.05.10.15.39.14; author rse; state Exp; branches; next 1.25; commitid CPeXfWqfMuu4Fohs; 1.25 date 2007.01.10.18.53.52; author rse; state Exp; branches; next 1.24; commitid y2aHYxFpzGa0BZ1s; 1.24 date 2006.10.10.06.03.52; author rse; state Exp; branches; next 1.23; commitid h282yvFSLLfbi6Qr; 1.23 date 2006.04.12.18.53.46; author rse; state Exp; branches 1.23.2.1; next 1.22; commitid CmH5fNMHlWW1nUsr; 1.22 date 2006.03.11.12.20.57; author rse; state Exp; branches; next 1.21; commitid aD5TGhY540g2eLor; 1.21 date 2005.11.11.12.46.28; author rse; state Exp; branches; next 1.20; commitid HzBlGXM1yegWdl9r; 1.20 date 2005.11.10.11.23.47; author rse; state Exp; branches; next 1.19; commitid a45xUeHNZwnzNc9r; 1.19 date 2005.11.07.17.13.43; author rse; state Exp; branches; next 1.18; commitid jLew5PZ6ZgSAPQ8r; 1.18 date 2005.10.07.21.51.06; author rse; state Exp; branches 1.18.2.1; next 1.17; 1.17 date 2005.09.28.18.09.00; author rse; state Exp; branches; next 1.16; 1.16 date 2005.09.27.08.29.12; author rse; state Exp; branches; next 1.15; 1.15 date 2005.02.16.20.25.18; author rse; state Exp; branches 1.15.4.1; next 1.14; 1.14 date 2005.01.20.13.44.39; author cs; state Exp; branches; next 1.13; 1.13 date 2005.01.15.08.57.13; author rse; state Exp; branches; next 1.12; 1.12 date 2005.01.13.12.29.48; author ms; state Exp; branches; next 1.11; 1.11 date 2004.12.17.09.13.28; author rse; state Exp; branches; next 1.10; 1.10 date 2004.12.15.10.02.38; author hms; state Exp; branches; next 1.9; 1.9 date 2004.12.14.14.45.24; author hms; state Exp; branches; next 1.8; 1.8 date 2004.12.09.12.31.06; author ms; state Exp; branches; next 1.7; 1.7 date 2004.05.18.07.21.08; author rse; state Exp; branches 1.7.2.1 1.7.4.1; next 1.6; 1.6 date 2004.04.14.20.21.21; author rse; state Exp; branches; next 1.5; 1.5 date 2003.06.09.11.37.53; author rse; state Exp; branches 1.5.2.1; next 1.4; 1.4 date 2003.03.18.11.16.15; author mlelstv; state Exp; branches; next 1.3; 1.3 date 2003.01.16.08.35.08; author rse; state Exp; branches 1.3.2.1 1.3.4.1; next 1.2; 1.2 date 2002.12.30.19.15.05; author rse; state Exp; branches; next 1.1; 1.1 date 2002.08.19.15.06.16; author ms; state Exp; branches 1.1.2.1; next ; 1.23.2.1 date 2006.10.16.14.53.04; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; 1.18.2.1 date 2005.11.07.18.29.07; author rse; state Exp; branches; next 1.18.2.2; commitid DqXPE5VXHHxsfR8r; 1.18.2.2 date 2005.11.10.14.40.50; author rse; state Exp; branches; next 1.18.2.3; commitid McS9lOqyWzpaTd9r; 1.18.2.3 date 2005.11.13.17.38.37; author rse; state Exp; branches; next ; commitid 5n6FeUAWQ1pbMC9r; 1.15.4.1 date 2005.12.03.12.33.44; author rse; state Exp; branches; next ; commitid 8bEQzvOrDedJracr; 1.7.2.1 date 2004.10.29.13.41.46; author ms; state Exp; branches; next ; 1.7.4.1 date 2005.04.15.11.45.18; author ms; state Exp; branches; next 1.7.4.2; 1.7.4.2 date 2005.04.18.14.45.48; author ms; state Exp; branches; next ; 1.5.2.1 date 2004.04.14.20.24.01; author rse; state Exp; branches; next ; 1.3.2.1 date 2003.03.18.10.47.09; author mlelstv; state Exp; branches; next 1.3.2.2; 1.3.2.2 date 2003.03.19.11.16.44; author mlelstv; state Exp; branches; next 1.3.2.3; 1.3.2.3 date 2003.06.09.11.24.04; author rse; state Exp; branches; next 1.3.2.4; 1.3.2.4 date 2003.07.24.20.44.33; author rse; state Exp; branches 1.3.2.4.2.1; next ; 1.3.2.4.2.1 date 2003.09.15.10.59.37; author thl; state Exp; branches; next 1.3.2.4.2.2; 1.3.2.4.2.2 date 2004.04.14.20.26.12; author rse; state Exp; branches; next ; 1.3.4.1 date 2003.01.29.11.44.54; author thl; state Exp; branches; next 1.3.4.2; 1.3.4.2 date 2003.03.18.11.32.49; author mlelstv; state Exp; branches; next 1.3.4.3; 1.3.4.3 date 2003.03.19.07.59.05; author mlelstv; state Exp; branches; next 1.3.4.4; 1.3.4.4 date 2003.09.15.11.17.14; author thl; state Exp; branches; next ; 1.1.2.1 date 2003.03.18.15.33.58; author mlelstv; state Exp; branches; next 1.1.2.2; 1.1.2.2 date 2003.03.19.07.58.40; author mlelstv; state Exp; branches; next ; desc @@ 1.32 log @upgrading package: mysql 5.1.30 -> 5.1.31 @ text @Index: include/Makefile.in --- include/Makefile.in.orig 2009-01-19 17:40:38 +0100 +++ include/Makefile.in 2009-02-07 19:03:05 +0100 @@@@ -387,15 +387,15 @@@@ decimal.h errmsg.h my_global.h my_net.h \ my_getopt.h sslopt-longopts.h my_dir.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \ + m_ctype.h my_attribute.h rijndael.h sha1.h my_aes.h $(HEADERS_GEN_CONFIGURE) \ $(HEADERS_GEN_MAKE) noinst_HEADERS = config-win.h config-netware.h my_bit.h \ heap.h my_bitmap.h my_uctype.h \ myisam.h myisampack.h myisammrg.h ft_global.h\ mysys_err.h my_base.h help_start.h help_end.h \ - my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ - my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ + my_nosys.h my_alarm.h queues.h \ + my_tree.h my_trie.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ my_handler.h my_time.h \ my_vle.h my_user.h my_atomic.h atomic/nolock.h \ Index: mysys/default.c --- mysys/default.c.orig 2009-01-19 17:29:59 +0100 +++ mysys/default.c 2009-02-07 18:38:28 +0100 @@@@ -1086,8 +1086,7 @@@@ #else - errors += add_directory(alloc, "/etc/", dirs); - errors += add_directory(alloc, "/etc/mysql/", dirs); + errors += add_directory(alloc, "@@l_prefix@@/etc/mysql/", dirs); #if defined(DEFAULT_SYSCONFDIR) if (DEFAULT_SYSCONFDIR != "") Index: scripts/mysql_config.sh --- scripts/mysql_config.sh.orig 2009-01-19 17:30:55 +0100 +++ scripts/mysql_config.sh 2009-02-07 19:05:12 +0100 @@@@ -104,9 +104,9 @@@@ # Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later -libs=" $ldflags -L$pkglibdir -lmysqlclient @@ZLIB_DEPS@@ @@NON_THREADED_LIBS@@" +libs=" $ldflags -L$pkglibdir -lmysqlclient -lmysys @@ZLIB_DEPS@@ @@NON_THREADED_LIBS@@" libs="$libs @@openssl_libs@@ @@STATIC_NSS_FLAGS@@ " -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@ " +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @@LIBDL@@ @@ZLIB_DEPS@@ @@LIBS@@ @@WRAPLIBS@@ @@innodb_system_libs@@ @@openssl_libs@@ " if [ -r "$pkglibdir/libmygcc.a" ]; then Index: scripts/mysql_system_tables_data.sql --- scripts/mysql_system_tables_data.sql.orig 2009-01-19 17:30:55 +0100 +++ scripts/mysql_system_tables_data.sql 2009-02-07 18:38:28 +0100 @@@@ -11,8 +11,6 @@@@ -- Fill "db" table with default grants for anyone to -- access database 'test' and 'test_%' if "db" table didn't exist CREATE TEMPORARY TABLE tmp_db LIKE db; -INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); -INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); INSERT INTO db SELECT * FROM tmp_db WHERE @@had_db_table=0; DROP TABLE tmp_db; Index: sql/Makefile.in --- sql/Makefile.in.orig 2009-01-19 17:40:45 +0100 +++ sql/Makefile.in 2009-02-07 18:38:28 +0100 @@@@ -520,7 +520,7 @@@@ $(top_builddir)/strings/libmystrings.a mysqld_DEPENDENCIES = @@mysql_plugin_libs@@ $(SUPPORTING_LIBS) libndb.la -LDADD = $(SUPPORTING_LIBS) @@ZLIB_LIBS@@ @@NDB_SCI_LIBS@@ +LDADD = $(SUPPORTING_LIBS) @@NDB_SCI_LIBS@@ mysqld_LDADD = libndb.la \ @@MYSQLD_EXTRA_LDFLAGS@@ \ @@pstack_libs@@ \ @ 1.31 log @upgrade to MySQL 5.1 @ text @d2 3 a4 3 --- include/Makefile.in.orig 2008-08-28 17:43:15 +0200 +++ include/Makefile.in 2008-09-13 18:34:54 +0200 @@@@ -394,14 +394,14 @@@@ d8 3 a10 2 - m_ctype.h my_attribute.h $(HEADERS_GEN) + m_ctype.h my_attribute.h rijndael.h sha1.h my_aes.h $(HEADERS_GEN) d21 1 a21 1 mysql_version.h.in my_handler.h my_time.h \ d24 2 a25 2 --- mysys/default.c.orig 2008-08-28 17:40:47 +0200 +++ mysys/default.c 2008-09-13 18:38:09 +0200 d37 2 a38 2 --- scripts/mysql_config.sh.orig 2008-08-28 17:40:52 +0200 +++ scripts/mysql_config.sh 2008-09-13 18:34:54 +0200 d48 1 a48 1 embedded_libs=" $ldflags -L$pkglibdir -lmysqld @@ZLIB_DEPS@@ @@LIBS@@ @@WRAPLIBS@@ @@innodb_system_libs@@ @@openssl_libs@@ " d52 2 a53 2 --- scripts/mysql_system_tables_data.sql.orig 2008-08-28 17:40:52 +0200 +++ scripts/mysql_system_tables_data.sql 2008-09-13 18:34:54 +0200 d64 3 a66 3 --- sql/Makefile.in.orig 2008-08-28 17:43:23 +0200 +++ sql/Makefile.in 2008-09-13 18:34:54 +0200 @@@@ -517,7 +517,7 @@@@ @ 1.30 log @upgrading package: mysql 5.0.51b -> 5.0.67 @ text @d1 21 d23 3 a25 3 --- mysys/default.c.orig 2008-08-04 14:19:45 +0200 +++ mysys/default.c 2008-08-09 15:16:21 +0200 @@@@ -1077,7 +1077,7 @@@@ d30 1 d33 2 a34 2 #if defined(__EMX__) || defined(OS2) if ((env= getenv("ETC"))) d36 3 a38 3 --- scripts/mysql_config.sh.orig 2008-08-04 14:20:01 +0200 +++ scripts/mysql_config.sh 2008-08-09 11:38:36 +0200 @@@@ -102,9 +102,9 @@@@ d51 2 a52 2 --- scripts/mysql_system_tables_data.sql.orig 2008-08-04 14:20:02 +0200 +++ scripts/mysql_system_tables_data.sql 2008-08-09 11:38:36 +0200 d57 2 a58 2 -INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); d62 12 @ 1.29 log @upgrading package: mysql 5.0.45 -> 5.0.51 @ text @d2 10 a11 3 --- mysys/default.c.orig 2007-05-02 16:40:31 +0200 +++ mysys/default.c 2007-05-10 07:54:13 +0200 @@@@ -1006,7 +1006,7 @@@@ a12 7 *ptr++= env; #endif - *ptr++= "/etc/"; + *ptr++= "@@l_prefix@@/etc/mysql/"; #endif if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) *ptr++= env; d14 3 a16 3 --- scripts/mysql_config.sh.orig 2007-05-02 16:40:15 +0200 +++ scripts/mysql_config.sh 2007-05-10 07:54:13 +0200 @@@@ -97,9 +97,9 @@@@ d27 1 a27 1 cflags="-I$pkgincludedir @@CFLAGS@@ " #note: end space! d29 3 a31 3 --- scripts/mysql_system_tables_data.sql.orig 2007-05-02 16:40:01 +0200 +++ scripts/mysql_system_tables_data.sql 2007-05-10 07:55:32 +0200 @@@@ -5,8 +5,6 @@@@ @ 1.28 log @make mysqlhotcopy work with recent versions of DBD/mysql, part of the perl-dbi package @ text @a39 17 ______________________________________________________________________________ Dirty hack to make mysqlhotcopy work with recent versions of DBD/mysql, see http://bugs.mysql.com/bug.php?id=27303 Index: scripts/mysqlhotcopy.sh --- scripts/mysqlhotcopy.sh.orig 2007-07-04 15:06:25 +0200 +++ scripts/mysqlhotcopy.sh 2007-11-13 00:02:56 +0100 @@@@ -834,6 +834,8 @@@@ my @@dbh_tables = eval { $dbh->tables() }; + map { s/^.*?\.//o } @@dbh_tables; + ## Remove quotes around table names my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR if ($quote) { @ 1.27 log @upgrading package: mysql 5.0.41 -> 5.0.45 @ text @d40 17 @ 1.26 log @upgrading package: mysql 5.0.37 -> 5.0.41 @ text @a0 14 Index: include/my_global.h --- include/my_global.h.orig 2007-05-02 16:40:53 +0200 +++ include/my_global.h 2007-05-10 07:54:13 +0200 @@@@ -812,9 +812,8 @@@@ #define SSIZE_MAX ((~((size_t) 0)) / 2) #endif -#if !defined(HAVE_ISINF) && !defined(isinf) +#undef isinf #define isinf(X) 0 -#endif /* Define missing math constants. */ #ifndef M_PI @ 1.25 log @upgrade to 5.0.33 and no longer install my_aes.h as I think it is no longer required (although I'm not 100% sure) @ text @d2 3 a4 3 --- include/my_global.h.orig 2007-01-09 13:51:49 +0100 +++ include/my_global.h 2007-01-10 08:49:00 +0100 @@@@ -777,9 +777,8 @@@@ d16 3 a18 3 --- mysys/default.c.orig 2007-01-09 13:51:38 +0100 +++ mysys/default.c 2007-01-10 08:49:00 +0100 @@@@ -1007,7 +1007,7 @@@@ d28 3 a30 3 --- scripts/mysql_config.sh.orig 2007-01-09 13:51:28 +0100 +++ scripts/mysql_config.sh 2007-01-10 08:49:00 +0100 @@@@ -98,9 +98,9 @@@@ d42 11 a52 11 Index: scripts/mysql_create_system_tables.sh --- scripts/mysql_create_system_tables.sh.orig 2007-01-09 13:51:08 +0100 +++ scripts/mysql_create_system_tables.sh 2007-01-10 08:49:00 +0100 @@@@ -77,9 +77,6 @@@@ c_d="$c_d ) engine=MyISAM" c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" c_d="$c_d comment='Database privileges';" - - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');" fi a53 21 if test ! -f $mdata/host.frm @@@@ -167,17 +164,13 @@@@ then i_u="INSERT INTO user VALUES ('localhost','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','','','','',0,0,0,0); INSERT INTO user VALUES ('$hostname','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','','','','',0,0,0,0); - REPLACE INTO user VALUES ('127.0.0.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','','','','',0,0,0,0); - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + REPLACE INTO user VALUES ('127.0.0.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','','','','',0,0,0,0);" else i_u="INSERT INTO user VALUES ('localhost','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','','','','',0,0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','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','','','','',0,0,0,0); - INSERT INTO user (host,user) values ('$hostname',''); - INSERT INTO user (host,user) values ('localhost','');" + INSERT INTO user VALUES ('$hostname','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','','','','',0,0,0,0);" else i_u="$i_u INSERT INTO user VALUES ('localhost','','','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);" @ 1.24 log @upgrading package: mysql 5.0.24a -> 5.0.26 @ text @a0 21 Index: include/Makefile.in --- include/Makefile.in.orig 2006-10-04 13:25:40 +0200 +++ include/Makefile.in 2006-10-10 07:46:47 +0200 @@@@ -360,14 +360,14 @@@@ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h my_dir.h typelib.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - mysql_time.h $(BUILT_SOURCES) + mysql_time.h my_aes.h rijndael.h $(BUILT_SOURCES) noinst_HEADERS = config-win.h config-os2.h config-netware.h \ heap.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ mysys_err.h my_base.h help_start.h help_end.h \ - my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ - my_aes.h my_tree.h hash.h thr_alarm.h \ + my_nosys.h my_alarm.h queues.h \ + my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h base64.h \ mysql_version.h.in my_handler.h my_time.h decimal.h \ my_user.h my_libwrap.h d2 3 a4 3 --- include/my_global.h.orig 2006-10-04 13:24:43 +0200 +++ include/my_global.h 2006-10-10 07:46:47 +0200 @@@@ -739,9 +739,8 @@@@ d16 2 a17 2 --- mysys/default.c.orig 2006-10-04 13:24:24 +0200 +++ mysys/default.c 2006-10-10 07:46:47 +0200 d28 2 a29 2 --- scripts/mysql_config.sh.orig 2006-10-04 13:24:22 +0200 +++ scripts/mysql_config.sh 2006-10-10 07:48:36 +0200 d43 2 a44 2 --- scripts/mysql_create_system_tables.sh.orig 2006-10-04 13:24:11 +0200 +++ scripts/mysql_create_system_tables.sh 2006-10-10 07:46:47 +0200 @ 1.23 log @upgrading package: mysql 5.0.19 -> 5.0.20 @ text @d2 3 a4 3 --- include/Makefile.in.orig 2006-03-31 19:12:20 +0200 +++ include/Makefile.in 2006-04-12 20:31:33 +0200 @@@@ -352,14 +352,14 @@@@ d21 1 a21 1 my_user.h d23 4 a26 4 --- include/my_global.h.orig 2006-03-31 19:10:26 +0200 +++ include/my_global.h 2006-04-12 20:31:33 +0200 @@@@ -737,9 +737,8 @@@@ #define FLT_MAX ((float)3.40282346638528860e+38) d37 3 a39 3 --- mysys/default.c.orig 2006-03-31 19:10:28 +0200 +++ mysys/default.c 2006-04-12 20:31:33 +0200 @@@@ -1001,7 +1001,7 @@@@ d49 2 a50 2 --- scripts/mysql_config.sh.orig 2006-03-31 19:10:28 +0200 +++ scripts/mysql_config.sh 2006-04-12 20:34:45 +0200 d54 1 a54 1 # We intentionally add a space to the beginning of lib strings, simplifies replace later d57 4 a60 4 libs="$libs @@openssl_libs@@ @@STATIC_NSS_FLAGS@@" -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@" +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@" embedded_libs=" $ldflags -L$pkglibdir -lmysqld @@ZLIB_DEPS@@ @@LIBS@@ @@WRAPLIBS@@ @@innodb_system_libs@@" d64 2 a65 2 --- scripts/mysql_create_system_tables.sh.orig 2006-03-31 19:10:40 +0200 +++ scripts/mysql_create_system_tables.sh 2006-04-12 20:31:33 +0200 @ 1.23.2.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d2 3 a4 3 --- include/Makefile.in.orig 2006-10-04 13:25:40 +0200 +++ include/Makefile.in 2006-10-10 07:46:47 +0200 @@@@ -360,14 +360,14 @@@@ d21 1 a21 1 my_user.h my_libwrap.h d23 4 a26 4 --- include/my_global.h.orig 2006-10-04 13:24:43 +0200 +++ include/my_global.h 2006-10-10 07:46:47 +0200 @@@@ -739,9 +739,8 @@@@ #define SSIZE_MAX ((~((size_t) 0)) / 2) d37 3 a39 3 --- mysys/default.c.orig 2006-10-04 13:24:24 +0200 +++ mysys/default.c 2006-10-10 07:46:47 +0200 @@@@ -1007,7 +1007,7 @@@@ d49 2 a50 2 --- scripts/mysql_config.sh.orig 2006-10-04 13:24:22 +0200 +++ scripts/mysql_config.sh 2006-10-10 07:48:36 +0200 d54 1 a54 1 # We intentionally add a space to the beginning and end of lib strings, simplifies replace later d57 4 a60 4 libs="$libs @@openssl_libs@@ @@STATIC_NSS_FLAGS@@ " -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@ " +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @@ZLIB_DEPS@@ @@LIBS@@ @@WRAPLIBS@@ @@innodb_system_libs@@ @@openssl_libs@@ " d64 2 a65 2 --- scripts/mysql_create_system_tables.sh.orig 2006-10-04 13:24:11 +0200 +++ scripts/mysql_create_system_tables.sh 2006-10-10 07:46:47 +0200 @ 1.22 log @upgrade MySQL (package 'mysql') from 4.1 to 5.0. MySQL 4.1 is still available as package 'mysql4' for backward compatibility reasons. @ text @d2 3 a4 3 --- include/Makefile.in.orig 2005-11-15 01:14:00 +0100 +++ include/Makefile.in 2005-11-21 21:19:28 +0100 @@@@ -349,14 +349,14 @@@@ d20 2 a21 2 mysql_version.h.in my_handler.h my_time.h decimal.h d23 3 a25 3 --- include/my_global.h.orig 2005-11-15 01:12:30 +0100 +++ include/my_global.h 2005-11-21 21:18:29 +0100 @@@@ -721,9 +721,8 @@@@ d37 2 a38 2 --- mysys/default.c.orig 2005-11-15 01:12:32 +0100 +++ mysys/default.c 2005-11-21 21:18:29 +0100 d49 8 a56 8 --- scripts/mysql_config.sh.orig 2005-11-15 01:12:33 +0100 +++ scripts/mysql_config.sh 2005-11-21 21:18:29 +0100 @@@@ -93,11 +93,11 @@@@ # Create options -libs="$ldflags -L$pkglibdir -lmysqlclient @@ZLIB_DEPS@@ @@NON_THREADED_LIBS@@" +libs="$ldflags -L$pkglibdir -lmysqlclient -lmysys @@ZLIB_DEPS@@ @@NON_THREADED_LIBS@@" d58 3 a60 1 libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` a61 3 -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@" +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@ZLIB_DEPS@@ @@LIBS@@ @@openssl_libs@@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` a62 1 include="-I$pkgincludedir" d64 2 a65 2 --- scripts/mysql_create_system_tables.sh.orig 2005-11-15 01:12:45 +0100 +++ scripts/mysql_create_system_tables.sh 2005-11-21 21:18:29 +0100 @ 1.21 log @apply Berkeley-DB patches from 'db' package to MySQL's local copy, too @ text @d2 3 a4 3 --- include/Makefile.in.orig 2005-10-10 00:47:19 +0200 +++ include/Makefile.in 2005-11-07 18:12:04 +0100 @@@@ -330,14 +330,14 @@@@ d8 2 a9 2 - sql_state.h mysql_time.h $(BUILT_SOURCES) + sql_state.h mysql_time.h my_aes.h rijndael.h $(BUILT_SOURCES) d12 1 a12 1 nisam.h heap.h merge.h my_bitmap.h\ d17 4 a20 4 + my_nosys.h my_alarm.h queues.h sha1.h \ + my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ mysql_version.h.in my_handler.h my_time.h d23 3 a25 3 --- include/my_global.h.orig 2005-10-10 00:46:23 +0200 +++ include/my_global.h 2005-11-07 18:12:04 +0100 @@@@ -680,9 +680,8 @@@@ d34 14 a47 2 /* Max size that must be added to a so that we know Size to make d49 2 a50 2 --- scripts/mysql_config.sh.orig 2005-10-10 00:46:25 +0200 +++ scripts/mysql_config.sh 2005-11-07 18:12:04 +0100 d66 3 a68 3 --- scripts/mysql_create_system_tables.sh.orig 2005-10-10 00:46:35 +0200 +++ scripts/mysql_create_system_tables.sh 2005-11-07 18:12:04 +0100 @@@@ -71,9 +71,6 @@@@ d73 2 a74 2 - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" d78 1 a78 1 @@@@ -150,17 +147,13 @@@@ d80 3 a82 3 i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); d85 1 a85 1 + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" d87 1 a87 1 i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" d91 1 a91 1 - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); d94 1 a94 1 + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" d97 1 a97 115 INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" Index: scripts/mysqld_safe.sh --- scripts/mysqld_safe.sh.orig 2005-10-10 00:46:44 +0200 +++ scripts/mysqld_safe.sh 2005-11-07 18:12:04 +0100 @@@@ -121,7 +121,7 @@@@ # Next try where the source installs put it elif test -d $MY_BASEDIR_VERSION/var/mysql then - DATADIR=$MY_BASEDIR_VERSION/var + DATADIR=$MY_BASEDIR_VERSION/var/mysql # Or just give up and use our compiled-in default else DATADIR=@@localstatedir@@ Index: mysys/Makefile.in --- mysys/Makefile.in.orig 2005-10-10 00:47:23 +0200 +++ mysys/Makefile.in 2005-11-10 11:50:57 +0100 @@@@ -247,6 +247,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ @@@@ -452,6 +453,7 @@@@ vio_dir = @@vio_dir@@ vio_libs = @@vio_libs@@ zlib_dir = @@zlib_dir@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) Index: mysys/default.c --- mysys/default.c.orig 2005-11-10 10:26:30 +0100 +++ mysys/default.c 2005-11-10 11:53:32 +0100 @@@@ -48,7 +48,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +ETCDIR, #endif #ifdef DATADIR DATADIR, Index: libmysql/Makefile.in --- libmysql/Makefile.in.orig 2005-10-10 00:47:20 +0200 +++ libmysql/Makefile.in 2005-11-10 12:13:57 +0100 @@@@ -213,6 +213,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) @@@@ -420,6 +421,7 @@@@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ $(openssl_includes) @@ZLIB_INCLUDES@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) Index: libmysql_r/Makefile.in --- libmysql_r/Makefile.in.orig 2005-10-10 00:47:20 +0200 +++ libmysql_r/Makefile.in 2005-11-10 12:14:34 +0100 @@@@ -211,6 +211,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) @@@@ -419,6 +420,7 @@@@ -I$(top_builddir)/include -I$(top_srcdir)/include \ $(openssl_includes) @@ZLIB_INCLUDES@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) Index: bdb/mutex/mut_fcntl.c --- bdb/mutex/mut_fcntl.c.orig 2005-10-10 00:46:27 +0200 +++ bdb/mutex/mut_fcntl.c 2005-11-11 13:44:07 +0100 @@@@ -101,7 +101,7 @@@@ /* Acquire an exclusive kernel lock. */ k_lock.l_type = F_WRLCK; - if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock)) + if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock) == -1) return (__os_get_errno()); /* If the resource is still available, it's ours. */ @@@@ -112,7 +112,7 @@@@ /* Release the kernel lock. */ k_lock.l_type = F_UNLCK; - if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock)) + if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock) == -1) return (__os_get_errno()); /* Index: bdb/os/os_open.c --- bdb/os/os_open.c.orig 2005-10-10 00:46:27 +0200 +++ bdb/os/os_open.c 2005-11-11 13:44:07 +0100 @@@@ -93,7 +93,7 @@@@ if (LF_ISSET(DB_OSO_TRUNC)) oflags |= O_TRUNC; -#ifdef HAVE_O_DIRECT +#if defined(HAVE_O_DIRECT) && defined(__FreeBSD__) if (LF_ISSET(DB_OSO_DIRECT)) oflags |= O_DIRECT; #endif @ 1.20 log @try to tell the MySQL client library where to find our my.cnf @ text @d167 33 @ 1.19 log @move DATADIR subst into mysql.patch to be more in sync with the remaining MySQL patching @ text @d98 69 @ 1.18 log @as the isinf(3) problem is such persistent, take the largest hammer and finally get MySQL building on all platforms, please. @ text @d2 2 a3 2 --- include/Makefile.in.orig 2005-08-17 19:07:18.000000000 +0200 +++ include/Makefile.in 2005-10-07 22:33:25.711132965 +0200 d23 3 a25 3 --- include/my_global.h.orig 2005-08-17 19:06:28.000000000 +0200 +++ include/my_global.h 2005-10-07 22:58:45.677758340 +0200 @@@@ -676,9 +676,8 @@@@ d37 2 a38 2 --- scripts/mysql_config.sh.orig 2005-08-17 19:06:30.000000000 +0200 +++ scripts/mysql_config.sh 2005-10-07 22:33:25.711956605 +0200 d54 2 a55 2 --- scripts/mysql_create_system_tables.sh.orig 2005-08-17 19:06:38.000000000 +0200 +++ scripts/mysql_create_system_tables.sh 2005-10-07 22:33:25.712540957 +0200 d86 12 @ 1.18.2.1 log @MFC: fix path calculation for run-time directory @ text @a85 12 Index: scripts/mysqld_safe.sh --- scripts/mysqld_safe.sh.orig 2005-10-10 00:46:44 +0200 +++ scripts/mysqld_safe.sh 2005-11-07 18:12:04 +0100 @@@@ -121,7 +121,7 @@@@ # Next try where the source installs put it elif test -d $MY_BASEDIR_VERSION/var/mysql then - DATADIR=$MY_BASEDIR_VERSION/var + DATADIR=$MY_BASEDIR_VERSION/var/mysql # Or just give up and use our compiled-in default else DATADIR=@@localstatedir@@ @ 1.18.2.2 log @MFC: tell the MySQL client library where to find our my.cnf @ text @a97 69 Index: mysys/Makefile.in --- mysys/Makefile.in.orig 2005-10-10 00:47:23 +0200 +++ mysys/Makefile.in 2005-11-10 11:50:57 +0100 @@@@ -247,6 +247,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ @@@@ -452,6 +453,7 @@@@ vio_dir = @@vio_dir@@ vio_libs = @@vio_libs@@ zlib_dir = @@zlib_dir@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) Index: mysys/default.c --- mysys/default.c.orig 2005-11-10 10:26:30 +0100 +++ mysys/default.c 2005-11-10 11:53:32 +0100 @@@@ -48,7 +48,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +ETCDIR, #endif #ifdef DATADIR DATADIR, Index: libmysql/Makefile.in --- libmysql/Makefile.in.orig 2005-10-10 00:47:20 +0200 +++ libmysql/Makefile.in 2005-11-10 12:13:57 +0100 @@@@ -213,6 +213,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) @@@@ -420,6 +421,7 @@@@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ $(openssl_includes) @@ZLIB_INCLUDES@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) Index: libmysql_r/Makefile.in --- libmysql_r/Makefile.in.orig 2005-10-10 00:47:20 +0200 +++ libmysql_r/Makefile.in 2005-11-10 12:14:34 +0100 @@@@ -211,6 +211,7 @@@@ DARWIN_MWCC_FALSE = @@DARWIN_MWCC_FALSE@@ DARWIN_MWCC_TRUE = @@DARWIN_MWCC_TRUE@@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ + -DETCDIR="\"$(MYSQLETCdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) @@@@ -419,6 +420,7 @@@@ -I$(top_builddir)/include -I$(top_srcdir)/include \ $(openssl_includes) @@ZLIB_INCLUDES@@ +MYSQLETCdir = $(sysconfdir) MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir = $(prefix) @ 1.18.2.3 log @take over Berkeley-DB patches from 'db' package and remove an obsolete substitution in %build @ text @a166 33 Index: bdb/mutex/mut_fcntl.c --- bdb/mutex/mut_fcntl.c.orig 2005-10-10 00:46:27 +0200 +++ bdb/mutex/mut_fcntl.c 2005-11-11 13:44:07 +0100 @@@@ -101,7 +101,7 @@@@ /* Acquire an exclusive kernel lock. */ k_lock.l_type = F_WRLCK; - if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock)) + if (fcntl(dbenv->lockfhp->fd, F_SETLKW, &k_lock) == -1) return (__os_get_errno()); /* If the resource is still available, it's ours. */ @@@@ -112,7 +112,7 @@@@ /* Release the kernel lock. */ k_lock.l_type = F_UNLCK; - if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock)) + if (fcntl(dbenv->lockfhp->fd, F_SETLK, &k_lock) == -1) return (__os_get_errno()); /* Index: bdb/os/os_open.c --- bdb/os/os_open.c.orig 2005-10-10 00:46:27 +0200 +++ bdb/os/os_open.c 2005-11-11 13:44:07 +0100 @@@@ -93,7 +93,7 @@@@ if (LF_ISSET(DB_OSO_TRUNC)) oflags |= O_TRUNC; -#ifdef HAVE_O_DIRECT +#if defined(HAVE_O_DIRECT) && defined(__FreeBSD__) if (LF_ISSET(DB_OSO_DIRECT)) oflags |= O_DIRECT; #endif @ 1.17 log @ok, seems like MySQL wishes the even bigger hammer to get rid of the isinf(3) issues also under Solaris @ text @d2 3 a4 3 --- include/Makefile.in.orig 2005-02-12 21:38:02 +0100 +++ include/Makefile.in 2005-02-16 20:05:41 +0100 @@@@ -328,14 +328,14 @@@@ d22 5 a26 9 Index: mysys/default.c --- mysys/default.c.orig 2005-02-12 21:37:31 +0100 +++ mysys/default.c 2005-02-16 20:05:41 +0100 @@@@ -48,7 +48,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +"@@l_prefix@@/etc/mysql/", d28 8 a35 2 #ifdef DATADIR DATADIR, d37 3 a39 3 --- scripts/mysql_config.sh.orig 2005-02-12 21:37:31 +0100 +++ scripts/mysql_config.sh 2005-02-16 20:05:41 +0100 @@@@ -85,11 +85,11 @@@@ d54 2 a55 2 --- scripts/mysql_create_system_tables.sh.orig 2005-02-14 11:40:14 +0100 +++ scripts/mysql_create_system_tables.sh 2005-02-16 20:05:41 +0100 a85 48 Index: strings/Makefile.in --- strings/Makefile.in.orig 2005-08-17 19:07:47 +0200 +++ strings/Makefile.in 2005-09-27 09:57:09 +0200 @@@@ -311,7 +311,7 @@@@ CCASFLAGS = @@CCASFLAGS@@ CCDEPMODE = @@CCDEPMODE@@ CC_VERSION = @@CC_VERSION@@ -CFLAGS = @@CFLAGS@@ +CFLAGS = @@CFLAGS@@ -std=c99 CHECK_PID = @@CHECK_PID@@ CHMOD = @@CHMOD@@ CLIENT_EXTRA_LDFLAGS = @@CLIENT_EXTRA_LDFLAGS@@ Index: libmysql/Makefile.in --- libmysql/Makefile.in.orig 2005-08-17 19:07:19.000000000 +0200 +++ libmysql/Makefile.in 2005-09-27 10:13:02.550981000 +0200 @@@@ -190,7 +190,7 @@@@ CCASFLAGS = @@CCASFLAGS@@ CCDEPMODE = @@CCDEPMODE@@ CC_VERSION = @@CC_VERSION@@ -CFLAGS = @@CFLAGS@@ +CFLAGS = @@CFLAGS@@ -std=c99 CHECK_PID = @@CHECK_PID@@ CHMOD = @@CHMOD@@ CLIENT_EXTRA_LDFLAGS = @@CLIENT_EXTRA_LDFLAGS@@ Index: libmysql_r/Makefile.in --- libmysql_r/Makefile.in.orig 2005-08-17 19:07:19.000000000 +0200 +++ libmysql_r/Makefile.in 2005-09-27 10:13:14.180681000 +0200 @@@@ -188,7 +188,7 @@@@ CCASFLAGS = @@CCASFLAGS@@ CCDEPMODE = @@CCDEPMODE@@ CC_VERSION = @@CC_VERSION@@ -CFLAGS = @@CFLAGS@@ +CFLAGS = @@CFLAGS@@ -std=c99 CHECK_PID = @@CHECK_PID@@ CHMOD = @@CHMOD@@ CLIENT_EXTRA_LDFLAGS = @@CLIENT_EXTRA_LDFLAGS@@ Index: include/my_global.h --- include/my_global.h.orig 2005-08-17 19:06:28 +0200 +++ include/my_global.h 2005-09-28 20:07:41 +0200 @@@@ -676,7 +676,7 @@@@ #define FLT_MAX ((float)3.40282346638528860e+38) #endif -#if !defined(HAVE_ISINF) && !defined(isinf) +#if !defined(HAVE_ISINF) #define isinf(X) 0 #endif @ 1.16 log @isinf(3) is a feature of the C99 standard. Unfortunately a global -std=c99 cannot be passed to gcc as MySQL is unable to cope with the stricter C99 constraints in general. Hence we switch to C99 only for the library part where isinf(3) is actually used (and where C99 mode is explicitly required to make the macro available under at least Solaris) @ text @d120 12 @ 1.15 log @upgrading package: mysql 4.1.9 -> 4.1.10 @ text @d84 36 @ 1.15.4.1 log @Security Fix (CVE-2005-2558, OpenPKG-SA-2005.024) @ text @a83 47 ----------------------------------------------------------------------------- Security Fix (CVE-2005-2558, OpenPKG-SA-2005.024) Index: libmysqld/sql_udf.cc --- libmysqld/sql_udf.cc.orig 2005-05-13 13:32:15 +0200 +++ libmysqld/sql_udf.cc 2005-12-03 10:46:25 +0100 @@@@ -222,7 +222,7 @@@@ } tmp->dlhandle = dl; { - char buf[MAX_FIELD_NAME+16], *missing; + char buf[NAME_LEN+16], *missing; if ((missing= init_syms(tmp, buf))) { sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), missing); @@@@ -439,7 +439,7 @@@@ } udf->dlhandle=dl; { - char buf[MAX_FIELD_NAME+16], *missing; + char buf[NAME_LEN+16], *missing; if ((missing= init_syms(udf, buf))) { net_printf(thd, ER_CANT_FIND_DL_ENTRY, missing); Index: sql/sql_udf.cc --- sql/sql_udf.cc.orig 2005-05-13 13:32:15 +0200 +++ sql/sql_udf.cc 2005-12-03 10:46:25 +0100 @@@@ -222,7 +222,7 @@@@ } tmp->dlhandle = dl; { - char buf[MAX_FIELD_NAME+16], *missing; + char buf[NAME_LEN+16], *missing; if ((missing= init_syms(tmp, buf))) { sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), missing); @@@@ -439,7 +439,7 @@@@ } udf->dlhandle=dl; { - char buf[MAX_FIELD_NAME+16], *missing; + char buf[NAME_LEN+16], *missing; if ((missing= init_syms(udf, buf))) { net_printf(thd, ER_CANT_FIND_DL_ENTRY, missing); @ 1.14 log @backed out last update partially which skipped the config file @ text @a0 11 --- mysys/default.c.orig 2004-06-27 23:56:50 +0200 +++ mysys/default.c 2004-07-01 19:20:13 +0200 @@@@ -48,7 +48,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +"@@l_prefix@@/etc/mysql/", #endif #ifdef DATADIR DATADIR, d2 3 a4 3 --- include/Makefile.in.orig 2005-01-11 23:06:33 +0100 +++ include/Makefile.in 2005-01-15 09:36:06 +0100 @@@@ -325,14 +325,14 @@@@ d22 12 d35 3 a37 3 --- scripts/mysql_config.sh.orig 2005-01-11 23:06:00 +0100 +++ scripts/mysql_config.sh 2005-01-15 09:38:51 +0100 @@@@ -86,9 +86,9 @@@@ d41 3 a43 2 -libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs="$ldflags -L$pkglibdir -lmysqlclient -lmysys $client_libs" d45 3 a47 2 -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @@LIBS@@ @@ZLIB_LIBS@@ @@openssl_libs@@" +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@LIBS@@ @@ZLIB_LIBS@@ @@openssl_libs@@" d52 2 a53 2 --- scripts/mysql_create_system_tables.sh.orig 2005-01-11 23:06:03 +0100 +++ scripts/mysql_create_system_tables.sh 2005-01-15 09:36:06 +0100 d83 1 a83 1 INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @ 1.13 log @upgrading package: mysql 4.1.8a -> 4.1.9 @ text @d1 11 @ 1.12 log @correct mysql_config script, it's libmysys and not libmysys_r @ text @d1 9 a9 18 Index: mysys/default.c --- mysys/default.c.orig 2004-06-27 23:56:50 +0200 +++ mysys/default.c 2004-07-01 19:20:13 +0200 @@@@ -48,7 +48,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +"@@l_prefix@@/etc/mysql/", #endif #ifdef DATADIR DATADIR, Index: scripts/msql2mysql.sh --- scripts/msql2mysql.sh.orig 2004-06-27 23:57:02 +0200 +++ scripts/msql2mysql.sh 2004-07-01 19:20:13 +0200 @@@@ -13,4 +13,4 @@@@ # described in the License. Among other things, the License requires that # the copyright notice and this notice be preserved on all copies. d11 10 a20 6 -@@bindir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +@@libexecdir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* Index: scripts/mysql_install_db.sh --- scripts/mysql_install_db.sh.orig 2004-06-27 23:56:51 +0200 +++ scripts/mysql_install_db.sh 2004-07-01 19:20:13 +0200 @@@@ -186,9 +186,8 @@@@ d22 6 a27 7 if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi - if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi if test -w / -a ! -z "$user"; then - chown $user $ldata $ldata/mysql $ldata/test; + chown $user $ldata $ldata/mysql fi d29 8 a36 13 if test ! -f $mdata/db.frm @@@@ -262,10 +261,7 @@@@ if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" - echo "cd @@prefix@@ ; $bindir/mysqld_safe &" - echo - echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" - echo "cd sql-bench ; perl run-all-tests" + echo "@@l_prefix@@/etc/rc mysql start" echo fi echo "Please report any problems with the @@scriptdir@@/mysqlbug script!" d38 5 a42 5 --- scripts/mysql_create_system_tables.sh.orig 2004-06-27 23:57:01 +0200 +++ scripts/mysql_create_system_tables.sh 2004-07-01 19:23:36 +0200 @@@@ -70,9 +70,6 @@@@ c_d="$c_d KEY User (User)" c_d="$c_d )" d50 1 a50 1 @@@@ -147,17 +144,13 @@@@ a69 34 Index: include/Makefile.in --- include/Makefile.in.orig 2004-12-14 13:41:12 +0100 +++ include/Makefile.in 2004-12-17 09:48:10 +0100 @@@@ -324,14 +324,14 @@@@ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h my_dir.h typelib.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - sql_state.h mysql_time.h $(BUILT_SOURCES) + sql_state.h mysql_time.h my_aes.h rijndael.h $(BUILT_SOURCES) noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ mysys_err.h my_base.h help_start.h help_end.h \ - my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ - my_aes.h my_tree.h hash.h thr_alarm.h \ + my_nosys.h my_alarm.h queues.h sha1.h \ + my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ mysql_version.h.in my_handler.h my_time.h Index: scripts/mysql_config.sh --- scripts/mysql_config.sh.orig 2004-10-28 02:48:36 +0200 +++ scripts/mysql_config.sh 2004-12-14 14:29:04 +0100 @@@@ -86,7 +86,7 @@@@ # Create options -libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs="$ldflags -L$pkglibdir -lmysqlclient -lmysys $client_libs" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @@LIBS@@ @@openssl_libs@@" +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r -lmysys @@LIBS@@ @@openssl_libs@@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` @ 1.11 log @In preparation to OpenPKG 2.3, finally remove obsoleted/end-of-life MySQL versions 3.23 and 4.0 in favor to the current stable production version 4.1 and the development version 5.0. The following shifting was done: none -> PLUS mysql40 4.0.22 BASE mysql 4.0.22 -> BASE mysql 4.1.8 PLUS mysql41 4.1.8 -> none EVAL mysql3 3.23.58 -> none @ text @d113 1 a113 1 +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r -lmysys_r @@LIBS@@ @@openssl_libs@@" @ 1.10 log @export library lmysys_r for multi-threading @ text @d1 26 a26 4 --- scripts/mysql_install_db.sh.dist Wed Jan 29 12:29:21 2003 +++ scripts/mysql_install_db.sh Wed Feb 5 09:56:12 2003 @@@@ -138,9 +138,8 @@@@ then a33 21 fi @@@@ -178,8 +177,6 @@@@ c_d="$c_d )" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" fi if test ! -f $mdata/host.frm @@@@ -250,10 +247,7 @@@@ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi d35 3 a37 3 if test ! -f $mdata/func.frm @@@@ -351,10 +345,7 @@@@ if test "$IN_RPM" -eq 0 d48 11 a58 5 --- scripts/msql2mysql.sh.dist Tue Feb 11 09:50:29 2003 +++ scripts/msql2mysql.sh Tue Feb 11 09:53:08 2003 @@@@ -13,4 +13,4 @@@@ # described in the License. Among other things, the License requires that # the copyright notice and this notice be preserved on all copies. d60 21 a80 67 -@@bindir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +@@libexecdir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* --- mysys/default.c.dist Wed Jan 29 12:29:20 2003 +++ mysys/default.c Wed Feb 5 09:58:40 2003 @@@@ -49,7 +49,7 @@@@ #elif defined(__NETWARE__) "sys:/etc/", #else -"/etc/", +"@@l_prefix@@/etc/mysql/", #endif #ifdef DATADIR DATADIR, --- config.h.in.orig 2004-12-09 12:21:30.331530371 +0100 +++ config.h.in 2004-12-09 12:21:33.941576868 +0100 @@@@ -628,6 +628,9 @@@@ /* Define to 1 if you have the `setupterm' function. */ #undef HAVE_SETUPTERM +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + /* Define to 1 if you have the `sighold' function. */ #undef HAVE_SIGHOLD --- include/my_pthread.h.orig 2004-10-28 02:48:34.000000000 +0200 +++ include/my_pthread.h 2004-12-09 12:23:37.673149500 +0100 @@@@ -229,7 +229,6 @@@@ #ifdef HAVE_rts_threads #define sigwait org_sigwait -#include #undef sigwait #endif #undef _REENTRANT /* Fix if _REENTRANT is in pthread.h */ @@@@ -240,6 +239,9 @@@@ #ifdef HAVE_THR_SETCONCURRENCY #include /* Probably solaris */ #endif +#ifdef HAVE_SIGNAL_H +#include +#endif #ifdef HAVE_SCHED_H #include #endif --- configure.in.orig 2004-10-28 02:48:38.000000000 +0200 +++ configure.in 2004-12-09 12:26:09.585078188 +0100 @@@@ -735,7 +735,7 @@@@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ - memory.h pwd.h select.h \ + memory.h pwd.h select.h signal.h \ stdlib.h stddef.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ --- configure.orig 2004-10-28 02:48:59.000000000 +0200 +++ configure 2004-12-09 12:22:45.602487633 +0100 @@@@ -21408,7 +21408,7 @@@@ for ac_header in fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ - memory.h pwd.h select.h \ + memory.h pwd.h select.h signal.h \ stdlib.h stddef.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ d82 3 a84 4 --- include/Makefile.in.orig 2004-10-28 02:48:55 +0200 +++ include/Makefile.in 2004-12-14 14:27:28 +0100 @@@@ -281,14 +281,14 @@@@ my_semaphore.h my_pthread.h my_no_pthread.h raid.h \ d86 4 a89 3 my_getopt.h sslopt-longopts.h my_dir.h \ - sslopt-vars.h sslopt-case.h $(BUILT_SOURCES) + sslopt-vars.h sslopt-case.h my_aes.h rijndael.h $(BUILT_SOURCES) d99 2 a100 2 thr_lock.h t_ctype.h violite.h md5.h mysql_version.h.in @ 1.9 log @update mysql: export headers aes.h/rijndael.h and library libmysys to mysql_config @ text @d151 2 a152 1 libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @@LIBS@@ @@openssl_libs@@" @ 1.8 log @try correcting threads and signals definitions problem on Solaris 8 @ text @d120 33 @ 1.7 log @upgrading package: mysql 4.0.18 -> 4.0.20 @ text @d66 54 @ 1.7.4.1 log @OpenPKG-SA-2005.006-mysql for CAN-2005-0004, CAN-2005-0709, CAN-2005-0710, and CAN-2005-0711 @ text @a65 474 OpenPKG-SA-2005.006-mysql CAN-2005-0004 Users may overwrite arbitrary files or read temporary files via a symlink attack on insecurely created temporary files. Patch code taken from http://lists.mysql.com/internals/20600 --- scripts/mysqlaccess.sh.orig 2004-09-07 00:29:37 +0200 +++ scripts/mysqlaccess.sh 2005-04-15 11:51:42 +0200 @@@@ -2,7 +2,7 @@@@ # **************************** package MySQLaccess; #use strict; -use POSIX qw(tmpnam); +use File::Temp qw(tempfile tmpnam); use Fcntl; BEGIN { @@@@ -32,7 +32,6 @@@@ $ACCESS_U_BCK = 'user_backup'; $ACCESS_D_BCK = 'db_backup'; $DIFF = '/usr/bin/diff'; - $TMP_PATH = '/tmp'; #path to writable tmp-directory $MYSQLDUMP = '@@bindir@@/mysqldump'; #path to mysqldump executable @@@@ -432,7 +431,7 @@@@ # no caching on STDOUT $|=1; - $MYSQL_CNF = POSIX::tmpnam(); + $MYSQL_CNF = tmpnam(); %MYSQL_CNF = (client => { }, mysql => { }, mysqldump => { }, @@@@ -577,8 +576,6 @@@@ push(@@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); push(@@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); push(@@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); -push(@@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); -push(@@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); if (@@MySQLaccess::Grant::Error) { MySQLaccess::Report::Print_Error_Messages() ; exit 0; @@@@ -1777,17 +1774,15 @@@@ @@before = sort(@@before); @@after = sort(@@after); - $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; - $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; - #$after = "/tmp/t0"; - open(BEFORE,"> $before") || - push(@@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); - open(AFTER,"> $after") || - push(@@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); - print BEFORE join("\n",@@before); - print AFTER join("\n",@@after); - close(BEFORE); - close(AFTER); + ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + ($ha, $after) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + + print $hb join("\n",@@before); + print $ha join("\n",@@after); + close $hb; + close $ha; # ---------------------------------- # compute difference @@@@ -1800,8 +1795,8 @@@@ # ---------------------------------- # cleanup temp. files - unlink(BEFORE); - unlink(AFTER); + unlink($before); + unlink($after); return \@@diffs; } @@@@ -2316,14 +2311,6 @@@@ => "The diff program <$MySQLaccess::DIFF> could not be found.\n" ."+ Check your path, or\n" ."+ edit the source of this script to point \$DIFF to the diff program.\n" - ,'not_found_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" - ."+ create this directory (writeable!), or\n" - ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" - ,'write_err_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" - ."+ make this directory writeable!, or\n" - ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" ,'Unrecognized_option' => "Sorry,\n" ."You are using an old version of the mysql-program,\n" OpenPKG-SA-2005.006-mysql CAN-2005-0709 Arbitrary code execution using CREATE FUNCTION and user definable functions (UDFs), loading dynamic library symbols with dlsym(3). Patch code extracted from mysql-4.0.24/sql/sql_udf.cc, mysql-4.0.24/sql/mysqld.cc, and mysql-4.0.24/sql/mysql_priv.h --- sql/sql_udf.cc.orig 2004-09-07 00:29:38 +0200 +++ sql/sql_udf.cc 2005-04-15 12:07:38 +0200 @@@@ -79,23 +79,45 @@@@ static void *find_udf_dl(const char *dl); -static void init_syms(udf_func *tmp) +static char *init_syms(udf_func *tmp, char *nm) { - char nm[MAX_FIELD_NAME+16],*end; + char *end; + + /* short circuit immediately if dlsym(3) fails */ + if (!((tmp->func=dlsym(tmp->dlhandle, tmp->name)))) + return tmp->name; - tmp->func = dlsym(tmp->dlhandle, tmp->name); end=strmov(nm,tmp->name); - (void) strmov(end,"_init"); - tmp->func_init = dlsym(tmp->dlhandle, nm); - (void) strmov(end,"_deinit"); - tmp->func_deinit = dlsym(tmp->dlhandle, nm); + if (tmp->type == UDFTYPE_AGGREGATE) { (void)strmov( end, "_reset" ); - tmp->func_reset = dlsym( tmp->dlhandle, nm ); + if (!((tmp->func_reset=dlsym(tmp->dlhandle, nm)))) + return nm; /* failure, deny the udf load request */ (void)strmov( end, "_add" ); - tmp->func_add = dlsym( tmp->dlhandle, nm ); + if (!((tmp->func_add=dlsym(tmp->dlhandle, nm)))) + return nm; /* failure, deny the udf load request */ + } + + (void) strmov(end,"_deinit"); + tmp->func_deinit=dlsym(tmp->dlhandle, nm); + + (void) strmov(end,"_init"); + tmp->func_init=dlsym(tmp->dlhandle, nm); + + /* + prevent loading udf should no auxiliary symbols be defined, + for example to protect from calling functions in libc.so + */ + if (!tmp->func_init && !tmp->func_deinit && tmp->type != UDFTYPE_AGGREGATE) + { + if (opt_allow_suspicious_udfs) + sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), nm); + else + return nm; /* failure, deny the udf load request */ } + + return 0; /* success */ } extern "C" byte* get_hash_key(const byte *buff,uint *length, @@@@ -186,13 +208,14 @@@@ new_dl=1; } tmp->dlhandle = dl; - init_syms(tmp); - if (!tmp->func) - { - sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name); - del_udf(tmp); - if (new_dl) - dlclose(dl); + char buf[MAX_FIELD_NAME+16], *missing; + if ((missing=init_syms(tmp, buf))) + { + sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), missing); + del_udf(tmp); + if (new_dl) + dlclose(dl); + } } } if (error > 0) @@@@ -398,12 +421,13 @@@@ new_dl=1; } udf->dlhandle=dl; - init_syms(udf); - - if (udf->func == NULL) { - net_printf(&thd->net, ER_CANT_FIND_DL_ENTRY, udf->name); - goto err; + char buf[MAX_FIELD_NAME+16], *missing; + if ((missing=init_syms(udf, buf))) + { + net_printf(&thd->net, ER_CANT_FIND_DL_ENTRY, missing); + goto err; + } } udf->name=strdup_root(&mem,udf->name); udf->dl=strdup_root(&mem,udf->dl); --- sql/mysqld.cc.orig 2004-09-07 00:29:37 +0200 +++ sql/mysqld.cc 2005-04-15 12:07:38 +0200 @@@@ -311,7 +311,7 @@@@ static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0; my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; -my_bool opt_log_slave_updates= 0, opt_console= 0; +my_bool opt_log_slave_updates= 0, opt_console= 0, opt_allow_suspicious_udfs; my_bool opt_readonly = 0, opt_sync_bdb_logs, opt_sync_frm; volatile bool mqh_used = 0; @@@@ -3482,7 +3482,7 @@@@ OPT_BDB_MAX_LOCK, OPT_ERROR_LOG_FILE, OPT_DEFAULT_WEEK_FORMAT, - OPT_RANGE_ALLOC_BLOCK_SIZE, + OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_ALLOW_SUSPICIOUS_UDFS, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, OPT_SYNC_FRM, OPT_BDB_NOSYNC @@@@ -3495,6 +3495,13 @@@@ { {"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"allow-suspicious-udfs", OPT_ALLOW_SUSPICIOUS_UDFS, + "Allows use of UDFs consisting of only one symbol xxx() " + "without corresponding xxx_init() or xxx_deinit(). That also means " + "that one can load any function from any library, for example exit() " + "from libc.so", + (gptr*) &opt_allow_suspicious_udfs, (gptr*) &opt_allow_suspicious_udfs, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"basedir", 'b', "Path to installation directory. All paths are usually resolved relative to this.", (gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG, --- sql/mysql_priv.h.orig 2004-09-07 00:29:38 +0200 +++ sql/mysql_priv.h 2005-04-15 12:07:38 +0200 @@@@ -721,7 +721,7 @@@@ extern my_bool opt_safe_show_db, opt_local_infile; extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern my_bool opt_readonly, lower_case_file_system; -extern my_bool opt_enable_named_pipe, opt_sync_frm; +extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern FILE *bootstrap_file; OpenPKG-SA-2005.006-mysql CAN-2005-0710 Incomplete testing of dynamic library pathnames, risking insecure loading of UDFs from dynamic libraries in arbitrary locations. Patch code extracted from mysql-4.0.24/sql/sql_udf.cc --- sql/sql_udf.cc.orig 2004-09-07 00:29:38 +0200 +++ sql/sql_udf.cc 2005-04-15 12:13:15 +0200 @@@@ -165,6 +165,12 @@@@ if (table->fields >= 4) // New func table udftype=(Item_udftype) table->field[3]->val_int(); + if (strchr(dl_name, '/') || strlen(name) > NAME_LEN) + { + sql_print_error("Invalid row in mysql.func table for function '%.64s'", name); + continue; + } + if (!(tmp = add_udf(name,(Item_result) table->field[1]->val_int(), dl_name, udftype))) { OpenPKG-SA-2005.006-mysql CAN-2005-0711 Creation of temporary tables uses predictable file names, allowing some users to overwrite arbitrary files via a symlink attack. Patch code extracted from mysql-4.0.24/sql/table.cc, mysql-4.0.24/sql/ha_myisam.cc, mysql-4.0.24/mysys/mf_tempfile.c, mysql-4.0.24/myisammrg/myrg_create.c, mysql-4.0.24/myisam/mi_create.c, mysql-4.0.24/merge/mrg_create.c, mysql-4.0.24/isam/create.c, and mysql-4.0.24/include/my_global.h --- sql/table.cc.orig 2005-04-15 12:20:10 +0200 +++ sql/table.cc 2005-04-15 12:21:01 +0200 @@@@ -1048,6 +1048,10 @@@@ uint key_length; ulong length; char fill[IO_SIZE]; + int create_flags=O_RDWR | O_TRUNC; + + if (create_info->options & HA_LEX_CREATE_TMP_TABLE) + create_flags |= O_EXCL | O_NOFOLLOW; #if SIZEOF_OFF_T > 4 /* Fix this in MySQL 4.0; The current limit is 4G rows (QQ) */ @@@@ -1062,7 +1066,7 @@@@ */ set_if_smaller(create_info->raid_chunks, 255); - if ((file=my_create(name,CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) + if ((file=my_create(name,CREATE_MODE,create_flags,MYF(MY_WME))) >= 0) { bzero((char*) fileinfo,64); fileinfo[0]=(uchar) 254; fileinfo[1]= 1; fileinfo[2]= FRM_VER+1; // Header --- sql/ha_myisam.cc.orig 2004-09-07 00:29:38 +0200 +++ sql/ha_myisam.cc 2005-04-15 12:21:01 +0200 @@@@ -1038,7 +1038,7 @@@@ HA_CREATE_INFO *info) { int error; - uint i,j,recpos,minpos,fieldpos,temp_length,length; + uint i,j,recpos,minpos,fieldpos,temp_length,length,create_flags=0; bool found_real_auto_increment=0; enum ha_base_keytype type; char buff[FN_REFLEN]; @@@@ -1210,17 +1210,21 @@@@ create_info.data_file_name= info->data_file_name; create_info.index_file_name=info->index_file_name; + if (info->options & HA_LEX_CREATE_TMP_TABLE) + create_flags |= HA_CREATE_TMP_TABLE; + if (options & HA_OPTION_PACK_RECORD) + create_flags |= HA_PACK_RECORD; + if (options & HA_OPTION_CHECKSUM) + create_flags |= HA_CREATE_CHECKSUM; + if (options & HA_OPTION_DELAY_KEY_WRITE) + create_flags |= HA_CREATE_DELAY_KEY_WRITE; + /* TODO: Check that the following fn_format is really needed */ error=mi_create(fn_format(buff,name,"","",2+4), table_arg->keys,keydef, (uint) (recinfo_pos-recinfo), recinfo, 0, (MI_UNIQUEDEF*) 0, - &create_info, - (((options & HA_OPTION_PACK_RECORD) ? HA_PACK_RECORD : 0) | - ((options & HA_OPTION_CHECKSUM) ? HA_CREATE_CHECKSUM : 0) | - ((options & HA_OPTION_DELAY_KEY_WRITE) ? - HA_CREATE_DELAY_KEY_WRITE : 0))); - + &create_info, create_flags); my_free((gptr) recinfo,MYF(0)); DBUG_RETURN(error); --- mysys/mf_tempfile.c.orig 2004-09-07 00:29:37 +0200 +++ mysys/mf_tempfile.c 2005-04-15 12:21:01 +0200 @@@@ -70,7 +70,7 @@@@ { strmake(to,res,FN_REFLEN-1); (*free)(res); - file=my_create(to,0, mode, MyFlags); + file=my_create(to,0, mode | O_EXCL | O_NOFOLLOW, MyFlags); } environ=old_env; } @@@@ -81,7 +81,7 @@@@ { strmake(to,res,FN_REFLEN-1); (*free)(res); - file=my_create(to, 0, mode, MyFlags); + file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags); } #elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__) { @@@@ -143,7 +143,7 @@@@ strmake(to,res,FN_REFLEN-1); (*free)(res); file=my_create(to,0, - (int) (O_RDWR | O_BINARY | O_TRUNC | + (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW | O_TEMPORARY | O_SHORT_LIVED), MYF(MY_WME)); @@@@ -186,7 +186,7 @@@@ } (void) strmov(end_pos,TMP_EXT); file=my_create(to,0, - (int) (O_RDWR | O_BINARY | O_TRUNC | + (int) (O_RDWR | O_BINARY | O_TRUNC | O_EXCL | O_NOFOLLOW | O_TEMPORARY | O_SHORT_LIVED), MYF(MY_WME)); } --- myisammrg/myrg_create.c.orig 2004-09-07 00:29:37 +0200 +++ myisammrg/myrg_create.c 2005-04-15 12:21:01 +0200 @@@@ -34,7 +34,7 @@@@ errpos=0; if ((file = my_create(fn_format(buff,name,"",MYRG_NAME_EXT,4),0, - O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0) goto err; errpos=1; if (table_names) --- myisam/mi_create.c.orig 2004-09-07 00:29:37 +0200 +++ myisam/mi_create.c 2005-04-15 12:21:01 +0200 @@@@ -37,7 +37,7 @@@@ { register uint i,j; File dfile,file; - int errpos,save_errno; + int errpos,save_errno,create_mode=O_RDWR | O_TRUNC; myf create_flag; uint fields,length,max_key_length,packed,pointer, key_length,info_length,key_segs,options,min_key_length_skipp, @@@@ -174,7 +174,10 @@@@ min_pack_length+=varchar_length+2*varchar_count; } if (flags & HA_CREATE_TMP_TABLE) + { options|= HA_OPTION_TMP_TABLE; + create_mode|= O_EXCL | O_NOFOLLOW; + } if (flags & HA_CREATE_CHECKSUM || (options & HA_OPTION_CHECKSUM)) { options|= HA_OPTION_CHECKSUM; @@@@ -505,7 +508,7 @@@@ if ((file= my_create_with_symlink(linkname_ptr, filename, - 0, O_RDWR | O_TRUNC, + 0, create_mode, MYF(MY_WME | create_flag))) < 0) goto err; errpos=1; @@@@ -516,7 +519,7 @@@@ if (share.base.raid_type) { (void) fn_format(filename,name,"",MI_NAME_DEXT,2+4); - if ((dfile=my_raid_create(filename,0,O_RDWR | O_TRUNC, + if ((dfile=my_raid_create(filename,0,create_mode, share.base.raid_type, share.base.raid_chunks, share.base.raid_chunksize, @@@@ -540,8 +543,7 @@@@ create_flag=MY_DELETE_OLD; } if ((dfile= - my_create_with_symlink(linkname_ptr, filename, - 0,O_RDWR | O_TRUNC, + my_create_with_symlink(linkname_ptr, filename, 0, create_mode, MYF(MY_WME | create_flag))) < 0) goto err; } --- merge/mrg_create.c.orig 2004-09-07 00:29:37 +0200 +++ merge/mrg_create.c 2005-04-15 12:21:01 +0200 @@@@ -33,7 +33,7 @@@@ errpos=0; if ((file = my_create(fn_format(buff,name,"",MRG_NAME_EXT,4),0, - O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0) goto err; errpos=1; if (table_names) --- isam/create.c.orig 2004-09-07 00:29:37 +0200 +++ isam/create.c 2005-04-15 12:21:01 +0200 @@@@ -58,13 +58,13 @@@@ base_pos=512; /* Enough for N_STATE_INFO */ bzero((byte*) &share,sizeof(share)); if ((file = my_create(fn_format(buff,name,"",N_NAME_IEXT,4),0, - O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + O_RDWR | O_EXCL | O_NOFOLLOW,MYF(MY_WME))) < 0) goto err; errpos=1; VOID(fn_format(buff,name,"",N_NAME_DEXT,2+4)); if (!(flags & HA_DONT_TOUCH_DATA)) { - if ((dfile = my_create(buff,0,O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + if ((dfile = my_create(buff,0,O_RDWR | O_EXCL | O_NOFOLLOW, MYF(MY_WME))) < 0) goto err; errpos=2; } --- include/my_global.h.orig 2004-09-07 00:29:36 +0200 +++ include/my_global.h 2005-04-15 12:21:01 +0200 @@@@ -500,6 +500,9 @@@@ #ifndef O_SHORT_LIVED #define O_SHORT_LIVED 0 #endif +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 +#endif /* #define USE_RECORD_LOCK */ @ 1.7.4.2 log @correct faulty scope logic in patch file @ text @d224 1 a224 1 @@@@ -186,13 +208,13 @@@@ d235 8 a242 7 + char buf[MAX_FIELD_NAME+16], *missing; + if ((missing=init_syms(tmp, buf))) + { + sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), missing); + del_udf(tmp); + if (new_dl) + dlclose(dl); @ 1.7.2.1 log @OpenPKG-SA-2004.045-mysql: CAN-2004-0836, CAN-2004-0837, MySQL bugs 3870 and 2708, MySQL bug 3933 @ text @a65 544 CAN-2004-0836 OpenPKG-SA-2004.045-mysql DNS attributed buffer overflow in mysql_real_connect --- libmysql/libmysql.c.orig 2004-05-14 02:53:34.000000000 +0200 +++ libmysql/libmysql.c 2004-10-28 18:27:41.255114242 +0200 @@@@ -1855,7 +1855,8 @@@@ sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno); goto error; } - memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); + memcpy(&sock_addr.sin_addr, hp->h_addr, + min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length)); my_gethostbyname_r_free(); } sock_addr.sin_port = (ushort) htons((ushort) port); CAN-2004-0836 OpenPKG-SA-2004.045-mysql DNS attributed buffer overflow in mysql_real_connect --- libmysql_r/libmysql.c.orig 2004-05-14 02:53:34 +0200 +++ libmysql_r/libmysql.c 2004-10-28 18:50:30 +0200 @@@@ -1855,7 +1855,8 @@@@ sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno); goto error; } - memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); + memcpy(&sock_addr.sin_addr, hp->h_addr, + min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length)); my_gethostbyname_r_free(); } sock_addr.sin_port = (ushort) htons((ushort) port); CAN-2004-0837 OpenPKG-SA-2004.045-mysql Multiple threads ALTERing MERGE tables to change the UNION can crash or stall the server --- myisammrg/myrg_open.c.orig 2004-05-14 02:53:41 +0200 +++ myisammrg/myrg_open.c 2004-10-29 13:26:45 +0200 @@@@ -32,44 +32,51 @@@@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { - int save_errno,i,errpos; - uint files,dir_length,length,key_parts; - ulonglong file_offset; + int save_errno,errpos=0; + uint files=0,i,dir_length,length,key_parts; + ulonglong file_offset=0; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; - MYRG_INFO info,*m_info; + MYRG_INFO *m_info=0; File fd; IO_CACHE file; - MI_INFO *isam,*last_isam; + MI_INFO *isam=0; + uint found_merge_insert_method= 0; DBUG_ENTER("myrg_open"); - LINT_INIT(last_isam); - LINT_INIT(m_info); - isam=0; - errpos=files=0; - bzero((gptr) &info,sizeof(info)); + LINT_INIT(key_parts); + bzero((char*) &file,sizeof(file)); if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,4), - O_RDONLY | O_SHARE,MYF(0))) < 0 || - init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0, - MYF(MY_WME | MY_NABP))) + O_RDONLY | O_SHARE,MYF(0))) < 0) goto err; errpos=1; + if (init_io_cache(&file, fd, 4*IO_SIZE, READ_CACHE, 0, 0, + MYF(MY_WME | MY_NABP))) + goto err; + errpos=2; dir_length=dirname_part(name_buff,name); - info.reclength=0; + while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) + { + if ((end=buff+length)[-1] == '\n') + end[-1]='\0'; + if (buff[0] && buff[0] != '#') + files++; + } + while ((length=my_b_gets(&file,buff,FN_REFLEN-1))) { if ((end=buff+length)[-1] == '\n') end[-1]='\0'; if (!buff[0]) - continue; /* Skip empty lines */ + continue;/* Skip empty lines */ if (buff[0] == '#') { if( !strncmp(buff+1,"INSERT_METHOD=",14)) - { /* Lookup insert method */ - int tmp=find_type(buff+15,&merge_insert_method,2); - info.merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); + { /* Lookup insert method */ + int tmp=find_type(buff+15,&merge_insert_method,2); + found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0); } - continue; /* Skip comments */ + continue;/* Skip comments */ } if (!test_if_hard_path(buff)) @@@@ -79,66 +86,54 @@@@ VOID(cleanup_dirname(buff,name_buff)); } if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0)))) - goto err; + goto err; + if (!m_info) + { + key_parts=isam->s->base.key_parts; + if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) + + files*sizeof(MYRG_TABLE) + + key_parts*sizeof(long), + MYF(MY_WME|MY_ZEROFILL)))) + goto err; + if (files) + { + m_info->open_tables=(MYRG_TABLE *) (m_info+1); + m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); + m_info->tables= files; + files= 0; + } + m_info->reclength=isam->s->base.reclength; + errpos=3; + } + m_info->open_tables[files].table= isam; + m_info->open_tables[files].file_offset=(my_off_t) file_offset; + file_offset+=isam->state->data_file_length; files++; - last_isam=isam; - if (info.reclength && info.reclength != isam->s->base.reclength) + if (m_info->reclength != isam->s->base.reclength) { my_errno=HA_ERR_WRONG_MRG_TABLE_DEF; goto err; } - info.reclength=isam->s->base.reclength; - } - key_parts=(isam ? isam->s->base.key_parts : 0); - if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO)+ - files*sizeof(MYRG_TABLE)+ - sizeof(long)*key_parts, - MYF(MY_WME)))) - goto err; - *m_info=info; - m_info->tables=files; - if (files) - { - m_info->open_tables=(MYRG_TABLE *) (m_info+1); - m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); - bzero((char*) m_info->rec_per_key_part,sizeof(long)*key_parts); - } - else - { - m_info->open_tables=0; - m_info->rec_per_key_part=0; + m_info->options|= isam->s->options; + m_info->records+= isam->state->records; + m_info->del+= isam->state->del; + m_info->data_file_length+= isam->state->data_file_length; + for (i=0; i < key_parts; i++) + m_info->rec_per_key_part[i]+=isam->s->state.rec_per_key_part[i] / m_info->tables; } - errpos=2; - for (i=files ; i-- > 0 ; ) - { - uint j; - m_info->open_tables[i].table=isam; - m_info->options|=isam->s->options; - m_info->records+=isam->state->records; - m_info->del+=isam->state->del; - m_info->data_file_length+=isam->state->data_file_length; - for (j=0; j < key_parts; j++) - m_info->rec_per_key_part[j]+=isam->s->state.rec_per_key_part[j] / files; - if (i) - isam=(MI_INFO*) (isam->open_list.next->data); - } + if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO), + MYF(MY_WME|MY_ZEROFILL)))) + goto err; /* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */ - m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA); + m_info->merge_insert_method= found_merge_insert_method; - /* Fix fileinfo for easyer debugging (actually set by rrnd) */ - file_offset=0; - for (i=0 ; (uint) i < files ; i++) - { - m_info->open_tables[i].file_offset=(my_off_t) file_offset; - file_offset+=m_info->open_tables[i].table->state->data_file_length; - } if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L) { my_errno=HA_ERR_RECORD_FILE_FULL; goto err; } - m_info->keys=(files) ? m_info->open_tables->table->s->base.keys : 0; + m_info->keys= files ? isam->s->base.keys : 0; bzero((char*) &m_info->by_key,sizeof(m_info->by_key)); /* this works ok if the table list is empty */ @@@@ -156,19 +151,16 @@@@ err: save_errno=my_errno; switch (errpos) { - case 2: + case 3: + while (files) + mi_close(m_info->open_tables[--files].table); my_free((char*) m_info,MYF(0)); /* Fall through */ + case 2: + end_io_cache(&file); + /* Fall through */ case 1: VOID(my_close(fd,MYF(0))); - end_io_cache(&file); - for (i=files ; i-- > 0 ; ) - { - isam=last_isam; - if (i) - last_isam=(MI_INFO*) (isam->open_list.next->data); - mi_close(isam); - } } my_errno=save_errno; DBUG_RETURN (NULL); No CAN available, MySQL bugs 3870 and 2708 OpenPKG-SA-2004.045-mysql Crash with MATCH... AGAINST (denial of service) --- myisam/ft_parser.c.orig 2004-05-14 02:53:24 +0200 +++ myisam/ft_parser.c 2004-10-29 14:38:43 +0200 @@@@ -129,22 +129,24 @@@@ *start=doc+1; return 3; /* FTB_RBR */ } - if ((*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT) - && !param->quot) + if (!param->quot) { - /* param->prev=' '; */ - *start=doc+1; - if (*doc == FTB_LQUOT) param->quot=*start; - return (*doc == FTB_RBR)+2; - } - if (param->prev == ' ' && !param->quot) - { - if (*doc == FTB_YES ) { param->yesno=+1; continue; } else - if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else - if (*doc == FTB_NO ) { param->yesno=-1; continue; } else - if (*doc == FTB_INC ) { param->plusminus++; continue; } else - if (*doc == FTB_DEC ) { param->plusminus--; continue; } else - if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; } + if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT) + { + /* param->prev=' '; */ + *start=doc+1; + if (*doc == FTB_LQUOT) param->quot=*start; + return (*doc == FTB_RBR)+2; + } + if (param->prev == ' ') + { + if (*doc == FTB_YES ) { param->yesno=+1; continue; } else + if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else + if (*doc == FTB_NO ) { param->yesno=-1; continue; } else + if (*doc == FTB_INC ) { param->plusminus++; continue; } else + if (*doc == FTB_DEC ) { param->plusminus--; continue; } else + if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; } + } } param->prev=*doc; param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0); @@@@ -170,6 +172,11 @@@@ return 1; } } + if (param->quot) + { + param->quot=*start=doc; + return 3; /* FTB_RBR */ + } return 0; } No CAN available, MySQL bug 3933 OpenPKG-SA-2004.045-mysql Privilege escalation on GRANT ALL ON `Foo\_Bar` --- include/my_sys.h.orig 2004-05-14 02:53:30 +0200 +++ include/my_sys.h 2004-10-29 14:59:11 +0200 @@@@ -620,7 +620,7 @@@@ const char *own_pathname_part); extern my_string my_load_path(my_string to, const char *path, const char *own_path_prefix); -extern int wild_compare(const char *str,const char *wildstr); +extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern); extern my_string my_strcasestr(const char *src,const char *suffix); extern int my_strcasecmp(const char *s,const char *t); extern int my_strsortcmp(const char *s,const char *t); --- mysys/mf_wcomp.c.orig 2004-05-14 02:53:18 +0200 +++ mysys/mf_wcomp.c 2004-10-29 15:08:55 +0200 @@@@ -25,9 +25,10 @@@@ char wild_one='?'; char wild_prefix=0; -int wild_compare(register const char *str, register const char *wildstr) +int wild_compare(register const char *str, register const char *wildstr, + pbool str_is_pattern) { - reg3 int flag; + char cmp; DBUG_ENTER("wild_compare"); while (*wildstr) @@@@ -35,33 +36,55 @@@@ while (*wildstr && *wildstr != wild_many && *wildstr != wild_one) { if (*wildstr == wild_prefix && wildstr[1]) - wildstr++; - if (*wildstr++ != *str++) DBUG_RETURN(1); + { + wildstr++; + if (str_is_pattern && *str++ != wild_prefix) + DBUG_RETURN(1); + } + if (*wildstr++ != *str++) + DBUG_RETURN(1); } - if (! *wildstr ) DBUG_RETURN (*str != 0); + if (! *wildstr ) + DBUG_RETURN(*str != 0); if (*wildstr++ == wild_one) { - if (! *str++) DBUG_RETURN (1); /* One char; skipp */ + if (! *str || (str_is_pattern && *str == wild_many)) + DBUG_RETURN(1); /* One char; skip */ + if (*str++ == wild_prefix && str_is_pattern && *str) + str++; } else { /* Found '*' */ - if (!*wildstr) DBUG_RETURN(0); /* '*' as last char: OK */ - flag=(*wildstr != wild_many && *wildstr != wild_one); - do + while (str_is_pattern && *str == wild_many) + str++; + for (; *wildstr == wild_many || *wildstr == wild_one; wildstr++) + if (*wildstr == wild_many) + { + while (str_is_pattern && *str == wild_many) + str++; + } + else + { + if (str_is_pattern && *str == wild_prefix && str[1]) + str+=2; + else if (! *str++) + DBUG_RETURN (1); + } + if (!*wildstr) + DBUG_RETURN(0);/* '*' as last char: OK */ + if ((cmp= *wildstr) == wild_prefix && wildstr[1] && !str_is_pattern) + cmp=wildstr[1]; + for (;;str++) { - if (flag) - { - char cmp; - if ((cmp= *wildstr) == wild_prefix && wildstr[1]) - cmp=wildstr[1]; - while (*str && *str != cmp) - str++; - if (!*str) DBUG_RETURN (1); - } - if (wild_compare(str,wildstr) == 0) DBUG_RETURN (0); - } while (*str++ && wildstr[0] != wild_many); - DBUG_RETURN(1); + while (*str && *str != cmp) + str++; + if (!*str) + DBUG_RETURN (1); + if (wild_compare(str,wildstr,str_is_pattern) == 0) + DBUG_RETURN (0); + } + /* We will never come here */ } } - DBUG_RETURN (*str != '\0'); + DBUG_RETURN (*str != 0); } /* wild_compare */ --- mysys/mf_wfile.c.orig 2004-05-14 02:53:35 +0200 +++ mysys/mf_wfile.c 2004-10-29 15:10:27 +0200 @@@@ -106,7 +106,7 @@@@ not_pos=wf_pack->not_pos; for (i=0 ; i < not_pos; i++) - if (wild_compare(name,wf_pack->wild[i]) == 0) + if (wild_compare(name,wf_pack->wild[i],0) == 0) goto found; if (i) DBUG_RETURN(1); /* No-match */ @@@@ -115,7 +115,7 @@@@ /* Test that it isn't in not-list */ for (i=not_pos ; i < wf_pack->wilds; i++) - if (wild_compare(name,wf_pack->wild[i]) == 0) + if (wild_compare(name,wf_pack->wild[i],0) == 0) DBUG_RETURN(1); DBUG_RETURN(0); } /* wf_test */ --- sql/sql_acl.cc.orig 2004-05-14 02:53:35 +0200 +++ sql/sql_acl.cc 2004-10-29 15:13:16 +0200 @@@@ -834,7 +834,7 @@@@ */ ulong acl_get(const char *host, const char *ip, const char *bin_ip, - const char *user, const char *db) + const char *user, const char *db, my_bool db_is_pattern) { ulong host_access,db_access; uint i,key_length; @@@@ -868,7 +868,7 @@@@ { if (compare_hostname(&acl_db->host,host,ip)) { - if (!acl_db->db || !wild_compare(db,acl_db->db)) + if (!acl_db->db || !wild_compare(db,acl_db->db,db_is_pattern)) { db_access=acl_db->access; if (acl_db->host.hostname) @@@@ -890,7 +890,7 @@@@ ACL_HOST *acl_host=dynamic_element(&acl_hosts,i,ACL_HOST*); if (compare_hostname(&acl_host->host,host,ip)) { - if (!acl_host->db || !wild_compare(db,acl_host->db)) + if (!acl_host->db || !wild_compare(db,acl_host->db,0)) { host_access=acl_host->access; // Fully specified. Take it break; @@@@ -1222,7 +1222,7 @@@@ } return (!host->hostname || (hostname && !wild_case_compare(hostname,host->hostname)) || - (ip && !wild_compare(ip,host->hostname))); + (ip && !wild_compare(ip,host->hostname,0))); } @@@@ -1300,7 +1300,7 @@@@ tl.db= (char*) "mysql"; tl.real_name= (char*) "user"; db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, tl.db); + thd->priv_user, tl.db, 0); if (!(db_access & INSERT_ACL)) { if (check_grant(thd,INSERT_ACL,&tl,0,1)) --- sql/sql_acl.h.orig 2004-05-14 02:53:22 +0200 +++ sql/sql_acl.h 2004-10-29 15:14:11 +0200 @@@@ -85,7 +85,7 @@@@ void acl_reload(THD *thd); void acl_free(bool end=0); ulong acl_get(const char *host, const char *ip, const char *bin_ip, - const char *user, const char *db); + const char *user, const char *db, my_bool db_is_pattern); ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user, const char *password,const char *scramble, char **priv_user, char *priv_host, --- sql/sql_base.cc.orig 2004-10-29 15:15:17 +0200 +++ sql/sql_base.cc 2004-05-14 02:53:18 +0200 @@@@ -149,7 +149,7 @@@@ if (wild) { strxmov(name,entry->table_cache_key,".",entry->real_name,NullS); - if (wild_compare(name,wild)) + if (wild_compare(name,wild,0)) continue; } --- sql/sql_db.cc.orig 2004-05-14 02:53:31 +0200 +++ sql/sql_db.cc 2004-10-29 15:16:02 +0200 @@@@ -408,7 +408,7 @@@@ db_access=DB_ACLS; else db_access= (acl_get(thd->host,thd->ip,(char*) &thd->remote.sin_addr, - thd->priv_user,dbname) | + thd->priv_user,dbname,0) | thd->master_access); if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname))) { --- sql/sql_parse.cc.orig 2004-05-14 02:53:18 +0200 +++ sql/sql_parse.cc 2004-10-29 15:17:01 +0200 @@@@ -2670,7 +2670,7 @@@@ if (!(thd->master_access & SELECT_ACL) && (db && (!thd->db || strcmp(db,thd->db)))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db); /* purecov: inspected */ + thd->priv_user, db, 0); /* purecov: inspected */ *save_priv=thd->master_access | db_access; DBUG_RETURN(FALSE); } @@@@ -2690,7 +2690,7 @@@@ if (db && (!thd->db || strcmp(db,thd->db))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db); /* purecov: inspected */ + thd->priv_user, db, 0); /* purecov: inspected */ else db_access=thd->db_access; // Remove SHOW attribute and access rights we already have --- sql/sql_show.cc.orig 2004-05-14 02:53:23 +0200 +++ sql/sql_show.cc 2004-10-29 15:18:34 +0200 @@@@ -78,7 +78,7 @@@@ { if (thd->master_access & (DB_ACLS | SHOW_DB_ACL) || acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, file_name) || + thd->priv_user, file_name, 0) || (grant_option && !check_grant_db(thd, file_name))) { thd->packet.length(0); @@@@ -214,7 +214,7 @@@@ #endif { if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat->st_mode) || - (wild && wild_compare(file->name,wild))) + (wild && wild_compare(file->name,wild, 0))) continue; } } @@@@ -232,7 +232,7 @@@@ if (wild_case_compare(file->name,wild)) continue; } - else if (wild_compare(file->name,wild)) + else if (wild_compare(file->name,wild, 0)) continue; } } @ 1.6 log @apply security bugfixes (OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388) @ text @a65 30 ============================================================================= Fix two security bugs OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388 Index: scripts/mysqlbug.sh --- scripts/mysqlbug.sh.orig 2004-02-10 19:15:54.000000000 +0100 +++ scripts/mysqlbug.sh 2004-04-14 21:12:44.000000000 +0200 @@@@ -254,7 +254,7 @@@@ if cmp -s $TEMP $TEMP.x then echo "File not changed, no bug report submitted." - cp $TEMP /tmp/failed-mysql-bugreport + mv -f $TEMP /tmp/failed-mysql-bugreport echo "The raw bug report exists in /tmp/failed-mysql-bugreport" echo "If you use this remember that the first lines of the report now is a lie.." exit 1 Index: scripts/mysqld_multi.sh --- scripts/mysqld_multi.sh.orig 2004-02-10 19:16:06.000000000 +0100 +++ scripts/mysqld_multi.sh 2004-04-14 22:08:34.000000000 +0200 @@@@ -9,7 +9,7 @@@@ $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = "/tmp/mysqld_multi.log"; +$opt_log = "$ENV{HOME}/mysqld_multi.log"; $opt_mysqladmin = "@@bindir@@/mysqladmin"; $opt_mysqld = "@@libexecdir@@/mysqld"; $opt_no_log = 0; @ 1.5 log @Following our general rules for dealing with versioned packages (and the fact that we only want _one_ single version in each release, of course), the old (MySQL-3 based) "mysql" package was first merged up to 1-STABLE (for possible inclusion into OpenPKG 1.3), then "mysql" was renamed to "mysql3" (in case you still have to drive MySQL 3 within OpenPKG-CURRENT), "mysql4" become "mysql" and "mysql4" has gone. @ text @d66 30 @ 1.5.2.1 log @apply security bugfixes (OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388) @ text @a65 30 ============================================================================= Fix two security bugs OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388 Index: scripts/mysqlbug.sh --- scripts/mysqlbug.sh.orig 2004-02-10 19:15:54.000000000 +0100 +++ scripts/mysqlbug.sh 2004-04-14 21:12:44.000000000 +0200 @@@@ -254,7 +254,7 @@@@ if cmp -s $TEMP $TEMP.x then echo "File not changed, no bug report submitted." - cp $TEMP /tmp/failed-mysql-bugreport + mv -f $TEMP /tmp/failed-mysql-bugreport echo "The raw bug report exists in /tmp/failed-mysql-bugreport" echo "If you use this remember that the first lines of the report now is a lie.." exit 1 Index: scripts/mysqld_multi.sh --- scripts/mysqld_multi.sh.orig 2004-02-10 19:16:06.000000000 +0100 +++ scripts/mysqld_multi.sh 2004-04-14 22:08:34.000000000 +0200 @@@@ -9,7 +9,7 @@@@ $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = "/tmp/mysqld_multi.log"; +$opt_log = "$ENV{HOME}/mysqld_multi.log"; $opt_mysqladmin = "@@bindir@@/mysqladmin"; $opt_mysqld = "@@libexecdir@@/mysqld"; $opt_no_log = 0; @ 1.4 log @align mysql.patch with vendor source @ text @d1 3 a3 40 --- sql/mini_client.cc.dist Tue Mar 18 12:10:58 2003 +++ sql/mini_client.cc Tue Mar 18 12:11:17 2003 @@@@ -318,7 +318,7 @@@@ */ s_err=0; - if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0) + if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*) &s_err, (socklen_t *)&s_err_size) != 0) return(-1); if (s_err) --- sql/mysqld.cc.dist Tue Mar 18 12:10:58 2003 +++ sql/mysqld.cc Tue Mar 18 12:11:18 2003 @@@@ -2476,7 +2476,7 @@@@ { size_socket length=sizeof(struct sockaddr_in); new_sock = accept(sock, my_reinterpret_cast(struct sockaddr *) (&cAddr), - &length); + (socklen_t *)&length); if (new_sock != INVALID_SOCKET || (socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN)) break; @@@@ -2542,7 +2542,7 @@@@ size_socket dummyLen; struct sockaddr dummy; dummyLen = sizeof(struct sockaddr); - if (getsockname(new_sock,&dummy, &dummyLen) < 0) + if (getsockname(new_sock,&dummy, (socklen_t *)&dummyLen) < 0) { sql_perror("Error on new connection socket"); (void) shutdown(new_sock,2); --- scripts/mysql_install_db.sh.dist Tue Mar 18 12:10:58 2003 +++ scripts/mysql_install_db.sh Tue Mar 18 12:11:18 2003 @@@@ -133,14 +133,13 @@@@ fi fi -# Create database directories mysql & test +# Create database directories mysql if test "$IN_RPM" -eq 0 d14 1 a14 1 @@@@ -176,8 +175,6 @@@@ d18 2 a19 2 - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y');" d23 2 a24 2 @@@@ -232,10 +229,8 @@@@ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); d26 6 a31 6 REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');" - INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N'); - INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N');" d35 1 a35 1 @@@@ -333,10 +328,8 @@@@ d39 4 a42 1 - echo "cd @@prefix@@ ; $bindir/safe_mysqld &" a44 3 - echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" - echo "cd sql-bench ; run-all-tests" echo d47 10 a56 2 --- mysys/default.c.dist Tue Mar 18 12:10:58 2003 +++ mysys/default.c Tue Mar 18 12:11:18 2003 d58 2 a59 2 #ifdef __WIN__ "C:/", @ 1.3 log @cleanup package and make sure it binds to 127.0.0.1 by default @ text @d1 2 a2 2 --- sql/mini_client.cc Mon Aug 19 15:47:00 2002 +++ sql/mini_client.cc Mon Aug 19 15:48:44 2002 d12 3 a14 3 --- sql/mysqld.cc Mon Aug 19 15:47:01 2002 +++ sql/mysqld.cc Mon Aug 19 15:49:01 2002 @@@@ -2407,7 +2407,7 @@@@ d23 1 a23 1 @@@@ -2473,7 +2473,7 @@@@ d32 2 a33 2 --- scripts/mysql_install_db.sh Mon Dec 2 17:40:15 2002 +++ scripts/mysql_install_db.sh Mon Dec 2 17:41:41 2002 d84 3 a86 3 --- mysys/default.c.dist Fri Jan 10 11:42:15 2003 +++ mysys/default.c Fri Jan 10 11:42:31 2003 @@@@ -48,7 +48,7 @@@@ @ 1.3.2.1 log @SA-2003.022 @ text @d1 2 a2 2 --- sql/mini_client.cc.dist Thu Jan 16 13:37:46 2003 +++ sql/mini_client.cc Thu Jan 16 13:38:03 2003 d12 3 a14 3 --- sql/mysqld.cc.dist Thu Jan 16 13:35:14 2003 +++ sql/mysqld.cc Tue Mar 18 10:18:18 2003 @@@@ -2475,7 +2475,7 @@@@ d23 1 a23 1 @@@@ -2541,7 +2541,7 @@@@ d32 2 a33 54 @@@@ -3633,7 +3633,10 @@@@ use_temp_pool=1; break; case 'u': - mysqld_user=optarg; + if (!mysqld_user) + mysqld_user=optarg; + else + fprintf(stderr, "Warning: Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", optarg, mysqld_user); break; case 'v': case 'V': --- sql/ha_myisam.cc.dist Tue Mar 18 09:52:28 2003 +++ sql/ha_myisam.cc Tue Mar 18 09:54:38 2003 @@@@ -427,7 +427,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -443,7 +443,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .MYD file: errno = %d"; error= HA_ADMIN_FAILED; --- sql/ha_gemini.cc.dist Tue Mar 18 10:15:05 2003 +++ sql/ha_gemini.cc Tue Mar 18 10:14:47 2003 @@@@ -2985,7 +2985,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -3006,7 +3006,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", ha_gemini_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .GMD file: errno = %d"; error= HA_ADMIN_FAILED; --- scripts/mysql_install_db.sh.dist Thu Jan 16 13:38:44 2003 +++ scripts/mysql_install_db.sh Thu Jan 16 13:38:52 2003 d84 2 a85 2 --- mysys/default.c.dist Thu Jan 16 13:39:26 2003 +++ mysys/default.c Thu Jan 16 13:39:37 2003 a94 61 --- mysys/my_copy.c.dist Tue Mar 18 10:17:00 2003 +++ mysys/my_copy.c Tue Mar 18 10:17:20 2003 @@@@ -32,17 +32,29 @@@@ #endif - /* - Ordinary ownership and accesstimes are copied from 'from-file' - if MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then - the modes of to-file isn't changed - Dont set MY_FNABP or MY_NABP bits on when calling this function ! - */ +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ int my_copy(const char *from, const char *to, myf MyFlags) { uint Count; - int new_file_stat; + int new_file_stat, create_flag; File from_file,to_file; char buff[IO_SIZE]; struct stat stat_buff,new_stat_buff; @@@@ -63,8 +75,10 @@@@ } if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + if ((to_file= my_create(to,(int) stat_buff.st_mode, - O_WRONLY | O_TRUNC | O_BINARY | O_SHARE, + O_WRONLY | create_flag | O_BINARY | O_SHARE, MyFlags)) < 0) goto err; --- include/my_sys.h.dist Tue Mar 18 10:16:16 2003 +++ include/my_sys.h Tue Mar 18 10:16:32 2003 @@@@ -73,6 +73,7 @@@@ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ +#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @ 1.3.2.2 log @added missing fix from mysql 3.23.56 @ text @d137 2 a138 10 +++ mysys/default.c Wed Mar 19 01:25:09 2003 @@@@ -39,6 +39,7 @@@@ #include "mysys_priv.h" #include "m_string.h" #include "m_ctype.h" +#include char *defaults_extra_file=0; @@@@ -48,7 +49,7 @@@@ a146 21 @@@@ -241,6 +242,20 @@@@ { strmov(name,config_file); } + fn_format(name,name,"","",4); +#if !defined(__WIN__) && !defined(OS2) + { + MY_STAT stat_info; + if (!my_stat(name,&stat_info,MYF(0))) + return 0; + if (stat_info.st_mode & S_IWOTH) /* ignore world-writeable files */ + { + fprintf(stderr, "warning: World-writeable config file %s is ignored\n", + name); + return 0; + } + } +#endif if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0)))) return 0; /* Ignore wrong files */ @ 1.3.2.3 log @merge last MySQL 3 state up to 1-STABLE branch for possible inclusion into OpenPKG 1.3 @ text @d1 2 a2 2 --- sql/mini_client.cc.dist Tue Mar 18 12:10:58 2003 +++ sql/mini_client.cc Tue Mar 18 12:11:17 2003 d12 3 a14 3 --- sql/mysqld.cc.dist Tue Mar 18 12:10:58 2003 +++ sql/mysqld.cc Tue Mar 18 12:11:18 2003 @@@@ -2476,7 +2476,7 @@@@ d23 1 a23 1 @@@@ -2542,7 +2542,7 @@@@ d32 54 a85 2 --- scripts/mysql_install_db.sh.dist Tue Mar 18 12:10:58 2003 +++ scripts/mysql_install_db.sh Tue Mar 18 12:11:18 2003 d136 11 a146 3 --- mysys/default.c.dist Tue Mar 18 12:10:58 2003 +++ mysys/default.c Tue Mar 18 12:11:18 2003 @@@@ -49,7 +49,7 @@@@ d155 82 @ 1.3.2.4 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class BASE only] @ text @d1 40 a40 3 --- scripts/mysql_install_db.sh.dist Wed Jan 29 12:29:21 2003 +++ scripts/mysql_install_db.sh Wed Feb 5 09:56:12 2003 @@@@ -138,9 +138,8 @@@@ d51 1 a51 1 @@@@ -178,8 +177,6 @@@@ d55 2 a56 2 - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" d60 2 a61 2 @@@@ -250,10 +247,7 @@@@ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); d63 6 a68 6 REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" d72 1 a72 1 @@@@ -351,10 +345,7 @@@@ d76 3 a78 2 - echo "cd @@prefix@@ ; $bindir/mysqld_safe &" - echo d80 1 a80 2 - echo "cd sql-bench ; perl run-all-tests" + echo "@@l_prefix@@/etc/rc mysql start" d84 2 a85 10 --- scripts/msql2mysql.sh.dist Tue Feb 11 09:50:29 2003 +++ scripts/msql2mysql.sh Tue Feb 11 09:53:08 2003 @@@@ -13,4 +13,4 @@@@ # described in the License. Among other things, the License requires that # the copyright notice and this notice be preserved on all copies. -@@bindir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +@@libexecdir@@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* --- mysys/default.c.dist Wed Jan 29 12:29:20 2003 +++ mysys/default.c Wed Feb 5 09:58:40 2003 d87 2 a88 2 #elif defined(__NETWARE__) "sys:/etc/", @ 1.3.2.4.2.1 log @SA-2003.038-mysql; CAN-2003-0780 @ text @a65 18 http://marc.theaimsgroup.com/?l=bugtraq&m=106323221912927&w=4 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0780 Buffer overflow in get_salt_from_password from sql_acl.cc for MySQL 4.0.14 and earlier, and 3.23.x, allows attackers to execute arbitrary code via a long Password field --- sql/sql_acl.cc.orig Fri Jul 18 16:57:47 2003 +++ sql/sql_acl.cc Mon Sep 15 11:58:13 2003 @@@@ -233,7 +233,7 @@@@ "Found old style password for user '%s'. Ignoring user. (You may want to restart mysqld using --old-protocol)", user.user ? user.user : ""); /* purecov: tested */ } - else if (length % 8) // This holds true for passwords + else if (length % 8 || length > 16) // This holds true for passwords { sql_print_error( "Found invalid password for user: '%s@@%s'; Ignoring user", @ 1.3.2.4.2.2 log @apply security bugfixes (OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388) @ text @a83 30 ============================================================================= Fix two security bugs OpenPKG-2004.014-mysql, CAN-2004-0381, CAN-2004-0388 Index: scripts/mysqlbug.sh --- scripts/mysqlbug.sh.orig 2004-02-10 19:15:54.000000000 +0100 +++ scripts/mysqlbug.sh 2004-04-14 21:12:44.000000000 +0200 @@@@ -254,7 +254,7 @@@@ if cmp -s $TEMP $TEMP.x then echo "File not changed, no bug report submitted." - cp $TEMP /tmp/failed-mysql-bugreport + mv -f $TEMP /tmp/failed-mysql-bugreport echo "The raw bug report exists in /tmp/failed-mysql-bugreport" echo "If you use this remember that the first lines of the report now is a lie.." exit 1 Index: scripts/mysqld_multi.sh --- scripts/mysqld_multi.sh.orig 2004-02-10 19:16:06.000000000 +0100 +++ scripts/mysqld_multi.sh 2004-04-14 22:08:34.000000000 +0200 @@@@ -9,7 +9,7 @@@@ $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = "/tmp/mysqld_multi.log"; +$opt_log = "$ENV{HOME}/mysqld_multi.log"; $opt_mysqladmin = "@@bindir@@/mysqladmin"; $opt_mysqld = "@@libexecdir@@/mysqld"; $opt_no_log = 0; @ 1.3.4.1 log @OpenPKG-SA-2003.008 @ text @a94 18 --- sql/sql_parse.cc Thu Dec 5 10:37:04 2002 +++ sql/sql_parse.cc Wed Jan 29 12:24:05 2003 @@@@ -794,6 +794,7 @@@@ char *save_user= thd->user; char *save_priv_user= thd->priv_user; char *save_db= thd->db; + thd->user=0; if ((uint) ((uchar*) db - net->read_pos) > packet_length) { // Check if protocol is ok @@@@ -803,7 +804,6 @@@@ if (check_user(thd, COM_CHANGE_USER, user, passwd, db, 0)) { // Restore old user x_free(thd->user); - x_free(thd->db); thd->master_access=save_master_access; thd->db_access=save_db_access; thd->db=save_db; @ 1.3.4.2 log @SA-2003.023 backported security fix from 3.23.56 @ text @d1 2 a2 20 --- sql/sql_parse.cc.dist Tue Mar 18 12:05:56 2003 +++ sql/sql_parse.cc Tue Mar 18 12:05:57 2003 @@@@ -794,6 +794,7 @@@@ char *save_user= thd->user; char *save_priv_user= thd->priv_user; char *save_db= thd->db; + thd->user=0; if ((uint) ((uchar*) db - net->read_pos) > packet_length) { // Check if protocol is ok @@@@ -803,7 +804,6 @@@@ if (check_user(thd, COM_CHANGE_USER, user, passwd, db, 0)) { // Restore old user x_free(thd->user); - x_free(thd->db); thd->master_access=save_master_access; thd->db_access=save_db_access; thd->db=save_db; --- sql/mini_client.cc.dist Thu Jan 16 13:37:46 2003 +++ sql/mini_client.cc Thu Jan 16 13:38:03 2003 d12 3 a14 3 --- sql/mysqld.cc.dist Thu Jan 16 13:35:14 2003 +++ sql/mysqld.cc Tue Mar 18 10:18:18 2003 @@@@ -2475,7 +2475,7 @@@@ d23 1 a23 1 @@@@ -2541,7 +2541,7 @@@@ d32 2 a33 54 @@@@ -3633,7 +3633,10 @@@@ use_temp_pool=1; break; case 'u': - mysqld_user=optarg; + if (!mysqld_user) + mysqld_user=optarg; + else + fprintf(stderr, "Warning: Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", optarg, mysqld_user); break; case 'v': case 'V': --- sql/ha_myisam.cc.dist Tue Mar 18 09:52:28 2003 +++ sql/ha_myisam.cc Tue Mar 18 09:54:38 2003 @@@@ -427,7 +427,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -443,7 +443,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .MYD file: errno = %d"; error= HA_ADMIN_FAILED; --- sql/ha_gemini.cc.dist Tue Mar 18 10:15:05 2003 +++ sql/ha_gemini.cc Tue Mar 18 10:14:47 2003 @@@@ -2985,7 +2985,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -3006,7 +3006,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", ha_gemini_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .GMD file: errno = %d"; error= HA_ADMIN_FAILED; --- scripts/mysql_install_db.sh.dist Thu Jan 16 13:38:44 2003 +++ scripts/mysql_install_db.sh Thu Jan 16 13:38:52 2003 d84 2 a85 2 --- mysys/default.c.dist Thu Jan 16 13:39:26 2003 +++ mysys/default.c Thu Jan 16 13:39:37 2003 d95 7 a101 4 --- mysys/my_copy.c.dist Tue Mar 18 10:17:00 2003 +++ mysys/my_copy.c Tue Mar 18 10:17:20 2003 @@@@ -32,17 +32,29 @@@@ #endif d103 10 a112 56 - /* - Ordinary ownership and accesstimes are copied from 'from-file' - if MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then - the modes of to-file isn't changed - Dont set MY_FNABP or MY_NABP bits on when calling this function ! - */ +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ int my_copy(const char *from, const char *to, myf MyFlags) { uint Count; - int new_file_stat; + int new_file_stat, create_flag; File from_file,to_file; char buff[IO_SIZE]; struct stat stat_buff,new_stat_buff; @@@@ -63,8 +75,10 @@@@ } if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + if ((to_file= my_create(to,(int) stat_buff.st_mode, - O_WRONLY | O_TRUNC | O_BINARY | O_SHARE, + O_WRONLY | create_flag | O_BINARY | O_SHARE, MyFlags)) < 0) goto err; --- include/my_sys.h.dist Tue Mar 18 10:16:16 2003 +++ include/my_sys.h Tue Mar 18 10:16:32 2003 @@@@ -73,6 +73,7 @@@@ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ +#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @ 1.3.4.3 log @add missing patch from 3.23.56 @ text @d155 2 a156 10 +++ mysys/default.c Wed Mar 19 01:25:09 2003 @@@@ -39,6 +39,7 @@@@ #include "mysys_priv.h" #include "m_string.h" #include "m_ctype.h" +#include char *defaults_extra_file=0; @@@@ -48,7 +49,7 @@@@ a164 21 @@@@ -241,6 +242,20 @@@@ { strmov(name,config_file); } + fn_format(name,name,"","",4); +#if !defined(__WIN__) && !defined(OS2) + { + MY_STAT stat_info; + if (!my_stat(name,&stat_info,MYF(0))) + return 0; + if (stat_info.st_mode & S_IWOTH) /* ignore world-writeable files */ + { + fprintf(stderr, "warning: World-writeable config file %s is ignored\n", + name); + return 0; + } + } +#endif if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0)))) return 0; /* Ignore wrong files */ @ 1.3.4.4 log @SA-2003.038-mysql; CAN-2003-0780 @ text @a254 18 http://marc.theaimsgroup.com/?l=bugtraq&m=106323221912927&w=4 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0780 Buffer overflow in get_salt_from_password from sql_acl.cc for MySQL 4.0.14 and earlier, and 3.23.x, allows attackers to execute arbitrary code via a long Password field --- sql/sql_acl.cc.orig 2002-12-05 10:37:06.000000000 +0100 +++ sql/sql_acl.cc 2003-09-15 13:01:19.000000000 +0200 @@@@ -206,7 +206,7 @@@@ "Found old style password for user '%s'. Ignoring user. (You may want to restart using --old-protocol)", user.user ? user.user : ""); /* purecov: tested */ } - else if (length % 8) // This holds true for passwords + else if (length % 8 || length > 16) // This holds true for passwords { sql_print_error( "Found invalid password for user: '%s@@%s'; Ignoring user", @ 1.2 log @switch to %option(s) @ text @d84 11 @ 1.1 log @Cast variables to repair Solaris building. @ text @d1 2 a2 3 diff -Naur mysql-3.23.52.orig/sql/mini_client.cc mysql-3.23.52/sql/mini_client.cc --- mysql-3.23.52.orig/sql/mini_client.cc Mon Aug 19 15:47:00 2002 +++ mysql-3.23.52/sql/mini_client.cc Mon Aug 19 15:48:44 2002 d12 2 a13 3 diff -Naur mysql-3.23.52.orig/sql/mysqld.cc mysql-3.23.52/sql/mysqld.cc --- mysql-3.23.52.orig/sql/mysqld.cc Mon Aug 19 15:47:01 2002 +++ mysql-3.23.52/sql/mysqld.cc Mon Aug 19 15:49:01 2002 d32 52 @ 1.1.2.1 log @SA-2003.022 backport from mysql-3.23.56, align standard configuration, old config didn't work anyway @ text @d1 3 a3 2 --- sql/mini_client.cc.dist Tue Mar 18 10:34:52 2003 +++ sql/mini_client.cc Tue Mar 18 10:35:17 2003 d13 3 a15 2 --- sql/mysqld.cc.dist Tue Mar 18 10:34:58 2003 +++ sql/mysqld.cc Tue Mar 18 10:35:17 2003 a33 112 --- sql/ha_myisam.cc.dist Tue Mar 18 10:42:47 2003 +++ sql/ha_myisam.cc Tue Mar 18 12:28:07 2003 @@@@ -427,7 +427,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -443,7 +443,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .MYD file: errno = %d"; error= HA_ADMIN_FAILED; --- sql/ha_gemini.cc.dist Tue Mar 18 10:42:52 2003 +++ sql/ha_gemini.cc Tue Mar 18 12:28:25 2003 @@@@ -2985,7 +2985,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES ))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; errmsg = "Failed copying .frm file: errno = %d"; @@@@ -3006,7 +3006,7 @@@@ if (my_copy(fn_format(src_path, table->path,"", ha_gemini_ext, 4), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) ) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)) ) { errmsg = "Failed copying .GMD file: errno = %d"; error= HA_ADMIN_FAILED; --- mysys/default.c.dist Tue Mar 18 10:44:27 2003 +++ mysys/default.c Tue Mar 18 12:30:06 2003 @@@@ -48,7 +48,7 @@@@ #ifdef __WIN__ "C:/", #else -"/etc/", +"@@l_prefix@@/etc/mysql/", #endif #ifdef DATADIR DATADIR, --- mysys/my_copy.c.dist Tue Mar 18 10:44:36 2003 +++ mysys/my_copy.c Tue Mar 18 12:25:16 2003 @@@@ -32,17 +32,29 @@@@ #endif - /* - Ordinary ownership and accesstimes are copied from 'from-file' - if MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then - the modes of to-file isn't changed - Dont set MY_FNABP or MY_NABP bits on when calling this function ! - */ +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ int my_copy(const char *from, const char *to, myf MyFlags) { uint Count; - int new_file_stat; + int new_file_stat, create_flag; File from_file,to_file; char buff[IO_SIZE]; struct stat stat_buff,new_stat_buff; @@@@ -63,8 +75,10 @@@@ } if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + if ((to_file= my_create(to,(int) stat_buff.st_mode, - O_WRONLY | O_TRUNC | O_BINARY | O_SHARE, + O_WRONLY | create_flag | O_BINARY | O_SHARE, MyFlags)) < 0) goto err; --- include/my_sys.h.dist Tue Mar 18 10:44:55 2003 +++ include/my_sys.h Tue Mar 18 12:25:50 2003 @@@@ -73,6 +73,7 @@@@ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ +#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @ 1.1.2.2 log @add missing fix from 3.23.56 @ text @d73 2 a74 10 +++ mysys/default.c Wed Mar 19 01:26:07 2003 @@@@ -39,6 +39,7 @@@@ #include "mysys_priv.h" #include "m_string.h" #include "m_ctype.h" +#include char *defaults_extra_file=0; @@@@ -48,7 +49,7 @@@@ a82 21 @@@@ -241,6 +242,20 @@@@ { strmov(name,config_file); } + fn_format(name,name,"","",4); +#if !defined(__WIN__) && !defined(OS2) + { + MY_STAT stat_info; + if (!my_stat(name,&stat_info,MYF(0))) + return 0; + if (stat_info.st_mode & S_IWOTH) /* ignore world-writeable files */ + { + fprintf(stderr, "warning: World-writeable config file %s is ignored\n", + name); + return 0; + } + } +#endif if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0)))) return 0; /* Ignore wrong files */ @