Skip to content

Commit 4582c9f

Browse files
committed
Fix unsafe interpolations
We now have puppet-lint-check_unsafe_interpolations and it detect some issues. Fix them.
1 parent 61aa9b1 commit 4582c9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

manifests/server/config.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# preseeding files so we need to manualy bootstrap cn=config (but not the
5656
# databases).
5757
exec { 'bootstrap cn=config':
58-
command => "/bin/sed -e 's/@BACKEND@/mdb/g' -e '/^# The database definition.$/q' /usr/share/slapd/slapd.init.ldif | /usr/sbin/slapadd -F ${openldap::server::confdir} -b cn=config",
58+
command => "/bin/sed -e 's/@BACKEND@/mdb/g' -e '/^# The database definition.$/q' /usr/share/slapd/slapd.init.ldif | /usr/sbin/slapadd -F ${openldap::server::confdir.shell_escape} -b cn=config", # lint:ignore:check_unsafe_interpolations
5959
provider => 'shell',
6060
creates => "${openldap::server::confdir}/cn=config.ldif",
6161
user => $openldap::server::owner,
@@ -146,7 +146,7 @@
146146
$ldif = file('openldap/cn-config.ldif')
147147
exec { 'bootstrap cn=config':
148148
path => '/usr/local/sbin',
149-
command => "echo '${ldif}' | slapadd -n 0 -F ${openldap::server::confdir}",
149+
command => "echo ${ldif.shell_escape} | slapadd -n 0 -F ${openldap::server::confdir.shell_escape}", # lint:ignore:check_unsafe_interpolations
150150
creates => "${openldap::server::confdir}/cn=config.ldif",
151151
provider => 'shell',
152152
user => $openldap::server::owner,

manifests/server/install.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# installation will succed. The module will then be able to tune slapd
1212
# accoding to the user needs and finally start (and unmak) the service.
1313
exec { 'mask-before-openldap-install':
14-
command => "systemctl mask ${openldap::server::service}",
14+
command => "systemctl mask ${openldap::server::service.shell_escape}", # lint:ignore:check_unsafe_interpolations
1515
unless => 'test -x /usr/sbin/slapd',
1616
creates => "/etc/systemd/system/${openldap::server::service}.service",
1717
path => '/bin:/usr/bin',

0 commit comments

Comments
 (0)