aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick
diff options
context:
space:
mode:
Diffstat (limited to 'lib/webrick')
-rw-r--r--lib/webrick/utils.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index 185b1723f3..b4a5546b11 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -10,11 +10,7 @@
require 'socket'
require 'fcntl'
-begin
- require 'etc'
-rescue LoadError
- nil
-end
+require 'etc'
module WEBrick
module Utils
@@ -41,7 +37,7 @@ module WEBrick
##
# Changes the process's uid and gid to the ones of +user+
def su(user)
- if defined?(Etc) && (pw = Etc.getpwnam(user))
+ if pw = Etc.getpwnam(user)
Process::initgroups(user, pw.gid)
Process::Sys::setgid(pw.gid)
Process::Sys::setuid(pw.uid)