summaryrefslogtreecommitdiff
path: root/ext/syslog
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-30 01:30:32 (GMT)
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-30 01:30:32 (GMT)
commit244e32db0dcb273a307e5de78fe9d7bdb70e7ef0 (patch)
treee4f2c141ab45ae5cf7d4f1cb0f0db503d3a475f9 /ext/syslog
parent7edda76f1597a92a3d07ab8b1f3ba7f1dee8798c (diff)
* ext/syslog/syslog.c (syslog_write): syslog operations should be
protected from $SAFE level 4. a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>. * ext/syslog/syslog.c (mSyslog_close): ditto. * ext/syslog/syslog.c (mSyslog_set_mask): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syslog')
-rw-r--r--ext/syslog/syslog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 4ac6459..4503e35 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");
}