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 + + * lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension. + Fri Apr 25 14:55:59 2014 Nobuyoshi Nakada * 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)