From 2c9f22c2d02363c5634243dae4804e5fe4962183 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 30 Jun 2008 01:30:32 +0000 Subject: * ext/syslog/syslog.c (syslog_write): syslog operations should be protected from $SAFE level 4. a patch from Keita Yamaguchi . * ext/syslog/syslog.c (mSyslog_close): ditto. * ext/syslog/syslog.c (mSyslog_set_mask): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/syslog/syslog.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c index 4ac645969..4503e3546 100644 --- a/ext/syslog/syslog.c +++ b/ext/syslog/syslog.c @@ -22,6 +22,7 @@ static void syslog_write(int pri, int argc, VALUE *argv) { VALUE str; + rb_secure(4); if (argc < 1) { rb_raise(rb_eArgError, "no log message supplied"); } @@ -38,6 +39,7 @@ static void syslog_write(int pri, int argc, VALUE *argv) /* Syslog module methods */ static VALUE mSyslog_close(VALUE self) { + rb_secure(4); if (!syslog_opened) { rb_raise(rb_eRuntimeError, "syslog not opened"); } @@ -132,6 +134,7 @@ static VALUE mSyslog_get_mask(VALUE self) static VALUE mSyslog_set_mask(VALUE self, VALUE mask) { + rb_secure(4); if (!syslog_opened) { rb_raise(rb_eRuntimeError, "must open syslog before setting log mask"); } -- cgit