OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Michael van Elst
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 18-Mar-2003 16:33:59
Branch: OPENPKG_1_1_SOLID Handle: 2003031815335800
Modified files: (Branch: OPENPKG_1_1_SOLID)
openpkg-src/mysql my.cnf mysql.patch mysql.spec rc.mysql
Log:
SA-2003.022 backport from mysql-3.23.56, align standard configuration,
old config didn't work anyway
Summary:
Revision Changes Path
1.2.2.1 +2 -2 openpkg-src/mysql/my.cnf
1.1.2.1 +116 -6 openpkg-src/mysql/mysql.patch
1.33.2.4 +15 -4 openpkg-src/mysql/mysql.spec
1.3.2.1 +3 -3 openpkg-src/mysql/rc.mysql
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/mysql/my.cnf
============================================================================
$ cvs diff -u -r1.2 -r1.2.2.1 my.cnf
--- openpkg-src/mysql/my.cnf 7 Feb 2002 14:21:02 -0000 1.2
+++ openpkg-src/mysql/my.cnf 18 Mar 2003 15:33:58 -0000 1.2.2.1
@@ -1,10 +1,10 @@
-[mysqld]
+[safe_mysqld]
datadir = @l_prefix@/var/mysql/db
socket = @l_prefix@/var/mysql/mysqld.sock
set-variable = [EMAIL PROTECTED]@/var/mysql/mysqld.pid
set-variable = max_connections=1000
port = 3306
-user = @l_musr@
+user = @l_rusr@
basedir = @l_prefix@
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/mysql/mysql.patch
============================================================================
$ cvs diff -u -r1.1 -r1.1.2.1 mysql.patch
--- openpkg-src/mysql/mysql.patch 19 Aug 2002 15:06:16 -0000 1.1
+++ openpkg-src/mysql/mysql.patch 18 Mar 2003 15:33:58 -0000 1.1.2.1
@@ -1,6 +1,5 @@
-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
+--- sql/mini_client.cc.dist Tue Mar 18 10:34:52 2003
++++ sql/mini_client.cc Tue Mar 18 10:35:17 2003
@@ -318,7 +318,7 @@
*/
@@ -10,9 +9,8 @@
return(-1);
if (s_err)
-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
+--- sql/mysqld.cc.dist Tue Mar 18 10:34:58 2003
++++ sql/mysqld.cc Tue Mar 18 10:35:17 2003
@@ -2407,7 +2407,7 @@
{
size_socket length=sizeof(struct sockaddr_in);
@@ -31,3 +29,115 @@
{
sql_perror("Error on new connection socket");
(void) shutdown(new_sock,2);
+--- 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*/
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/mysql/mysql.spec
============================================================================
$ cvs diff -u -r1.33.2.3 -r1.33.2.4 mysql.spec
--- openpkg-src/mysql/mysql.spec 29 Jan 2003 11:38:51 -0000 1.33.2.3
+++ openpkg-src/mysql/mysql.spec 18 Mar 2003 15:33:58 -0000 1.33.2.4
@@ -46,7 +46,7 @@
Group: Database
License: GPL
Version: 3.23.52
-Release: 1.1.2
+Release: 1.1.3
# list of sources
Source0:
http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-3.23/mysql-%{version}.tar.gz
@@ -78,10 +78,15 @@
%prep
%setup -q
- %patch0 -p1
+ %patch0 -p0
%patch1 -p1
%build
+ # patch file search path
+ %{l_shtool} subst \
+ -e 's;@l_prefix@;%{l_prefix};g' \
+ mysys/default.c
+
# determine additional configure options
case "%{l_target}" in
*-freebsd* ) opt="--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static" ;;
@@ -142,13 +147,14 @@
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
%{l_shtool} install -c -m 644 \
-e 's;@l_prefix@;%{l_prefix};g' \
- -e 's;@l_musr@;%{l_musr};g' \
+ -e 's;@l_rusr@;%{l_rusr};g' \
%{SOURCE my.cnf} \
$RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
# install run-command script
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
+ -e 's;@l_rusr@;%{l_rusr};g' \
%{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# make sure the database directory exists
@@ -166,5 +172,10 @@
%post
$RPM_INSTALL_PREFIX/bin/mysql_install_db
- chown -R %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/var/mysql/
+ chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/mysql/my.cnf
+ chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/
+ ( echo "The MySQL package runs the database service under a restricted"
+ echo "user id. If you configure a private data directory then you must"
+ echo "assure that the files are accessible by the user '%{l_rusr}'."
+ ) | %{l_rpmtool} msg -b -t notice
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/mysql/rc.mysql
============================================================================
$ cvs diff -u -r1.3 -r1.3.2.1 rc.mysql
--- openpkg-src/mysql/rc.mysql 19 Apr 2002 09:11:52 -0000 1.3
+++ openpkg-src/mysql/rc.mysql 18 Mar 2003 15:33:58 -0000 1.3.2.1
@@ -6,18 +6,18 @@
%config
mysql_enable="yes"
-%start -p 200 -u root
+%start -p 200 -u @l_rusr@
opServiceEnabled mysql || exit 0
@l_prefix@/bin/safe_mysqld >/dev/null 2>&1 &
-%stop -p 200 -u root
+%stop -p 200 -u @l_rusr@
opServiceEnabled mysql || exit 0
# standard (but would require admin password!)
[EMAIL PROTECTED]@/bin/mysqladmin shutdown
# alternative (does not require admin password)
kill -TERM `cat @l_prefix@/var/mysql/\`hostname\`.pid`
-%restart -u root
+%restart -u @l_rusr@
opServiceEnabled mysql || exit 0
kill -TERM `cat @l_prefix@/var/mysql/\`hostname\`.pid`
sleep 2
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]