From 2ed0d26b79279fc1cc44ab87e38aea84f38f044d Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Wed, 30 Jan 2013 19:19:42 -0500 Subject: [PATCH] Don't try and delete the same user from mysql twice For security reasons we remove the anonymous user from mysql "@localhost", we also remove "@hostname", this commit checks that the hostname is not localhost so that we don't try and remove the same user twice https://bugzilla.redhat.com/show_bug.cgi?id=905737 Change-Id: I68caf688e30e30e09f4d546176e93391c0eb7010 --- packstack/puppet/templates/mysql.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packstack/puppet/templates/mysql.pp b/packstack/puppet/templates/mysql.pp index 8309ba4b9..20520cbad 100644 --- a/packstack/puppet/templates/mysql.pp +++ b/packstack/puppet/templates/mysql.pp @@ -10,12 +10,12 @@ class {"mysql::server": database_user { [ 'root@127.0.0.1', 'root@::1', '@localhost', '@%%' ]: ensure => 'absent', require => Class['mysql::config'], } -if ($::fqdn != "") { +if ($::fqdn != "" and $::fqdn != "localhost") { database_user { [ "root@${::fqdn}", "@${::fqdn}"]: ensure => 'absent', require => Class['mysql::config'], } } -if ($::fqdn != $::hostname) { +if ($::fqdn != $::hostname and $::hostname != "localhost") { database_user { ["root@${::hostname}", "@${::hostname}"]: ensure => 'absent', require => Class['mysql::config'], }