1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* process.c (proc_getrlimit, proc_setrlimit): add rb_secure(2) to

methods of Process.{getrlimit,setrlimit}
  patched by Kazuhiro NISHIYAMA  <zn@mbf.nifty.com>


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2004-11-17 10:12:19 +00:00
parent 3691ea5cf4
commit 6c8ffdbf32
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Wed Nov 17 18:59:16 2004 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* process.c (proc_getrlimit, proc_setrlimit): add rb_secure(2) to
methods of Process.{getrlimit,setrlimit}
Wed Nov 17 13:05:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> Wed Nov 17 13:05:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (rb_push_glob): fix overrun. [ruby-dev:24886] * dir.c (rb_push_glob): fix overrun. [ruby-dev:24886]

View file

@ -1971,6 +1971,8 @@ proc_getrlimit(VALUE obj, VALUE resource)
#ifdef HAVE_GETRLIMIT #ifdef HAVE_GETRLIMIT
struct rlimit rlim; struct rlimit rlim;
rb_secure(2);
if (getrlimit(NUM2INT(resource), &rlim) < 0) { if (getrlimit(NUM2INT(resource), &rlim) < 0) {
rb_sys_fail("getrlimit"); rb_sys_fail("getrlimit");
} }
@ -2016,6 +2018,8 @@ proc_setrlimit(VALUE obj, VALUE resource, VALUE rlim_cur, VALUE rlim_max)
#ifdef HAVE_SETRLIMIT #ifdef HAVE_SETRLIMIT
struct rlimit rlim; struct rlimit rlim;
rb_secure(2);
rlim.rlim_cur = NUM2RLIM(rlim_cur); rlim.rlim_cur = NUM2RLIM(rlim_cur);
rlim.rlim_max = NUM2RLIM(rlim_max); rlim.rlim_max = NUM2RLIM(rlim_max);