* 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
@ -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>
|
Fri Apr 25 14:55:59 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (rb_cv_func___builtin_unreachable): try with an
|
* configure.in (rb_cv_func___builtin_unreachable): try with an
|
||||||
|
@ -10,11 +10,7 @@
|
|||||||
|
|
||||||
require 'socket'
|
require 'socket'
|
||||||
require 'fcntl'
|
require 'fcntl'
|
||||||
begin
|
require 'etc'
|
||||||
require 'etc'
|
|
||||||
rescue LoadError
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
module WEBrick
|
module WEBrick
|
||||||
module Utils
|
module Utils
|
||||||
@ -41,7 +37,7 @@ module WEBrick
|
|||||||
##
|
##
|
||||||
# Changes the process's uid and gid to the ones of +user+
|
# Changes the process's uid and gid to the ones of +user+
|
||||||
def su(user)
|
def su(user)
|
||||||
if defined?(Etc) && (pw = Etc.getpwnam(user))
|
if pw = Etc.getpwnam(user)
|
||||||
Process::initgroups(user, pw.gid)
|
Process::initgroups(user, pw.gid)
|
||||||
Process::Sys::setgid(pw.gid)
|
Process::Sys::setgid(pw.gid)
|
||||||
Process::Sys::setuid(pw.uid)
|
Process::Sys::setuid(pw.uid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user