summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 14:21:03 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 14:21:03 +0000
commit5d6ca9e95058bac96140ef9394291fed08a76070 (patch)
tree42e366f472182de0a998c1d9e42b2bfd9f60d02b
parente8ce2a92d319c20bbb9241e9a9a6c821e3599d79 (diff)
* include/ruby/ruby.h: $SAFE=2 is now obsolete.
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c gc.c, io.c, process.c, safe.c, signal.c, win32/file.c: removed code for $SAFE=2 * test/erb/test_erb.rb, test/fiddle/test_handle.rb test/ruby/test_env.rb: removed tests for $SAFE=2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--dir.c2
-rw-r--r--ext/fiddle/handle.c3
-rw-r--r--ext/socket/basicsocket.c1
-rw-r--r--file.c33
-rw-r--r--gc.c1
-rw-r--r--include/ruby/ruby.h8
-rw-r--r--io.c5
-rw-r--r--process.c25
-rw-r--r--safe.c10
-rw-r--r--signal.c2
-rw-r--r--test/erb/test_erb.rb1
-rw-r--r--test/fiddle/test_handle.rb37
-rw-r--r--test/ruby/test_env.rb81
-rw-r--r--win32/file.c1
15 files changed, 20 insertions, 201 deletions
diff --git a/ChangeLog b/ChangeLog
index 160eb39b15..ac4143c563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Jun 18 23:20:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * include/ruby/ruby.h: $SAFE=2 is now obsolete.
+
+ * dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c
+ gc.c, io.c, process.c, safe.c, signal.c, win32/file.c:
+ removed code for $SAFE=2
+
+ * test/erb/test_erb.rb, test/fiddle/test_handle.rb
+ test/ruby/test_env.rb: removed tests for $SAFE=2.
+
Thu Jun 18 22:50:07 2015 Yusuke Endoh <mame@ruby-lang.org>
* enc/make_encmake.rb: added --transes and --no-transes options.
diff --git a/dir.c b/dir.c
index 8aadef4bf9..311a5e0336 100644
--- a/dir.c
+++ b/dir.c
@@ -941,7 +941,6 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path = Qnil;
- rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
FilePathValue(path);
path = rb_str_encode_ospath(path);
@@ -1013,7 +1012,6 @@ check_dirname(volatile VALUE *dir)
long len;
rb_encoding *enc;
- rb_secure(2);
FilePathValue(d);
enc = rb_enc_get(d);
RSTRING_GETMEM(d, path, len);
diff --git a/ext/fiddle/handle.c b/ext/fiddle/handle.c
index 4cfeedaedd..2f93f2346b 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -154,8 +154,6 @@ rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
rb_bug("rb_fiddle_handle_new");
}
- rb_secure(2);
-
#if defined(_WIN32)
if( !clib ){
HANDLE rb_libruby_handle(void);
@@ -320,7 +318,6 @@ fiddle_handle_sym(void *handle, const char *name)
#endif
void (*func)();
- rb_secure(2);
#ifdef HAVE_DLERROR
dlerror();
#endif
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index fbe5167c15..6bc1828d61 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -213,7 +213,6 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
rb_scan_args(argc, argv, "30", &lev, &optname, &val);
}
- rb_secure(2);
GetOpenFile(sock, fptr);
family = rsock_getfamily(fptr->fd);
level = rsock_level_arg(family, lev);
diff --git a/file.c b/file.c
index 026ed031a1..96b89e55c1 100644
--- a/file.c
+++ b/file.c
@@ -1014,7 +1014,6 @@ rb_stat(VALUE file, struct stat *st)
{
VALUE tmp;
- rb_secure(2);
tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
rb_io_t *fptr;
@@ -1159,7 +1158,6 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
#ifdef HAVE_LSTAT
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
@@ -1193,7 +1191,6 @@ rb_file_lstat(VALUE obj)
struct stat st;
VALUE path;
- rb_secure(2);
GetOpenFile(obj, fptr);
if (NIL_P(fptr->pathv)) return Qnil;
path = rb_str_encode_ospath(fptr->pathv);
@@ -1407,7 +1404,6 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
#ifdef S_ISLNK
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse;
@@ -1559,7 +1555,6 @@ rb_file_exists_p(VALUE obj, VALUE fname)
static VALUE
rb_file_readable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), R_OK) < 0) return Qfalse;
@@ -1577,7 +1572,6 @@ rb_file_readable_p(VALUE obj, VALUE fname)
static VALUE
rb_file_readable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), R_OK) < 0) return Qfalse;
@@ -1633,7 +1627,6 @@ rb_file_world_readable_p(VALUE obj, VALUE fname)
static VALUE
rb_file_writable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), W_OK) < 0) return Qfalse;
@@ -1651,7 +1644,6 @@ rb_file_writable_p(VALUE obj, VALUE fname)
static VALUE
rb_file_writable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), W_OK) < 0) return Qfalse;
@@ -1699,7 +1691,6 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
static VALUE
rb_file_executable_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (eaccess(StringValueCStr(fname), X_OK) < 0) return Qfalse;
@@ -1717,7 +1708,6 @@ rb_file_executable_p(VALUE obj, VALUE fname)
static VALUE
rb_file_executable_real_p(VALUE obj, VALUE fname)
{
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (access(StringValueCStr(fname), X_OK) < 0) return Qfalse;
@@ -1850,7 +1840,6 @@ check3rdbyte(VALUE fname, int mode)
{
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) < 0) return Qfalse;
@@ -1945,7 +1934,6 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
HANDLE f1 = 0, f2 = 0;
# endif
- rb_secure(2);
# ifdef _WIN32
f1 = w32_io_info(&fname1, &st1);
if (f1 == INVALID_HANDLE_VALUE) return Qfalse;
@@ -2066,7 +2054,6 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
{
struct stat st;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) == -1) {
@@ -2338,7 +2325,6 @@ rb_file_s_chmod(int argc, VALUE *argv)
int mode;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
@@ -2368,7 +2354,6 @@ rb_file_chmod(VALUE obj, VALUE vmode)
VALUE path;
#endif
- rb_secure(2);
mode = NUM2INT(vmode);
GetOpenFile(obj, fptr);
@@ -2410,7 +2395,6 @@ rb_file_s_lchmod(int argc, VALUE *argv)
VALUE rest;
long mode, n;
- rb_secure(2);
rb_scan_args(argc, argv, "1*", &vmode, &rest);
mode = NUM2INT(vmode);
@@ -2474,7 +2458,6 @@ rb_file_s_chown(int argc, VALUE *argv)
struct chown_args arg;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &o, &g, &rest);
arg.owner = to_uid(o);
arg.group = to_gid(g);
@@ -2508,7 +2491,6 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
VALUE path;
#endif
- rb_secure(2);
o = to_uid(owner);
g = to_gid(group);
GetOpenFile(obj, fptr);
@@ -2552,7 +2534,6 @@ rb_file_s_lchown(int argc, VALUE *argv)
struct chown_args arg;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &o, &g, &rest);
arg.owner = to_uid(o);
arg.group = to_gid(g);
@@ -2686,7 +2667,6 @@ rb_file_s_utime(int argc, VALUE *argv)
struct timespec tss[2], *tsp = NULL;
long n;
- rb_secure(2);
rb_scan_args(argc, argv, "2*", &args.atime, &args.mtime, &rest);
if (!NIL_P(args.atime) || !NIL_P(args.mtime)) {
@@ -2738,7 +2718,6 @@ sys_fail2(VALUE s1, VALUE s2)
static VALUE
rb_file_s_link(VALUE klass, VALUE from, VALUE to)
{
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
from = rb_str_encode_ospath(from);
@@ -2769,7 +2748,6 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
static VALUE
rb_file_s_symlink(VALUE klass, VALUE from, VALUE to)
{
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
from = rb_str_encode_ospath(from);
@@ -2812,7 +2790,6 @@ rb_readlink(VALUE path)
ssize_t rv;
VALUE v;
- rb_secure(2);
FilePathValue(path);
path = rb_str_encode_ospath(path);
v = rb_enc_str_new(0, size, rb_filesystem_encoding());
@@ -2860,7 +2837,6 @@ rb_file_s_unlink(VALUE klass, VALUE args)
{
long n;
- rb_secure(2);
n = apply2files(unlink_internal, args, 0);
return LONG2FIX(n);
}
@@ -2881,7 +2857,6 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
const char *src, *dst;
VALUE f, t;
- rb_secure(2);
FilePathValue(from);
FilePathValue(to);
f = rb_str_encode_ospath(from);
@@ -2930,7 +2905,6 @@ rb_file_s_umask(int argc, VALUE *argv)
{
int omask = 0;
- rb_secure(2);
if (argc == 0) {
omask = umask(0);
umask(omask);
@@ -3862,8 +3836,6 @@ rb_realpath_internal(VALUE basedir, VALUE path, int strict)
char *ptr, *prefixptr = NULL, *pend;
long len;
- rb_secure(2);
-
FilePathValue(path);
unresolved_path = rb_str_dup_frozen(path);
@@ -4455,7 +4427,6 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
long pos;
#endif
- rb_secure(2);
pos = NUM2POS(len);
FilePathValue(path);
path = rb_str_encode_ospath(path);
@@ -4511,7 +4482,6 @@ rb_file_truncate(VALUE obj, VALUE len)
long pos;
#endif
- rb_secure(2);
pos = NUM2POS(len);
GetOpenFile(obj, fptr);
if (!(fptr->mode & FMODE_WRITABLE)) {
@@ -4617,7 +4587,6 @@ rb_file_flock(VALUE obj, VALUE operation)
int op[2], op1;
struct timeval time;
- rb_secure(2);
op[1] = op1 = NUM2INT(operation);
GetOpenFile(obj, fptr);
op[0] = fptr->fd;
@@ -4658,7 +4627,6 @@ test_check(int n, int argc, VALUE *argv)
{
int i;
- rb_secure(2);
n+=1;
rb_check_arity(argc, n, n);
for (i=1; i<n; i++) {
@@ -4906,7 +4874,6 @@ rb_stat_init(VALUE obj, VALUE fname)
{
struct stat st, *nst;
- rb_secure(2);
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) == -1) {
diff --git a/gc.c b/gc.c
index 6741590f8e..a86226e610 100644
--- a/gc.c
+++ b/gc.c
@@ -7012,7 +7012,6 @@ static VALUE
gc_stress_set_m(VALUE self, VALUE flag)
{
rb_objspace_t *objspace = &rb_objspace;
- rb_secure(2);
gc_stress_set(objspace, flag);
return flag;
}
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 5379cd8e73..50dcd60167 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -572,15 +572,15 @@ VALUE rb_get_path(VALUE);
VALUE rb_get_path_no_checksafe(VALUE);
#define FilePathStringValue(v) ((v) = rb_get_path_no_checksafe(v))
-#define RUBY_SAFE_LEVEL_MAX 2
+#define RUBY_SAFE_LEVEL_MAX 1
void rb_secure(int);
int rb_safe_level(void);
void rb_set_safe_level(int);
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
-int ruby_safe_level_3_error(void) __attribute__((error("$SAFE=3 and 4 is obsolete")));
-int ruby_safe_level_3_warning(void) __attribute__((warning("$SAFE=3 and 4 is obsolete")));
+int ruby_safe_level_2_error(void) __attribute__((error("$SAFE=2 to 4 are obsolete")));
+int ruby_safe_level_2_warning(void) __attribute__((warning("$SAFE=2 to 4 are obsolete")));
# ifdef RUBY_EXPORT
-# define ruby_safe_level_3_warning() ruby_safe_level_3_error()
+# define ruby_safe_level_2_warning() ruby_safe_level_2_error()
# endif
#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
# define RUBY_SAFE_LEVEL_INVALID_P(level) \
diff --git a/io.c b/io.c
index fcccc71d0a..dfdb422b56 100644
--- a/io.c
+++ b/io.c
@@ -9130,8 +9130,6 @@ rb_ioctl(VALUE io, VALUE req, VALUE arg)
long narg;
int retval;
- rb_secure(2);
-
narg = setup_narg(cmd, &arg, 1);
GetOpenFile(io, fptr);
retval = do_ioctl(fptr->fd, cmd, narg);
@@ -9219,8 +9217,6 @@ rb_fcntl(VALUE io, VALUE req, VALUE arg)
long narg;
int retval;
- rb_secure(2);
-
narg = setup_narg(cmd, &arg, 0);
GetOpenFile(io, fptr);
retval = do_fcntl(fptr->fd, cmd, narg);
@@ -9339,7 +9335,6 @@ rb_f_syscall(int argc, VALUE *argv)
rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative.");
}
- rb_secure(2);
if (argc == 0)
rb_raise(rb_eArgError, "too few arguments for syscall");
if (argc > numberof(arg))
diff --git a/process.c b/process.c
index a1e02079f4..47dd4b365a 100644
--- a/process.c
+++ b/process.c
@@ -377,7 +377,6 @@ parent_redirect_close(int fd)
static VALUE
get_pid(void)
{
- rb_secure(2);
return PIDT2NUM(getpid());
}
@@ -401,7 +400,6 @@ get_pid(void)
static VALUE
get_ppid(void)
{
- rb_secure(2);
return PIDT2NUM(getppid());
}
@@ -936,7 +934,6 @@ proc_wait(int argc, VALUE *argv)
rb_pid_t pid;
int flags, status;
- rb_secure(2);
flags = 0;
if (argc == 0) {
pid = -1;
@@ -1010,7 +1007,6 @@ proc_waitall(void)
rb_pid_t pid;
int status;
- rb_secure(2);
result = rb_ary_new();
rb_last_status_clear();
@@ -1106,7 +1102,6 @@ rb_detach_process(rb_pid_t pid)
static VALUE
proc_detach(VALUE obj, VALUE pid)
{
- rb_secure(2);
return rb_detach_process(NUM2PIDT(pid));
}
@@ -1652,8 +1647,6 @@ rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
int rtype;
#endif
- rb_secure(2);
-
switch (TYPE(key)) {
case T_SYMBOL:
if (!(id = rb_check_id(&key))) return ST_STOP;
@@ -3657,8 +3650,6 @@ rb_f_fork(VALUE obj)
{
rb_pid_t pid;
- rb_secure(2);
-
switch (pid = rb_fork_ruby(NULL)) {
case 0:
rb_thread_atfork();
@@ -4365,7 +4356,6 @@ proc_getpgrp(void)
{
rb_pid_t pgrp;
- rb_secure(2);
#if defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)
pgrp = getpgrp();
if (pgrp < 0) rb_sys_fail(0);
@@ -4393,7 +4383,6 @@ proc_getpgrp(void)
static VALUE
proc_setpgrp(void)
{
- rb_secure(2);
/* check for posix setpgid() first; this matches the posix */
/* getpgrp() above. It appears that configure will set SETPGRP_VOID */
/* even though setpgrp(0,0) would be preferred. The posix call avoids */
@@ -4426,7 +4415,6 @@ proc_getpgid(VALUE obj, VALUE pid)
{
rb_pid_t i;
- rb_secure(2);
i = getpgid(NUM2PIDT(pid));
if (i < 0) rb_sys_fail(0);
return PIDT2NUM(i);
@@ -4450,7 +4438,6 @@ proc_setpgid(VALUE obj, VALUE pid, VALUE pgrp)
{
rb_pid_t ipid, ipgrp;
- rb_secure(2);
ipid = NUM2PIDT(pid);
ipgrp = NUM2PIDT(pgrp);
@@ -4481,7 +4468,6 @@ proc_getsid(int argc, VALUE *argv)
rb_pid_t sid;
VALUE pid;
- rb_secure(2);
rb_scan_args(argc, argv, "01", &pid);
if (NIL_P(pid))
@@ -4517,7 +4503,6 @@ proc_setsid(void)
{
rb_pid_t pid;
- rb_secure(2);
pid = setsid();
if (pid < 0) rb_sys_fail(0);
return PIDT2NUM(pid);
@@ -4578,7 +4563,6 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
{
int prio, iwhich, iwho;
- rb_secure(2);
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
@@ -4610,7 +4594,6 @@ proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
{
int iwhich, iwho, iprio;
- rb_secure(2);
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
iprio = NUM2INT(prio);
@@ -4850,8 +4833,6 @@ proc_getrlimit(VALUE obj, VALUE resource)
{
struct rlimit rlim;
- rb_secure(2);
-
if (getrlimit(rlimit_resource_type(resource), &rlim) < 0) {
rb_sys_fail("getrlimit");
}
@@ -4919,8 +4900,6 @@ proc_setrlimit(int argc, VALUE *argv, VALUE obj)
VALUE resource, rlim_cur, rlim_max;
struct rlimit rlim;
- rb_secure(2);
-
rb_scan_args(argc, argv, "21", &resource, &rlim_cur, &rlim_max);
if (rlim_max == Qnil)
rlim_max = rlim_cur;
@@ -4941,7 +4920,6 @@ static int under_uid_switch = 0;
static void
check_uid_switch(void)
{
- rb_secure(2);
if (under_uid_switch) {
rb_raise(rb_eRuntimeError, "can't handle UID while evaluating block given to Process::UID.switch method");
}
@@ -4951,7 +4929,6 @@ static int under_gid_switch = 0;
static void
check_gid_switch(void)
{
- rb_secure(2);
if (under_gid_switch) {
rb_raise(rb_eRuntimeError, "can't handle GID while evaluating block given to Process::UID.switch method");
}
@@ -5650,7 +5627,6 @@ p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
static VALUE
p_sys_issetugid(VALUE obj)
{
- rb_secure(2);
if (issetugid()) {
return Qtrue;
}
@@ -5965,7 +5941,6 @@ proc_daemon(int argc, VALUE *argv)
VALUE nochdir, noclose;
int n;
- rb_secure(2);
rb_scan_args(argc, argv, "02", &nochdir, &noclose);
prefork();
diff --git a/safe.c b/safe.c
index 73d861d760..c1eca672a0 100644
--- a/safe.c
+++ b/safe.c
@@ -24,12 +24,12 @@
#undef rb_secure
#undef rb_set_safe_level
-#undef ruby_safe_level_3_warning
+#undef ruby_safe_level_2_warning
int
-ruby_safe_level_3_warning(void)
+ruby_safe_level_2_warning(void)
{
- return 3;
+ return 2;
}
int
@@ -51,7 +51,7 @@ rb_set_safe_level(int level)
if (level > th->safe_level) {
if (level > SAFE_LEVEL_MAX) {
- rb_raise(rb_eArgError, "$SAFE=3 and 4 is obsolete");
+ rb_raise(rb_eArgError, "$SAFE=2 to 4 are obsolete");
}
th->safe_level = level;
}
@@ -75,7 +75,7 @@ safe_setter(VALUE val)
th->safe_level, level);
}
if (level > SAFE_LEVEL_MAX) {
- rb_raise(rb_eArgError, "$SAFE=3 and 4 is obsolete");
+ rb_raise(rb_eArgError, "$SAFE=2 to 4 are obsolete");
}
th->safe_level = level;
}
diff --git a/signal.c b/signal.c
index 53e77d9ca4..40caaa660c 100644
--- a/signal.c
+++ b/signal.c
@@ -418,7 +418,6 @@ rb_f_kill(int argc, const VALUE *argv)
VALUE str;
const char *s;
- rb_secure(2);
rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS);
switch (TYPE(argv[0])) {
@@ -1280,7 +1279,6 @@ sig_trap(int argc, VALUE *argv)
sighandler_t func;
VALUE cmd;
- rb_secure(2);
rb_check_arity(argc, 1, 2);
sig = trap_signm(argv[0]);
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 150df1dc26..1f1253fd23 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -89,7 +89,6 @@ class TestERBCore < Test::Unit::TestCase
_test_core(nil)
_test_core(0)
_test_core(1)
- _test_core(2)
end
def _test_core(safe)
diff --git a/test/fiddle/test_handle.rb b/test/fiddle/test_handle.rb
index 2655b1c0cb..2480230829 100644
--- a/test/fiddle/test_handle.rb
+++ b/test/fiddle/test_handle.rb
@@ -14,15 +14,6 @@ module Fiddle
assert_kind_of Integer, handle.to_i
end
- def test_static_sym_secure
- assert_raises(SecurityError) do
- Thread.new do
- $SAFE = 2
- Fiddle::Handle.sym('calloc')
- end.join
- end
- end
-
def test_static_sym_unknown
assert_raises(DLError) { Fiddle::Handle.sym('fooo') }
assert_raises(DLError) { Fiddle::Handle['fooo'] }
@@ -66,16 +57,6 @@ module Fiddle
assert_raises(TypeError) { handle[nil] }
end
- def test_sym_secure
- assert_raises(SecurityError) do
- Thread.new do
- $SAFE = 2
- handle = Handle.new(LIBC_SO)
- handle.sym('calloc')
- end.join
- end
- end
-
def test_sym
handle = Handle.new(LIBC_SO)
refute_nil handle.sym('calloc')
@@ -99,24 +80,6 @@ module Fiddle
assert_instance_of Handle, dlopen(LIBC_SO)
end
- def test_dlopen_safe
- assert_raises(SecurityError) do
- Thread.new do
- $SAFE = 2
- dlopen(LIBC_SO)
- end.join
- end
- end
-
- def test_initialize_safe
- assert_raises(SecurityError) do
- Thread.new do
- $SAFE = 2
- Handle.new(LIBC_SO)
- end.join
- end
- end
-
def test_initialize_noargs
handle = Handle.new
refute_nil handle['rb_str_new']
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 541500a44f..6effa5197c 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -444,87 +444,6 @@ class TestEnv < Test::Unit::TestCase
end
end
- def test_taint_aref
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV["FOO".taint]
- end.call
- end
- end
-
- def test_taint_fetch
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.fetch("FOO".taint)
- end.call
- end
- end
-
- def test_taint_assoc
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.assoc("FOO".taint)
- end.call
- end
- end
-
- def test_taint_rassoc
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.rassoc("FOO".taint)
- end.call
- end
- end
-
- def test_taint_key
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.key("FOO".taint)
- end.call
- end
- end
-
- def test_taint_key_p
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.key?("FOO".taint)
- end.call
- end
- end
-
- def test_taint_value_p
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV.value?("FOO".taint)
- end.call
- end
- end
-
- def test_taint_aset_value
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV["FOO"] = "BAR".taint
- end.call
- end
- end
-
- def test_taint_aset_key
- assert_raise(SecurityError) do
- proc do
- $SAFE = 2
- ENV["FOO".taint] = "BAR"
- end.call
- end
- end
-
if RUBY_PLATFORM =~ /bccwin|mswin|mingw/
def test_memory_leak_aset
bug9977 = '[ruby-dev:48323] [Bug #9977]'
diff --git a/win32/file.c b/win32/file.c
index 92b99a063e..4a31fe37eb 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -664,7 +664,6 @@ rb_readlink(VALUE path)
rb_encoding *enc;
UINT cp, path_cp;
- rb_secure(2);
FilePathValue(path);
enc = rb_enc_get(path);
cp = path_cp = code_page(enc);