зеркало из https://github.com/github/ruby.git
* file.c (path_check_1): do not warn on world writable *parent*
directories. * class.c (rb_include_module): should preserve ancestor order in the included class/module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
87dfb89d2e
Коммит
9eae31d569
|
@ -1,3 +1,11 @@
|
||||||
|
Tue Feb 19 15:51:41 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (path_check_1): do not warn on world writable *parent*
|
||||||
|
directories.
|
||||||
|
|
||||||
|
* class.c (rb_include_module): should preserve ancestor order in
|
||||||
|
the included class/module.
|
||||||
|
|
||||||
Tue Feb 19 14:45:32 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Feb 19 14:45:32 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (path_check_1): should check directory sticky bits.
|
* file.c (path_check_1): should check directory sticky bits.
|
||||||
|
|
4
class.c
4
class.c
|
@ -361,8 +361,10 @@ rb_include_module(klass, module)
|
||||||
/* ignore if the module included already in superclasses */
|
/* ignore if the module included already in superclasses */
|
||||||
for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
|
for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) {
|
||||||
if (BUILTIN_TYPE(p) == T_ICLASS) {
|
if (BUILTIN_TYPE(p) == T_ICLASS) {
|
||||||
if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl)
|
if (RCLASS(p)->m_tbl == RCLASS(module)->m_tbl) {
|
||||||
|
c = p; /* move insertion point */
|
||||||
goto skip;
|
goto skip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);
|
RCLASS(c)->super = include_class_new(module, RCLASS(c)->super);
|
||||||
|
|
7
file.c
7
file.c
|
@ -2307,13 +2307,12 @@ path_check_1(path)
|
||||||
#ifndef S_IWOTH
|
#ifndef S_IWOTH
|
||||||
# define S_IWOTH 002
|
# define S_IWOTH 002
|
||||||
#endif
|
#endif
|
||||||
if (stat(p0, &st) == 0 && S_ISDIR(st.st_mode) && (st.st_mode & S_IWOTH)
|
if (stat(p0, &st) == 0 && S_ISDIR(st.st_mode) && (st.st_mode & S_IWOTH)) {
|
||||||
#ifdef S_ISVTX
|
#ifdef S_ISVTX
|
||||||
&& !(st.st_mode & S_ISVTX)
|
if (!p || !(st.st_mode & S_ISVTX))
|
||||||
#endif
|
#endif
|
||||||
) {
|
rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode);
|
||||||
if (p) *p = '/';
|
if (p) *p = '/';
|
||||||
rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
s = strrdirsep(p0);
|
s = strrdirsep(p0);
|
||||||
|
|
|
@ -1242,6 +1242,14 @@ rescue NoMethodError
|
||||||
test_ok true
|
test_ok true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module M001; end
|
||||||
|
module M002; end
|
||||||
|
module M003; include M002; end
|
||||||
|
module M002; include M001; end
|
||||||
|
module M003; include M002; end
|
||||||
|
|
||||||
|
test_ok(M003.ancestors == [M003, M002, M001])
|
||||||
|
|
||||||
test_check "marshal"
|
test_check "marshal"
|
||||||
$x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
|
$x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
|
||||||
$y = Marshal.dump($x)
|
$y = Marshal.dump($x)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче