summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 07:47:07 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 07:47:07 +0000
commit7e8e68061481bf4a641f4c5b2df435e902eeda58 (patch)
treefed3a1b8c969954c23bbe53f740958107edcb171 /file.c
parentf2f2c6d068d85a265b611587f1824bf4b66c47be (diff)
downloadruby-7e8e68061481bf4a641f4c5b2df435e902eeda58.tar.gz
ruby-7e8e68061481bf4a641f4c5b2df435e902eeda58.tar.xz
ruby-7e8e68061481bf4a641f4c5b2df435e902eeda58.zip
* 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
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 3 insertions, 4 deletions
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);