~ubuntu-branches/ubuntu/wily/mysql-5.6/wily

« back to all changes in this revision

Viewing changes to packaging/deb-trusty/mysql-community-server.postinst

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-04-16 20:07:10 UTC
  • mfrom: (1.2.5)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20150416200710-pfv24hkypwgmv7h6
* SECURITY UPDATE: Update to 5.5.41 to fix security issues (LP: #1444616)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2015-2365600.html
  - CVE-2015-0498
  - CVE-2015-0499
  - CVE-2015-0500
  - CVE-2015-0501
  - CVE-2015-0503
  - CVE-2015-0505
  - CVE-2015-0506
  - CVE-2015-0507
  - CVE-2015-0508
  - CVE-2015-0511
  - CVE-2015-2567
  - CVE-2015-2571
* debian/rules: fix ftbfs by building the sql directory first so the
  required files are generated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
3
 
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
 
3
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
4
4
#
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
37
37
                then
38
38
                        mkdir ${MYSQLDATA}/mysql
39
39
                        chown mysql:mysql ${MYSQLDATA}/mysql
40
 
                        chmod 700 ${MYSQLDATA}/mysql
 
40
                        chmod 750 ${MYSQLDATA}/mysql
41
41
                        if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
42
42
                        then
43
43
                                mysql_install_db --user=mysql > /dev/null
44
 
                                if [ -f "/usr/my.cnf" ];
45
 
                                then
46
 
                                        rm -f /usr/my.cnf
47
 
                                fi
48
44
                        fi
49
45
                fi
50
46
 
51
 
                db_get mysql-community-server/remove-test-db && RMTESTDB=${RET}
52
 
                if [ -z "${RMTESTDB}" ] || [ "${RMTESTDB}" = "false" ];
53
 
                then
54
 
                        RMTESTDB="DROP DATABASE IF EXISTS test;"
55
 
                else
56
 
                        RMTESTDB=""
57
 
                fi
58
 
 
59
47
                db_get mysql-community-server/root-pass && PASSWD=${RET}
60
48
                if [ ! -z "${PASSWD}" ];
61
49
                then
62
50
                        db_set mysql-community-server/root-pass ""
63
51
                        db_set mysql-community-server/re-root-pass ""
64
 
                        SQL=`mktemp`
65
 
                        if [ -f "${SQL}" ];
66
 
                        then
67
 
                                chmod 700 ${SQL}
68
 
                                cat << EOF > ${SQL}
 
52
                        PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
 
53
                else
 
54
                        PASSWD=""
 
55
                fi
 
56
 
 
57
                SQL=`mktemp`
 
58
                if [ -f "${SQL}" ];
 
59
                then
 
60
                        chmod 700 ${SQL}
 
61
                        cat << EOF > ${SQL}
69
62
USE mysql;
70
 
UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root';
 
63
${PASSWD}
71
64
DELETE FROM user WHERE user='';
72
 
${RMTESTDB}
73
65
FLUSH PRIVILEGES;
74
66
EOF
75
 
                                mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
76
 
                                PASSWD=""
77
 
                                rm -f ${SQL}
78
 
                        fi
 
67
                        mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
 
68
                        PASSWD=""
 
69
                        rm -f ${SQL}
79
70
                fi
80
71
 
81
72
                set +e