Skip to content

Commit 11280be

Browse files
committed
Since /etc/mysql/my.cnf contains the [client] section, normal
users need to be able to read that file. We should set 0644 on /etc/mysql/my.cnf, but use 0400 on /etc/my.cnf and /root/.my.cnf because they contain passwords in plaintext.
1 parent 2f56156 commit 11280be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

manifests/config.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@
2525
}
2626
file{'/root/.my.cnf':
2727
content => template('mysql/my.cnf.pass.erb'),
28+
mode => '0400',
2829
}
2930
if $etc_root_password {
3031
file{'/etc/my.cnf':
3132
content => template('mysql/my.cnf.pass.erb'),
3233
require => Exec['set_mysql_rootpw'],
34+
mode => '0400',
3335
}
3436
}
3537
}
3638
File {
3739
owner => 'root',
3840
group => 'root',
39-
mode => '0400',
4041
notify => Exec['mysqld-restart'],
4142
require => Package['mysql-server']
4243
}

0 commit comments

Comments
 (0)