summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-22 08:59:13 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-23 17:09:32 +0000
commit1c1639f08e1ead98a39de35459c448d232ba1c05 (patch)
treee86406392090c596e47eac3bda68b7433c56f85e
parentd9092312a66776a4480c11f63f6559c5c934d428 (diff)
downloadpykolab-1c1639f08e1ead98a39de35459c448d232ba1c05.tar.gz
Remove /tmp/kolab-setup-my.cnf after setup, and chmod it 0600 before writing out anything relevant.
-rw-r--r--pykolab/setup/components.py3
-rw-r--r--pykolab/setup/setup_mysql.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/pykolab/setup/components.py b/pykolab/setup/components.py
index f12fe84..d280372 100644
--- a/pykolab/setup/components.py
+++ b/pykolab/setup/components.py
@@ -201,6 +201,9 @@ def execute(component_name, *args, **kw):
components[component_name]['function'](conf.cli_args, kw)
+ if os.path.exists('/tmp/kolab-setup-my.cnf'):
+ os.unlink('/tmp/kolab-setup-my.cnf')
+
def register_group(dirname, module):
components_base_path = os.path.join(os.path.dirname(__file__), module)
diff --git a/pykolab/setup/setup_mysql.py b/pykolab/setup/setup_mysql.py
index c956eeb..0536304 100644
--- a/pykolab/setup/setup_mysql.py
+++ b/pykolab/setup/setup_mysql.py
@@ -56,8 +56,8 @@ def execute(*args, **kw):
subprocess.call(['/usr/sbin/update-rc.d', 'mysql', 'defaults'])
else:
log.error(_("Could not configure to start on boot, the " + \
- "MySQL database service."))
-
+ "MySQL database service."))
+
print >> sys.stderr, utils.multiline_message(
_("""
Please supply a root password for MySQL. This password will
@@ -93,6 +93,7 @@ password='%s'
""" % (mysql_root_password)
fp = open('/tmp/kolab-setup-my.cnf', 'w')
+ os.chmod('/tmp/kolab-setup-my.cnf', 0600)
fp.write(data)
fp.close()