[PATCH] chowning /dev/null should be guarded against

Joel Meador joel at expectedbehavior.com
Tue Oct 2 00:59:08 UTC 2012


We've run into this problem several times and it's not really expected 
that someone is going to monkey with /dev/null. So here's a simple patch.
I am not on the mailing list, so please Cc: me.

---
  lib/unicorn/util.rb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/unicorn/util.rb b/lib/unicorn/util.rb
index cde2563..6b6cca2 100644
--- a/lib/unicorn/util.rb
+++ b/lib/unicorn/util.rb
@@ -15,7  +15,7  @@ module Unicorn::Util

    def self.chown_logs(uid, gid)
      ObjectSpace.each_object(File) do |fp|
-      fp.chown(uid, gid) if is_log?(fp)
+      fp.chown(uid, gid) if is_log?(fp)&&  fp.path != "/dev/null"
      end
    end
  # :startdoc:
-- 1.7.12.1



More information about the mongrel-unicorn mailing list