summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
commit75ff8fdb16fa0a733512e61350c9844ea530ad35 (patch)
treea057e60543c77d6e20ea2e91928928df80b2b6d3 /file.c
parent5d71c8d89c6bd7af934e7a8de5882cda2991711b (diff)
join 1.1c6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/file.c b/file.c
index 72dd022ba2..1d81f528a5 100644
--- a/file.c
+++ b/file.c
@@ -115,6 +115,7 @@ rb_file_reopen(argc, argv, file)
char *mode;
OpenFile *fptr;
+ rb_secure(2);
if (rb_scan_args(argc, argv, "11", &fname, &nmode) == 1) {
if (TYPE(fname) == T_FILE) { /* fname must be IO */
return rb_io_reopen(file, fname);
@@ -234,9 +235,10 @@ rb_stat(file, st)
VALUE file;
struct stat *st;
{
- OpenFile *fptr;
-
if (TYPE(file) == T_FILE) {
+ OpenFile *fptr;
+
+ rb_secure(2);
GetOpenFile(file, fptr);
return fstat(fileno(fptr->f), st);
}
@@ -296,6 +298,7 @@ rb_file_lstat(obj)
OpenFile *fptr;
struct stat st;
+ rb_secure(2);
GetOpenFile(obj, fptr);
if (lstat(fptr->path, &st) == -1) {
rb_sys_fail(fptr->path);
@@ -1106,6 +1109,7 @@ rb_file_s_umask(argc, argv)
#else
int omask = 0;
+ rb_secure(2);
if (argc == 0) {
omask = umask(0);
umask(omask);
@@ -1382,7 +1386,7 @@ rb_file_truncate(obj, len)
# define LOCK_UN 8
# endif
-#if defined(THREAD) && defined(EWOULDBLOCK)
+#if defined(USE_THREAD) && defined(EWOULDBLOCK)
static int
rb_thread_flock(fd, op)
int fd, op;