diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | class.c | 4 | ||||
-rw-r--r-- | file.c | 7 | ||||
-rw-r--r-- | sample/test.rb | 8 |
4 files changed, 22 insertions, 5 deletions
@@ -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> * file.c (path_check_1): should check directory sticky bits. @@ -361,8 +361,10 @@ rb_include_module(klass, module) /* ignore if the module included already in superclasses */ for (p = RCLASS(klass)->super; p; p = RCLASS(p)->super) { 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; + } } } RCLASS(c)->super = include_class_new(module, RCLASS(c)->super); @@ -2307,13 +2307,12 @@ path_check_1(path) #ifndef S_IWOTH # define S_IWOTH 002 #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 - && !(st.st_mode & S_ISVTX) + if (!p || !(st.st_mode & S_ISVTX)) #endif - ) { + rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode); if (p) *p = '/'; - rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode); return 0; } s = strrdirsep(p0); diff --git a/sample/test.rb b/sample/test.rb index 9778b6e4ca..70cd79e9b2 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1242,6 +1242,14 @@ rescue NoMethodError test_ok true 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" $x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)] $y = Marshal.dump($x) |