mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/webrick/utils.rb: Don't rescue LoadError for 'etc' extension.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ef9408d8dd
commit
2f60d08519
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue