From e60deb155585c410b85d417002d1f4f32062de19 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 19 Feb 2002 06:43:58 +0000 Subject: * file.c (path_check_1): should check directory sticky bits. * process.c (security): need not to warn twice. * marshal.c (r_object): complete restoration before calling r_regist(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 1eea9360e4..3016589b91 100644 --- a/file.c +++ b/file.c @@ -2304,7 +2304,14 @@ path_check_1(path) return path_check_1(newpath); } for (;;) { - if (stat(p0, &st) == 0 && (st.st_mode & 002)) { +#ifndef S_IWOTH +# define S_IWOTH 002 +#endif + if (stat(p0, &st) == 0 && S_ISDIR(st->st_mode) && (st.st_mode & S_IWOTH) +#ifdef S_ISVTX + && !(st.st_mode & S_ISVTX) +#endif + ) { if (p) *p = '/'; rb_warn("Unsecure world writeable dir %s , mode 0%o", p0, st.st_mode); return 0; -- cgit v1.2.3