From 7e8e68061481bf4a641f4c5b2df435e902eeda58 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 19 Feb 2002 07:47:07 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@2094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index cc443c950..7fbe26001 100644 --- a/file.c +++ b/file.c @@ -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); -- cgit