1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-07-21 08:45:34 +00:00
parent 303974887a
commit c9accd03e7
6 changed files with 34 additions and 4 deletions

View file

@ -1,3 +1,17 @@
Fri Jul 21 17:35:01 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (aref_args): command_call now be permitted as
aref_args.
* process.c (proc_getpriority): getpriority(2) may return valid
negative number. use errno to detect error.
* marshal.c (dump_ensure): dumped string should be tainted if
any among target objects is tainted.
* marshal.c (r_regist): restored object should be tainted if and
only if the source is a file or a tainted string.
Wed Jul 19 15:14:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* bignum.c (bigdivrem): should use rb_int2big(), not rb_uint2big().

1
hash.c
View file

@ -19,6 +19,7 @@
#ifndef HAVE_STRING_H
char *strchr _((char*,char));
char *strdup _((const char*));
#endif
#define HASH_DELETED FL_USER1

View file

@ -55,6 +55,7 @@ struct dump_arg {
VALUE str;
st_table *symbol;
st_table *data;
int taint;
};
struct dump_call_arg {
@ -270,6 +271,8 @@ w_object(obj, arg, limit)
return;
}
if (OBJ_TAINTED(obj)) arg->taint = Qtrue;
st_add_direct(arg->data, obj, arg->data->num_entries);
if (rb_respond_to(obj, s_dump)) {
VALUE v;
@ -432,6 +435,9 @@ dump_ensure(arg)
{
st_free_table(arg->symbol);
st_free_table(arg->data);
if (!arg->fp && arg->taint) {
OBJ_TAINT(arg->str);
}
return 0;
}
@ -476,6 +482,7 @@ marshal_dump(argc, argv)
arg.symbol = st_init_numtable();
arg.data = st_init_numtable();
arg.taint = Qfalse;
c_arg.obj = obj;
c_arg.arg = &arg;
c_arg.limit = limit;
@ -494,6 +501,7 @@ struct load_arg {
st_table *symbol;
VALUE data;
VALUE proc;
int taint;
};
static VALUE r_object _((struct load_arg *arg));
@ -658,11 +666,11 @@ r_regist(v, arg)
VALUE v;
struct load_arg *arg;
{
OBJ_TAINT(v);
if (arg->proc) {
rb_funcall(arg->proc, rb_intern("call"), 1, v);
}
rb_hash_aset(arg->data, INT2FIX(RHASH(arg->data)->tbl->num_entries), v);
if (arg->taint) OBJ_TAINT(v);
return v;
}
@ -944,6 +952,7 @@ marshal_load(argc, argv)
GetOpenFile(port, fptr);
rb_io_check_readable(fptr);
arg.fp = fptr->f;
arg.taint = Qtrue;
}
else if (rb_respond_to(port, rb_intern("to_str"))) {
int len;
@ -951,6 +960,7 @@ marshal_load(argc, argv)
arg.fp = 0;
arg.ptr = rb_str2cstr(port, &len);
arg.end = arg.ptr + len;
arg.taint = OBJ_TAINTED(port);
}
else {
rb_raise(rb_eTypeError, "instance of IO needed");

View file

@ -849,6 +849,10 @@ arg : lhs '=' arg
}
aref_args : none
| command_call opt_nl
{
$$ = NEW_LIST($1);
}
| args opt_nl
{
$$ = $1;

View file

@ -891,8 +891,9 @@ proc_getpriority(obj, which, who)
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
errno = 0;
prio = getpriority(iwhich, iwho);
if (prio < 0) rb_sys_fail(0);
if (errno) rb_sys_fail(0);
return INT2FIX(prio);
#else
rb_notimplement();

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.4"
#define RUBY_RELEASE_DATE "2000-07-19"
#define RUBY_RELEASE_DATE "2000-07-21"
#define RUBY_VERSION_CODE 154
#define RUBY_RELEASE_CODE 20000719
#define RUBY_RELEASE_CODE 20000721