summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 07:25:05 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 07:25:05 +0000
commitf433d710d0ab3b367cc4a851cdfb81c5405bb7f8 (patch)
tree5d6a14de43873b9ddaec533051b942cf89c201ce /dir.c
parent55c141c6247a4d8c052c0d57f59ddaa29e3e523a (diff)
* object.c (rb_obj_untrusted): new method Object#untrusted?.
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index dcbbc14e0e..a3eed26c75 100644
--- a/dir.c
+++ b/dir.c
@@ -414,8 +414,8 @@ dir_closed(void)
static void
dir_check(VALUE dir)
{
- if (!OBJ_TAINTED(dir) && rb_safe_level() >= 4)
- rb_raise(rb_eSecurityError, "Insecure: operation on untainted Dir");
+ if (!OBJ_UNTRUSTED(dir) && rb_safe_level() >= 4)
+ rb_raise(rb_eSecurityError, "Insecure: operation on trusted Dir");
rb_check_frozen(dir);
}
@@ -630,7 +630,7 @@ dir_rewind(VALUE dir)
{
struct dir_data *dirp;
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) {
+ if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(dir)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetDIR(dir, dirp);