~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to debian/mariadb-server-5.5.py

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2014-04-17 20:55:22 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140417205522-wof4l36nxhlkn89m
* New upstream release, fixing the following security issues:
  * Corresponding MariaDB CVEs for Oracle SPU April 2014 (Closes: #745330)
    - CVE-2014-0384 
    - CVE-2014-2419 
    - CVE-2014-2430 
    - CVE-2014-2431 
    - CVE-2014-2432 
    - CVE-2014-2436 
    - CVE-2014-2438 
    - CVE-2014-2440
* Re-enabled TokuDB with "if arch amd64" in d/rules
* Applied patch to log init output better
  (Closes https://mariadb.atlassian.net/browse/MDEV-5957)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''apport package hook for mariadb-5.5
 
2
 
 
3
(c) 2009 Canonical Ltd.
 
4
Author: Mathias Gug <mathias.gug@canonical.com>
 
5
'''
 
6
 
 
7
import os, os.path
 
8
 
 
9
from apport.hookutils import *
 
10
 
 
11
def _add_my_conf_files(report, filename):
 
12
    key = 'MySQLConf' + path_to_key(filename)
 
13
    report[key] = ""
 
14
    for line in read_file(filename).split('\n'):
 
15
        try:
 
16
            if 'password' in line.split('=')[0]:
 
17
                line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0])
 
18
            report[key] += line + '\n'
 
19
        except IndexError:
 
20
            continue
 
21
 
 
22
def add_info(report):
 
23
    attach_conffiles(report, 'mariadb-server-5.5', conffiles=None)
 
24
    key = 'Logs' + path_to_key('/var/log/daemon.log')
 
25
    report[key] = ""
 
26
    for line in read_file('/var/log/daemon.log').split('\n'):
 
27
        try:
 
28
            if 'mysqld' in line.split()[4]:
 
29
                report[key] += line + '\n'
 
30
        except IndexError:
 
31
            continue
 
32
    key = 'Logs' + path_to_key('/var/log/kern.log')
 
33
    report[key] = ""
 
34
    for line in read_file('/var/log/kern.log').split('\n'):
 
35
        try:
 
36
            if '/usr/sbin/mysqld' in string.join(line.split()[4:]):
 
37
                report[key] += line + '\n'
 
38
        except IndexError:
 
39
            continue
 
40
    _add_my_conf_files(report, '/etc/mysql/my.cnf')
 
41
    for f in os.listdir('/etc/mysql/conf.d'):
 
42
        _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f))
 
43
    try:
 
44
        report['MySQLVarLibDirListing'] = unicode(os.listdir('/var/lib/mysql'))
 
45
    except OSError:
 
46
        report['MySQLVarLibDirListing'] = unicode(False)
 
47
 
 
48
if __name__ == '__main__':
 
49
    report = {}
 
50
    add_info(report)
 
51
    for key in report:
 
52
        print '%s: %s' % (key, report[key].split('\n', 1)[0])