From 8bce84fe5dbb07260f33235f7ebb393ff140df72 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Dec 2011 10:02:02 +0000 Subject: [PATCH] * process.c (proc_seteuid_m): fix argument. * test/ruby/test_process.rb (test_geteuid): fix typo. * test/ruby/test_process.rb (test_getegid, test_set[eg]uid): add. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ process.c | 2 +- test/ruby/test_process.rb | 12 ++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cb7a92e160..005b8aed26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Dec 5 19:01:59 2011 Nobuyoshi Nakada + + * process.c (proc_seteuid_m): fix argument. + + * test/ruby/test_process.rb (test_geteuid): fix typo. + + * test/ruby/test_process.rb (test_getegid, test_set[eg]uid): add. + Mon Dec 5 18:56:55 2011 Nobuyoshi Nakada * bignum.c (big_rshift), compile.c (validate_label, diff --git a/process.c b/process.c index 3109b9f94b..05ee2b2dfe 100644 --- a/process.c +++ b/process.c @@ -5097,7 +5097,7 @@ proc_seteuid(rb_uid_t uid) */ static VALUE -proc_seteuid_m(VALUE euid) +proc_seteuid_m(VALUE mod, VALUE euid) { check_uid_switch(); proc_seteuid(NUM2UIDT(euid)); diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 84e5f13bb1..29f7ec8f1d 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1162,9 +1162,21 @@ class TestProcess < Test::Unit::TestCase end def test_geteuid + assert_kind_of(Integer, Process.euid) + end + + def test_seteuid + assert_nothing_raised(TypeError) {Process.euid += 0} + end + + def test_getegid assert_kind_of(Integer, Process.egid) end + def test_setegid + assert_nothing_raised(TypeError) {Process.egid += 0} + end + def test_uid_re_exchangeable_p r = Process::UID.re_exchangeable? assert(true == r || false == r)