summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-09 22:29:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-09 22:29:16 +0000
commit9e39c618da89cda4819b62f14f82348372f32d63 (patch)
treee6c9d336bebae6dbad075ed191d641c9999e361e /ext/etc
parente7ab96f6ede27a19ef8317a1062f70f691122a07 (diff)
* ext/etc/etc.c (etc_systmpdir): assume system default tmpdir
safe. [ruby-dev:42089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/etc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 0a01acf..9f2b459 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -584,14 +584,17 @@ etc_sysconfdir(VALUE obj)
static VALUE
etc_systmpdir(void)
{
+ VALUE tmpdir;
#ifdef _WIN32
WCHAR path[_MAX_PATH];
UINT len = rb_w32_system_tmpdir(path, numberof(path));
if (!len) return Qnil;
- return rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
+ tmpdir = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());
#else
- return rb_filesystem_str_new_cstr("/tmp");
+ tmpdir = rb_filesystem_str_new_cstr("/tmp");
#endif
+ FL_UNSET(tmpdir, FL_TAINT|FL_UNTRUSTED);
+ return tmpdir;
}
/*