mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* file.c (rb_find_file_noext, rb_find_file): fix tilde expansion
problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
51efc221c1
commit
f30288ebf6
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jul 26 11:27:12 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_find_file_noext, rb_find_file): fix tilde expansion
|
||||||
|
problem.
|
||||||
|
|
||||||
Wed Jul 25 17:16:26 2001 Akinori MUSHA <knu@iDaemons.org>
|
Wed Jul 25 17:16:26 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* intern.h: add some missing function prototypes.
|
* intern.h: add some missing function prototypes.
|
||||||
|
|
7
file.c
7
file.c
|
@ -2278,6 +2278,8 @@ rb_find_file_noext(filep)
|
||||||
if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
|
if (rb_safe_level() >= 2 && OBJ_TAINTED(fname)) {
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
}
|
}
|
||||||
|
f = STR2CSTR(fname);
|
||||||
|
*filep = fname;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_absolute_path(f)) {
|
if (is_absolute_path(f)) {
|
||||||
|
@ -2323,10 +2325,11 @@ rb_find_file(path)
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (f[0] == '~') {
|
if (f[0] == '~') {
|
||||||
tmp = rb_file_s_expand_path(1, &path);
|
path = rb_file_s_expand_path(1, &path);
|
||||||
if (rb_safe_level() >= 2 && OBJ_TAINTED(tmp)) {
|
if (rb_safe_level() >= 2 && OBJ_TAINTED(path)) {
|
||||||
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
|
||||||
}
|
}
|
||||||
|
f = STR2CSTR(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MACOS__) || defined(riscos)
|
#if defined(__MACOS__) || defined(riscos)
|
||||||
|
|
Loading…
Reference in a new issue