about summary refs log tree commit homepage
path: root/lib/unicorn/socket_helper.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-14 15:28:37 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-14 15:38:18 -0800
commit07767ea2733ed5276ec638fa50102dccb0b2991e (patch)
tree9b2d07e3f12965db301cb3a6cee8f9f313784c31 /lib/unicorn/socket_helper.rb
parentb88fe4513e310f5f38076cb137f6327d684a1d55 (diff)
downloadunicorn-07767ea2733ed5276ec638fa50102dccb0b2991e.tar.gz
Typically UNIX domain sockets are created with more liberal
file permissions than the rest of the application.  By default,
we create UNIX domain sockets to be readable and writable by
all local users to give them the same accessibility as
locally-bound TCP listeners.

This only has an effect on UNIX domain sockets.

This was inspired by Suraj Kurapati in
cfbcd2f00911121536rd0582b8u961f7f2a8c6e546a@mail.gmail.com
Diffstat (limited to 'lib/unicorn/socket_helper.rb')
-rw-r--r--lib/unicorn/socket_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb
index f792562..1c56be2 100644
--- a/lib/unicorn/socket_helper.rb
+++ b/lib/unicorn/socket_helper.rb
@@ -88,7 +88,7 @@ module Unicorn
                   "socket=#{address} specified but it is not a socket!"
           end
         end
-        old_umask = File.umask(0)
+        old_umask = File.umask(opt[:umask] || 0)
         begin
           UNIXServer.new(address)
         ensure