Skip to content

Commit

Permalink
Fix unsafe interpolations
Browse files Browse the repository at this point in the history
We now have puppet-lint-check_unsafe_interpolations and it detect some
issues.  Fix them.
  • Loading branch information
smortex committed Aug 28, 2023
1 parent 61aa9b1 commit 4582c9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# preseeding files so we need to manualy bootstrap cn=config (but not the
# databases).
exec { 'bootstrap cn=config':
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",
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
provider => 'shell',
creates => "${openldap::server::confdir}/cn=config.ldif",
user => $openldap::server::owner,
Expand Down Expand Up @@ -146,7 +146,7 @@
$ldif = file('openldap/cn-config.ldif')
exec { 'bootstrap cn=config':
path => '/usr/local/sbin',
command => "echo '${ldif}' | slapadd -n 0 -F ${openldap::server::confdir}",
command => "echo ${ldif.shell_escape} | slapadd -n 0 -F ${openldap::server::confdir.shell_escape}", # lint:ignore:check_unsafe_interpolations
creates => "${openldap::server::confdir}/cn=config.ldif",
provider => 'shell',
user => $openldap::server::owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# installation will succed. The module will then be able to tune slapd
# accoding to the user needs and finally start (and unmak) the service.
exec { 'mask-before-openldap-install':
command => "systemctl mask ${openldap::server::service}",
command => "systemctl mask ${openldap::server::service.shell_escape}", # lint:ignore:check_unsafe_interpolations
unless => 'test -x /usr/sbin/slapd',
creates => "/etc/systemd/system/${openldap::server::service}.service",
path => '/bin:/usr/bin',
Expand Down

0 comments on commit 4582c9f

Please sign in to comment.