From 5c692b20a2ade6b69da487ecf802249de548f7fa Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Thu, 23 Apr 2009 00:52:36 +0100 Subject: [PATCH] I suspect that while the inline read was shorter, it was leaking fds Signed-off-by: Stephen Gran --- templates/motd.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/motd.erb b/templates/motd.erb index 1881c41b3..a0a7a7255 100644 --- a/templates/motd.erb +++ b/templates/motd.erb @@ -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 -%> -- 2.20.1