From fbf042877dd1690b0202d38cba29c6e7f9f0a0d6 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Mon, 5 Jun 2006 08:54:06 +0000 Subject: Late night hackery. Moving code for checking users and groups to common place, letting people who set allow_concurrency shoot themselves in the foot. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@225 19e92222-5c0b-0410-8929-a290d50e31e9 --- bin/mongrel_rails | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'bin') diff --git a/bin/mongrel_rails b/bin/mongrel_rails index 4886e6e..38ec96c 100644 --- a/bin/mongrel_rails +++ b/bin/mongrel_rails @@ -56,31 +56,14 @@ class Start < GemPlugin::Plugin "/commands" valid_dir? File.dirname(@generate), "Problem accessing directory to #@generate" if @generate valid_user? @user if @user valid_group? @group if @group - - return @valid - end - - def valid_user?(user) - valid?(Process.uid == 0, "You must be root to change the user.") - valid?(@group, "You must also specify a group.") - begin - Etc.getpwnam(user) - rescue - failure "User does not exist: #{user}" - @valid = false + + if ActionController::Base.allow_concurrency + STDERR.puts "[RAILS] allow_concurrency is true. Wow, you're very brave." end + + return @valid end - def valid_group?(group) - valid?(Process.uid == 0, "You must be root to change the group.") - valid?(@user, "You must also specify a user.") - begin - Etc.getgrnam(group) - rescue - failure "Group does not exist: #{group}" - @valid = false - end - end def run -- cgit v1.2.3-24-ge0c7