mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file.c: preserve encoding
* file.c (path_check_0): preserve encoding of path name in warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
71b3abeba3
commit
a75bc36dd2
2 changed files with 6 additions and 3 deletions
6
file.c
6
file.c
|
@ -5634,9 +5634,9 @@ path_check_0(VALUE path, int execpath)
|
|||
&& !(p && execpath && (st.st_mode & S_ISVTX))
|
||||
#endif
|
||||
&& !access(p0, W_OK)) {
|
||||
rb_warn("Insecure world writable dir %s in %sPATH, mode 0%"
|
||||
PRI_MODET_PREFIX"o",
|
||||
p0, (execpath ? "" : "LOAD_"), st.st_mode);
|
||||
rb_enc_warn(enc, "Insecure world writable dir %s in %sPATH, mode 0%"
|
||||
PRI_MODET_PREFIX"o",
|
||||
p0, (execpath ? "" : "LOAD_"), st.st_mode);
|
||||
if (p) *p = '/';
|
||||
RB_GC_GUARD(path);
|
||||
return 0;
|
||||
|
|
|
@ -170,6 +170,9 @@ class TestRequire < Test::Unit::TestCase
|
|||
end
|
||||
assert_include(e.message, "loading from unsafe path")
|
||||
assert_include(stderr, "Insecure world writable dir")
|
||||
require_path = require_path.encode(self.class.ospath_encoding(require_path))
|
||||
assert_include(e.message, require_path)
|
||||
assert_include(stderr, File.dirname(require_path))
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue