summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 08:13:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 08:13:26 +0000
commitc1bfef949450c0ad55024670af2245a7833a59b4 (patch)
tree5a6bbad8df2b79c8e33efb2e1508589cb80e05ac
parent9eae31d5696cb796821929ff289869e94d87c840 (diff)
* file.c (path_check_1): do not fail on world writable *parent*
directories too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b90942d1df..ce2a38e2ab3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 19 17:10:25 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * file.c (path_check_1): do not fail on world writable *parent*
+ directories too.
+
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*
diff --git a/file.c b/file.c
index 7fbe26001b6..1b0ad93a57e 100644
--- a/file.c
+++ b/file.c
@@ -2307,11 +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
- if (!p || !(st.st_mode & S_ISVTX))
+ && (!p || !(st.st_mode & S_ISVTX))
#endif
- rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode);
+ ) {
+ rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode);
if (p) *p = '/';
return 0;
}