I suspect that while the inline read was shorter, it was leaking fds
[mirror/dsa-puppet.git] / templates / motd.erb
index 1881c41..a0a7a72 100644 (file)
@@ -3,6 +3,8 @@ is monitored and will be used as evidence for prosecutions.
 
 <% if File.exists?("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail") -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-<%= File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail").read -%>
+<% f = File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail") -%>
+<%= f.read -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+<% f.close -%>
 <% end -%>