aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/webrick/utils.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bde5494cd..6ef301de82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Apr 25 19:16:30 2014 Tanaka Akira <akr@fsij.org>
+
+ * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.
+
Fri Apr 25 14:55:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (rb_cv_func___builtin_unreachable): try with an
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)