diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-19 06:43:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-19 06:43:58 +0000 |
commit | e60deb155585c410b85d417002d1f4f32062de19 (patch) | |
tree | a2c527cf4353e88720cdc094e3fa2cc55dd8fd5d /file.c | |
parent | 87bf8b1dc31de2eaeafe5e75eaa04571926302ea (diff) | |
download | ruby-e60deb155585c410b85d417002d1f4f32062de19.tar.gz |
* 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
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; |