summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 14:20:51 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 14:20:51 +0000
commit1f828497d1e8df2b7b68ac2a093ab4439585d88a (patch)
tree6cf1bd0f1cc7921226608ccc133930aae49e7c82 /ext
parentb53a183c009b3cb72b5964cf5652763b4cebf0f6 (diff)
* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/curses/curses.c3
-rw-r--r--ext/dbm/dbm.c1
-rw-r--r--ext/dl/cfunc.c3
-rw-r--r--ext/dl/cptr.c3
-rw-r--r--ext/dl/dl.c4
-rw-r--r--ext/etc/etc.c8
-rw-r--r--ext/fiddle/fiddle.c4
-rw-r--r--ext/fiddle/pointer.c3
-rw-r--r--ext/gdbm/gdbm.c1
-rw-r--r--ext/readline/readline.c46
-rw-r--r--ext/sdbm/init.c1
-rw-r--r--ext/socket/ancdata.c2
-rw-r--r--ext/socket/basicsocket.c3
-rw-r--r--ext/socket/socket.c1
-rw-r--r--ext/socket/udpsocket.c1
-rw-r--r--ext/stringio/stringio.c1
-rw-r--r--ext/syslog/syslog.c3
-rw-r--r--ext/tk/tcltklib.c16
-rw-r--r--ext/win32ole/win32ole.c8
19 files changed, 1 insertions, 111 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 113b2bf..49704cb 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -145,7 +145,6 @@ prep_window(VALUE class, WINDOW *window)
static VALUE
curses_init_screen(void)
{
- rb_secure(4);
if (rb_stdscr) return rb_stdscr;
initscr();
if (stdscr == 0) {
@@ -1491,7 +1490,6 @@ window_initialize(VALUE obj, VALUE h, VALUE w, VALUE top, VALUE left)
struct windata *winp;
WINDOW *window;
- rb_secure(4);
curses_init_screen();
TypedData_Get_Struct(obj, struct windata, &windata_type, winp);
if (winp->window) delwin(winp->window);
@@ -2511,7 +2509,6 @@ pad_initialize(VALUE obj, VALUE h, VALUE w)
struct windata *padp;
WINDOW *window;
- rb_secure(4);
curses_init_screen();
TypedData_Get_Struct(obj, struct windata, &windata_type, padp);
if (padp->window) delwin(padp->window);
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 27ade01..157cada 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -392,7 +392,6 @@ fdbm_values_at(int argc, VALUE *argv, VALUE obj)
static void
fdbm_modify(VALUE obj)
{
- rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
}
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
index b68129f..70be456 100644
--- a/ext/dl/cfunc.c
+++ b/ext/dl/cfunc.c
@@ -86,7 +86,6 @@ rb_dlcfunc_new(void (*func)(), int type, const char *name, ID calltype)
VALUE val;
struct cfunc_data *data;
- rb_secure(4);
if( func ){
val = TypedData_Make_Struct(rb_cDLCFunc, struct cfunc_data, &dlcfunc_data_type, data);
data->ptr = (void *)(VALUE)func;
@@ -346,8 +345,6 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
DLSTACK_TYPE stack[DLSTACK_SIZE];
VALUE result = Qnil;
- rb_secure_update(self);
-
memset(stack, 0, sizeof(DLSTACK_TYPE) * DLSTACK_SIZE);
Check_Type(ary, T_ARRAY);
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index 636099d..9e59139 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -69,7 +69,6 @@ rb_dlptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
struct ptr_data *data;
VALUE val;
- rb_secure(4);
val = TypedData_Make_Struct(klass, struct ptr_data, &dlptr_data_type, data);
data->ptr = ptr;
data->free = func;
@@ -90,7 +89,6 @@ rb_dlptr_malloc(long size, freefunc_t func)
{
void *ptr;
- rb_secure(4);
ptr = ruby_xmalloc((size_t)size);
memset(ptr,0,(size_t)size);
return rb_dlptr_new(ptr, size, func);
@@ -122,7 +120,6 @@ rb_dlptr_s_allocate(VALUE klass)
VALUE obj;
struct ptr_data *data;
- rb_secure(4);
obj = TypedData_Make_Struct(klass, struct ptr_data, &dlptr_data_type, data);
data->ptr = 0;
data->size = 0;
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 691eecd..23f5d7f 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -81,7 +81,6 @@ rb_dl_malloc(VALUE self, VALUE size)
{
void *ptr;
- rb_secure(4);
ptr = (void*)ruby_xmalloc(NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -98,7 +97,6 @@ rb_dl_realloc(VALUE self, VALUE addr, VALUE size)
{
void *ptr = NUM2PTR(addr);
- rb_secure(4);
ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -113,7 +111,6 @@ rb_dl_free(VALUE self, VALUE addr)
{
void *ptr = NUM2PTR(addr);
- rb_secure(4);
ruby_xfree(ptr);
return Qnil;
}
@@ -137,7 +134,6 @@ rb_dl_free(VALUE self, VALUE addr)
VALUE
rb_dl_ptr2value(VALUE self, VALUE addr)
{
- rb_secure(4);
return (VALUE)NUM2PTR(addr);
}
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index c1cfead..74a1fed 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -60,7 +60,6 @@ etc_getlogin(VALUE obj)
{
char *login;
- rb_secure(4);
#ifdef HAVE_GETLOGIN
login = getlogin();
if (!login) login = getenv("USER");
@@ -147,7 +146,6 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
rb_uid_t uid;
struct passwd *pwd;
- rb_secure(4);
if (rb_scan_args(argc, argv, "01", &id) == 1) {
uid = NUM2UIDT(id);
}
@@ -251,7 +249,6 @@ etc_passwd(VALUE obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- rb_secure(4);
if (rb_block_given_p()) {
each_passwd();
}
@@ -391,7 +388,6 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
gid_t gid;
struct group *grp;
- rb_secure(4);
if (rb_scan_args(argc, argv, "01", &id) == 1) {
gid = NUM2GIDT(id);
}
@@ -428,7 +424,6 @@ etc_getgrnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETGRENT
struct group *grp;
- rb_secure(4);
SafeStringValue(nam);
grp = getgrnam(RSTRING_PTR(nam));
if (grp == 0) rb_raise(rb_eArgError, "can't find group for %s", RSTRING_PTR(nam));
@@ -494,7 +489,6 @@ etc_group(VALUE obj)
#ifdef HAVE_GETGRENT
struct group *grp;
- rb_secure(4);
if (rb_block_given_p()) {
each_group();
}
@@ -624,7 +618,7 @@ etc_systmpdir(void)
#else
tmpdir = rb_filesystem_str_new_cstr("/tmp");
#endif
- FL_UNSET(tmpdir, FL_TAINT|FL_UNTRUSTED);
+ FL_UNSET(tmpdir, FL_TAINT);
return tmpdir;
}
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index 803a5a9..7a7c708 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -48,7 +48,6 @@ rb_fiddle_malloc(VALUE self, VALUE size)
{
void *ptr;
- rb_secure(4);
ptr = (void*)ruby_xmalloc(NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -65,7 +64,6 @@ rb_fiddle_realloc(VALUE self, VALUE addr, VALUE size)
{
void *ptr = NUM2PTR(addr);
- rb_secure(4);
ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
return PTR2NUM(ptr);
}
@@ -80,7 +78,6 @@ rb_fiddle_free(VALUE self, VALUE addr)
{
void *ptr = NUM2PTR(addr);
- rb_secure(4);
ruby_xfree(ptr);
return Qnil;
}
@@ -104,7 +101,6 @@ rb_fiddle_free(VALUE self, VALUE addr)
VALUE
rb_fiddle_ptr2value(VALUE self, VALUE addr)
{
- rb_secure(4);
return (VALUE)NUM2PTR(addr);
}
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index fb9b310..4f4842f 100644
--- a/ext/fiddle/pointer.c
+++ b/ext/fiddle/pointer.c
@@ -76,7 +76,6 @@ rb_fiddle_ptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
struct ptr_data *data;
VALUE val;
- rb_secure(4);
val = TypedData_Make_Struct(klass, struct ptr_data, &fiddle_ptr_data_type, data);
data->ptr = ptr;
data->free = func;
@@ -97,7 +96,6 @@ rb_fiddle_ptr_malloc(long size, freefunc_t func)
{
void *ptr;
- rb_secure(4);
ptr = ruby_xmalloc((size_t)size);
memset(ptr,0,(size_t)size);
return rb_fiddle_ptr_new(ptr, size, func);
@@ -129,7 +127,6 @@ rb_fiddle_ptr_s_allocate(VALUE klass)
VALUE obj;
struct ptr_data *data;
- rb_secure(4);
obj = TypedData_Make_Struct(klass, struct ptr_data, &fiddle_ptr_data_type, data);
data->ptr = 0;
data->size = 0;
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 45ed959..ff0a652 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -506,7 +506,6 @@ fgdbm_values_at(int argc, VALUE *argv, VALUE obj)
static void
rb_gdbm_modify(VALUE obj)
{
- rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
}
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 388f5e4..0af8722 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -382,7 +382,6 @@ readline_readline(int argc, VALUE *argv, VALUE self)
char *buff;
int status;
- rb_secure(4);
if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) {
OutputStringValue(tmp);
#if USE_INSERT_IGNORE_ESCAPE
@@ -454,7 +453,6 @@ readline_s_set_input(VALUE self, VALUE input)
{
rb_io_t *ifp;
- rb_secure(4);
Check_Type(input, T_FILE);
GetOpenFile(input, ifp);
rl_instream = rb_io_stdio_file(ifp);
@@ -478,7 +476,6 @@ readline_s_set_output(VALUE self, VALUE output)
{
rb_io_t *ofp;
- rb_secure(4);
Check_Type(output, T_FILE);
GetOpenFile(output, ofp);
rl_outstream = rb_io_stdio_file(ofp);
@@ -503,7 +500,6 @@ readline_s_set_output(VALUE self, VALUE output)
static VALUE
readline_s_set_pre_input_hook(VALUE self, VALUE proc)
{
- rb_secure(4);
if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, id_pre_input_hook, proc);
@@ -522,7 +518,6 @@ readline_s_set_pre_input_hook(VALUE self, VALUE proc)
static VALUE
readline_s_get_pre_input_hook(VALUE self)
{
- rb_secure(4);
return rb_attr_get(mReadline, id_pre_input_hook);
}
@@ -555,7 +550,6 @@ readline_pre_input_hook(void)
static VALUE
readline_s_insert_text(VALUE self, VALUE str)
{
- rb_secure(4);
OutputStringValue(str);
rl_insert_text(RSTRING_PTR(str));
return self;
@@ -579,7 +573,6 @@ readline_s_insert_text(VALUE self, VALUE str)
static VALUE
readline_s_redisplay(VALUE self)
{
- rb_secure(4);
rl_redisplay();
return self;
}
@@ -660,7 +653,6 @@ readline_s_redisplay(VALUE self)
static VALUE
readline_s_set_completion_proc(VALUE self, VALUE proc)
{
- rb_secure(4);
if (!NIL_P(proc) && !rb_respond_to(proc, rb_intern("call")))
rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_ivar_set(mReadline, completion_proc, proc);
@@ -677,7 +669,6 @@ readline_s_set_completion_proc(VALUE self, VALUE proc)
static VALUE
readline_s_get_completion_proc(VALUE self)
{
- rb_secure(4);
return rb_attr_get(mReadline, completion_proc);
}
@@ -692,7 +683,6 @@ readline_s_get_completion_proc(VALUE self)
static VALUE
readline_s_set_completion_case_fold(VALUE self, VALUE val)
{
- rb_secure(4);
return rb_ivar_set(mReadline, completion_case_fold, val);
}
@@ -715,7 +705,6 @@ readline_s_set_completion_case_fold(VALUE self, VALUE val)
static VALUE
readline_s_get_completion_case_fold(VALUE self)
{
- rb_secure(4);
return rb_attr_get(mReadline, completion_case_fold);
}
@@ -734,7 +723,6 @@ readline_s_get_completion_case_fold(VALUE self)
static VALUE
readline_s_get_line_buffer(VALUE self)
{
- rb_secure(4);
if (rl_line_buffer == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_line_buffer);
@@ -760,7 +748,6 @@ readline_s_get_line_buffer(VALUE self)
static VALUE
readline_s_get_point(VALUE self)
{
- rb_secure(4);
return INT2NUM(rl_point);
}
#else
@@ -857,7 +844,6 @@ readline_attempted_completion_function(const char *text, int start, int end)
static VALUE
readline_s_set_screen_size(VALUE self, VALUE rows, VALUE columns)
{
- rb_secure(4);
rl_set_screen_size(NUM2INT(rows), NUM2INT(columns));
return self;
}
@@ -884,7 +870,6 @@ readline_s_get_screen_size(VALUE self)
int rows, columns;
VALUE res;
- rb_secure(4);
rl_get_screen_size(&rows, &columns);
res = rb_ary_new();
rb_ary_push(res, INT2NUM(rows));
@@ -910,7 +895,6 @@ readline_s_get_screen_size(VALUE self)
static VALUE
readline_s_vi_editing_mode(VALUE self)
{
- rb_secure(4);
rl_vi_editing_mode(1,0);
return Qnil;
}
@@ -932,7 +916,6 @@ readline_s_vi_editing_mode(VALUE self)
static VALUE
readline_s_vi_editing_mode_p(VALUE self)
{
- rb_secure(4);
return rl_editing_mode == 0 ? Qtrue : Qfalse;
}
#else
@@ -954,7 +937,6 @@ readline_s_vi_editing_mode_p(VALUE self)
static VALUE
readline_s_emacs_editing_mode(VALUE self)
{
- rb_secure(4);
rl_emacs_editing_mode(1,0);
return Qnil;
}
@@ -976,7 +958,6 @@ readline_s_emacs_editing_mode(VALUE self)
static VALUE
readline_s_emacs_editing_mode_p(VALUE self)
{
- rb_secure(4);
return rl_editing_mode == 1 ? Qtrue : Qfalse;
}
#else
@@ -1025,7 +1006,6 @@ readline_s_emacs_editing_mode_p(VALUE self)
static VALUE
readline_s_set_completion_append_character(VALUE self, VALUE str)
{
- rb_secure(4);
if (NIL_P(str)) {
rl_completion_append_character = '\0';
}
@@ -1060,7 +1040,6 @@ readline_s_get_completion_append_character(VALUE self)
{
char buf[1];
- rb_secure(4);
if (rl_completion_append_character == '\0')
return Qnil;
@@ -1089,7 +1068,6 @@ readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
{
static char *basic_word_break_characters = NULL;
- rb_secure(4);
OutputStringValue(str);
if (basic_word_break_characters == NULL) {
basic_word_break_characters =
@@ -1123,7 +1101,6 @@ readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
static VALUE
readline_s_get_basic_word_break_characters(VALUE self, VALUE str)
{
- rb_secure(4);
if (rl_basic_word_break_characters == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_basic_word_break_characters);
@@ -1150,7 +1127,6 @@ readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
{
static char *completer_word_break_characters = NULL;
- rb_secure(4);
OutputStringValue(str);
if (completer_word_break_characters == NULL) {
completer_word_break_characters =
@@ -1184,7 +1160,6 @@ readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
static VALUE
readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
{
- rb_secure(4);
if (rl_completer_word_break_characters == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_completer_word_break_characters);
@@ -1213,7 +1188,6 @@ readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
static VALUE
readline_s_set_special_prefixes(VALUE self, VALUE str)
{
- rb_secure(4);
if (!NIL_P(str)) {
OutputStringValue(str);
str = rb_str_dup_frozen(str);
@@ -1247,7 +1221,6 @@ static VALUE
readline_s_get_special_prefixes(VALUE self)
{
VALUE str;
- rb_secure(4);
if (rl_special_prefixes == NULL) return Qnil;
str = rb_ivar_get(mReadline, id_special_prefixes);
if (!NIL_P(str)) {
@@ -1277,7 +1250,6 @@ readline_s_set_basic_quote_characters(VALUE self, VALUE str)
{
static char *basic_quote_characters = NULL;
- rb_secure(4);
OutputStringValue(str);
if (basic_quote_characters == NULL) {
basic_quote_characters =
@@ -1311,7 +1283,6 @@ readline_s_set_basic_quote_characters(VALUE self, VALUE str)
static VALUE
readline_s_get_basic_quote_characters(VALUE self, VALUE str)
{
- rb_secure(4);
if (rl_basic_quote_characters == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_basic_quote_characters);
@@ -1339,7 +1310,6 @@ readline_s_set_completer_quote_characters(VALUE self, VALUE str)
{
static char *completer_quote_characters = NULL;
- rb_secure(4);
OutputStringValue(str);
if (completer_quote_characters == NULL) {
completer_quote_characters =
@@ -1373,7 +1343,6 @@ readline_s_set_completer_quote_characters(VALUE self, VALUE str)
static VALUE
readline_s_get_completer_quote_characters(VALUE self, VALUE str)
{
- rb_secure(4);
if (rl_completer_quote_characters == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_completer_quote_characters);
@@ -1399,7 +1368,6 @@ readline_s_set_filename_quote_characters(VALUE self, VALUE str)
{
static char *filename_quote_characters = NULL;
- rb_secure(4);
OutputStringValue(str);
if (filename_quote_characters == NULL) {
filename_quote_characters =
@@ -1433,7 +1401,6 @@ readline_s_set_filename_quote_characters(VALUE self, VALUE str)
static VALUE
readline_s_get_filename_quote_characters(VALUE self, VALUE str)
{
- rb_secure(4);
if (rl_filename_quote_characters == NULL)
return Qnil;
return rb_locale_str_new_cstr(rl_filename_quote_characters);
@@ -1454,7 +1421,6 @@ readline_s_get_filename_quote_characters(VALUE self, VALUE str)
static VALUE
readline_s_refresh_line(VALUE self)
{
- rb_secure(4);
rl_refresh_line(0, 0);
return Qnil;
}
@@ -1486,7 +1452,6 @@ hist_get(VALUE self, VALUE index)
HIST_ENTRY *entry = NULL;
int i;
- rb_secure(4);
i = NUM2INT(index);
if (i < 0) {
i += history_length;
@@ -1507,7 +1472,6 @@ hist_set(VALUE self, VALUE index, VALUE str)
HIST_ENTRY *entry = NULL;
int i;
- rb_secure(4);
i = NUM2INT(index);
OutputStringValue(str);
if (i < 0) {
@@ -1528,7 +1492,6 @@ hist_set(VALUE self, VALUE index, VALUE str)
static VALUE
hist_push(VALUE self, VALUE str)
{
- rb_secure(4);
OutputStringValue(str);
add_history(RSTRING_PTR(str));
return self;
@@ -1539,7 +1502,6 @@ hist_push_method(int argc, VALUE *argv, VALUE self)
{
VALUE str;
- rb_secure(4);
while (argc--) {
str = *argv++;
OutputStringValue(str);
@@ -1555,7 +1517,6 @@ rb_remove_history(int index)
HIST_ENTRY *entry;
VALUE val;
- rb_secure(4);
entry = remove_history(index);
if (entry) {
val = rb_locale_str_new_cstr(entry->line);
@@ -1574,7 +1535,6 @@ rb_remove_history(int index)
static VALUE
hist_pop(VALUE self)
{
- rb_secure(4);
if (history_length > 0) {
return rb_remove_history(history_length - 1);
} else {
@@ -1585,7 +1545,6 @@ hist_pop(VALUE self)
static VALUE
hist_shift(VALUE self)
{
- rb_secure(4);
if (history_length > 0) {
return rb_remove_history(0);
} else {
@@ -1601,7 +1560,6 @@ hist_each(VALUE self)
RETURN_ENUMERATOR(self, 0, 0);
- rb_secure(4);
for (i = 0; i < history_length; i++) {
entry = history_get(history_get_offset_func(i));
if (entry == NULL)
@@ -1614,14 +1572,12 @@ hist_each(VALUE self)
static VALUE
hist_length(VALUE self)
{
- rb_secure(4);
return INT2NUM(history_length);
}
static VALUE
hist_empty_p(VALUE self)
{
- rb_secure(4);
return history_length == 0 ? Qtrue : Qfalse;
}
@@ -1630,7 +1586,6 @@ hist_delete_at(VALUE self, VALUE index)
{
int i;
- rb_secure(4);
i = NUM2INT(index);
if (i < 0)
i += history_length;
@@ -1644,7 +1599,6 @@ hist_delete_at(VALUE self, VALUE index)
static VALUE
hist_clear(VALUE self)
{
- rb_secure(4);
clear_history();
return self;
}
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 4eee215..78add53 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -396,7 +396,6 @@ fsdbm_values_at(int argc, VALUE *argv, VALUE obj)
static void
fdbm_modify(VALUE obj)
{
- rb_secure(4);
if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 7fe9659..144c2bf 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1140,7 +1140,6 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
int flags;
ssize_t ss;
- rb_secure(4);
GetOpenFile(sock, fptr);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
family = rsock_getfamily(fptr->fd);
@@ -1504,7 +1503,6 @@ bsock_recvmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
int gc_done = 0;
#endif
- rb_secure(4);
rb_scan_args(argc, argv, "03:", &vmaxdatlen, &vflags, &vmaxctllen, &vopts);
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index 19dc2f5..bce085b 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -547,7 +547,6 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
int n;
rb_blocking_function_t *func;
- rb_secure(4);
rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to);
StringValue(arg.mesg);
@@ -613,7 +612,6 @@ bsock_do_not_reverse_lookup_set(VALUE sock, VALUE state)
{
rb_io_t *fptr;
- rb_secure(4);
GetOpenFile(sock, fptr);
if (RTEST(state)) {
fptr->mode |= FMODE_NOREVLOOKUP;
@@ -733,7 +731,6 @@ bsock_do_not_rev_lookup(void)
static VALUE
bsock_do_not_rev_lookup_set(VALUE self, VALUE val)
{
- rb_secure(4);
rsock_do_not_reverse_lookup = RTEST(val);
return val;
}
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 8c5ffed..cbde0ed 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -629,7 +629,6 @@ rsock_sock_listen(VALUE sock, VALUE log)
rb_io_t *fptr;
int backlog;
- rb_secure(4);
backlog = NUM2INT(log);
GetOpenFile(sock, fptr);
if (listen(fptr->fd, backlog) < 0)
diff --git a/ext/socket/udpsocket.c b/ext/socket/udpsocket.c
index 4ea9db6..de334fc 100644
--- a/ext/socket/udpsocket.c
+++ b/ext/socket/udpsocket.c
@@ -166,7 +166,6 @@ udp_send(int argc, VALUE *argv, VALUE sock)
if (argc == 2 || argc == 3) {
return rsock_bsock_send(argc, argv, sock);
}
- rb_secure(4);
rb_scan_args(argc, argv, "4", &arg.mesg, &flags, &host, &port);
StringValue(arg.mesg);
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index bdc46af..d15db8b 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -136,7 +136,6 @@ writable(VALUE strio)
rb_raise(rb_eIOError, "not opened for writing");
}
if (!OBJ_TAINTED(ptr->string)) {
- rb_secure(4);
}
return ptr;
}
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 347fd4b..17c5ef8 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -37,7 +37,6 @@ 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");
}
@@ -56,7 +55,6 @@ static void syslog_write(int pri, int argc, VALUE *argv)
*/
static VALUE mSyslog_close(VALUE self)
{
- rb_secure(4);
if (!syslog_opened) {
rb_raise(rb_eRuntimeError, "syslog not opened");
}
@@ -263,7 +261,6 @@ 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");
}
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index a8cc122..d269f9c 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -1668,7 +1668,6 @@ set_eventloop_window_mode(self, mode)
VALUE self;
VALUE mode;
{
- rb_secure(4);
if (RTEST(mode)) {
window_event_mode = ~0;
@@ -1698,7 +1697,6 @@ set_eventloop_tick(self, tick)
int ttick = NUM2INT(tick);
int thr_crit_bup;
- rb_secure(4);
if (ttick < 0) {
rb_raise(rb_eArgError,
@@ -1765,7 +1763,6 @@ set_no_event_wait(self, wait)
{
int t_wait = NUM2INT(wait);
- rb_secure(4);
if (t_wait <= 0) {
rb_raise(rb_eArgError,
@@ -1819,7 +1816,6 @@ set_eventloop_weight(self, loop_max, no_event)
int lpmax = NUM2INT(loop_max);
int no_ev = NUM2INT(no_event);
- rb_secure(4);
if (lpmax <= 0 || no_ev <= 0) {
rb_raise(rb_eArgError, "weight parameters must be positive numbers");
@@ -1938,7 +1934,6 @@ static VALUE
lib_evloop_abort_on_exc_set(self, val)
VALUE self, val;
{
- rb_secure(4);
if (RTEST(val)) {
event_loop_abort_on_exc = 1;
} else if (NIL_P(val)) {
@@ -1955,7 +1950,6 @@ ip_evloop_abort_on_exc_set(self, val)
{
struct tcltkip *ptr = get_ip(self);
- rb_secure(4);
/* ip is deleted? */
if (deleted_ip(ptr)) {
@@ -6403,7 +6397,6 @@ ip_create_slave_core(interp, argc, argv)
safe = 1;
} else if (safemode == Qfalse || NIL_P(safemode)) {
safe = 0;
- /* rb_secure(4); */ /* already checked */
} else {
safe = 1;
}
@@ -6510,7 +6503,6 @@ ip_create_slave(argc, argv, self)
}
if (Tcl_IsSafe(master->ip) != 1
&& (safemode == Qfalse || NIL_P(safemode))) {
- rb_secure(4);
}
StringValue(name);
@@ -6717,7 +6709,6 @@ ip_allow_ruby_exit_set(self, val)
struct tcltkip *ptr = get_ip(self);
Tk_Window mainWin;
- rb_secure(4);
/* ip is deleted? */
if (deleted_ip(ptr)) {
@@ -7821,7 +7812,6 @@ lib_restart_core(interp, argc, argv)
struct tcltkip *ptr = get_ip(interp);
int thr_crit_bup;
- /* rb_secure(4); */ /* already checked */
/* tcl_stubs_check(); */ /* already checked */
@@ -7879,7 +7869,6 @@ lib_restart(self)
{
struct tcltkip *ptr = get_ip(self);
- rb_secure(4);
tcl_stubs_check();
@@ -7898,7 +7887,6 @@ ip_restart(self)
{
struct tcltkip *ptr = get_ip(self);
- rb_secure(4);
tcl_stubs_check();
@@ -9257,7 +9245,6 @@ ip_invoke_immediate(argc, argv, obj)
VALUE obj;
{
/* POTENTIALY INSECURE : can create infinite loop */
- rb_secure(4);
return ip_invoke_with_position(argc, argv, obj, TCL_QUEUE_HEAD);
}
@@ -10061,7 +10048,6 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
{
get_ip(interp);
- rb_secure(4);
StringValue(name);
@@ -10519,7 +10505,6 @@ create_encoding_table_core(arg, interp)
Tcl_Obj **objv;
Tcl_Obj *enc_list;
- rb_secure(4);
/* set 'binary' encoding */
rb_hash_aset(table, ENCODING_NAME_BINARY, ENCODING_NAME_BINARY);
@@ -10555,7 +10540,6 @@ create_encoding_table_core(arg, interp)
VALUE interp;
{
volatile VALUE table = rb_hash_new();
- rb_secure(4);
rb_ivar_set(interp, ID_encoding_table, table);
return table;
}
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 8c243f8..e353d78 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -2725,7 +2725,6 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
void *p;
IUnknown *pUnknown;
- rb_secure(4);
/* initialize to use OLE */
ole_initialize();
@@ -2809,7 +2808,6 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
VALUE file;
LCID lcid = cWIN32OLE_lcid;
- rb_secure(4);
rb_scan_args(argc, argv, "11", &ole, &klass);
if (TYPE(klass) != T_CLASS &&
TYPE(klass) != T_MODULE &&
@@ -2872,7 +2870,6 @@ ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes)
ITypeInfo *pTypeInfo;
VALUE type;
- rb_secure(4);
count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
for (i = 0; i < count; i++) {
hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i,
@@ -3236,7 +3233,6 @@ fole_initialize(int argc, VALUE *argv, VALUE self)
OLECHAR *pBuf;
IDispatch *pDispatch;
void *p;
- rb_secure(4);
rb_call_super(0, 0);
rb_scan_args(argc, argv, "11*", &svr_name, &host, &others);
@@ -3964,7 +3960,6 @@ static VALUE
fole_free(VALUE self)
{
struct oledata *pole;
- rb_secure(4);
OLEData_Get_Struct(self, pole);
OLE_FREE(pole->pDispatch);
pole->pDispatch = NULL;
@@ -4527,7 +4522,6 @@ fole_respond_to(VALUE self, VALUE method)
BSTR wcmdname;
DISPID DispID;
HRESULT hr;
- rb_secure(4);
if(TYPE(method) != T_STRING && TYPE(method) != T_SYMBOL) {
rb_raise(rb_eTypeError, "wrong argument type (expected String or Symbol)");
}
@@ -8299,7 +8293,6 @@ ev_advise(int argc, VALUE *argv, VALUE self)
struct oleeventdata *poleev;
void *p;
- rb_secure(4);
rb_scan_args(argc, argv, "11", &ole, &itf);
if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
@@ -8507,7 +8500,6 @@ fev_off_event(int argc, VALUE *argv, VALUE self)
VALUE event = Qnil;
VALUE events;
- rb_secure(4);
rb_scan_args(argc, argv, "01", &event);
if(!NIL_P(event)) {
if(TYPE(event) != T_STRING && TYPE(event) != T_SYMBOL) {