diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicorn/configurator.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 2d92aa3..e809b22 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -372,6 +372,13 @@ module Unicorn def working_directory(path) # just let chdir raise errors path = File.expand_path(path) + if config_file && + config_file[0] != ?/ && + ! test(?r, "#{path}/#{config_file}") + raise ArgumentError, + "config_file=#{config_file} would not be accessible in" \ + " working_directory=#{path}" + end Dir.chdir(path) HttpServer::START_CTX[:cwd] = ENV["PWD"] = path end |