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 Apr 8, 2024
1 parent c630df5 commit 2f3c109
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 @@ -71,7 +71,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.stdlib::shell_escape} -b cn=config",
provider => 'shell',
creates => "${openldap::server::confdir}/cn=config.ldif",
user => $openldap::server::owner,
Expand Down Expand Up @@ -162,7 +162,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.stdlib::shell_escape} | slapadd -n 0 -F ${openldap::server::confdir.stdlib::shell_escape}",
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.stdlib::shell_escape}",
unless => 'test -x /usr/sbin/slapd',
creates => "/etc/systemd/system/${openldap::server::service}.service",
path => '/bin:/usr/bin',
Expand Down

0 comments on commit 2f3c109

Please sign in to comment.