matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
303974887a
commit
c9accd03e7
14
ChangeLog
14
ChangeLog
@ -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>
|
Wed Jul 19 15:14:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* bignum.c (bigdivrem): should use rb_int2big(), not rb_uint2big().
|
* bignum.c (bigdivrem): should use rb_int2big(), not rb_uint2big().
|
||||||
|
1
hash.c
1
hash.c
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#ifndef HAVE_STRING_H
|
#ifndef HAVE_STRING_H
|
||||||
char *strchr _((char*,char));
|
char *strchr _((char*,char));
|
||||||
|
char *strdup _((const char*));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HASH_DELETED FL_USER1
|
#define HASH_DELETED FL_USER1
|
||||||
|
12
marshal.c
12
marshal.c
@ -55,6 +55,7 @@ struct dump_arg {
|
|||||||
VALUE str;
|
VALUE str;
|
||||||
st_table *symbol;
|
st_table *symbol;
|
||||||
st_table *data;
|
st_table *data;
|
||||||
|
int taint;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dump_call_arg {
|
struct dump_call_arg {
|
||||||
@ -270,6 +271,8 @@ w_object(obj, arg, limit)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OBJ_TAINTED(obj)) arg->taint = Qtrue;
|
||||||
|
|
||||||
st_add_direct(arg->data, obj, arg->data->num_entries);
|
st_add_direct(arg->data, obj, arg->data->num_entries);
|
||||||
if (rb_respond_to(obj, s_dump)) {
|
if (rb_respond_to(obj, s_dump)) {
|
||||||
VALUE v;
|
VALUE v;
|
||||||
@ -432,6 +435,9 @@ dump_ensure(arg)
|
|||||||
{
|
{
|
||||||
st_free_table(arg->symbol);
|
st_free_table(arg->symbol);
|
||||||
st_free_table(arg->data);
|
st_free_table(arg->data);
|
||||||
|
if (!arg->fp && arg->taint) {
|
||||||
|
OBJ_TAINT(arg->str);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,6 +482,7 @@ marshal_dump(argc, argv)
|
|||||||
|
|
||||||
arg.symbol = st_init_numtable();
|
arg.symbol = st_init_numtable();
|
||||||
arg.data = st_init_numtable();
|
arg.data = st_init_numtable();
|
||||||
|
arg.taint = Qfalse;
|
||||||
c_arg.obj = obj;
|
c_arg.obj = obj;
|
||||||
c_arg.arg = &arg;
|
c_arg.arg = &arg;
|
||||||
c_arg.limit = limit;
|
c_arg.limit = limit;
|
||||||
@ -494,6 +501,7 @@ struct load_arg {
|
|||||||
st_table *symbol;
|
st_table *symbol;
|
||||||
VALUE data;
|
VALUE data;
|
||||||
VALUE proc;
|
VALUE proc;
|
||||||
|
int taint;
|
||||||
};
|
};
|
||||||
|
|
||||||
static VALUE r_object _((struct load_arg *arg));
|
static VALUE r_object _((struct load_arg *arg));
|
||||||
@ -658,11 +666,11 @@ r_regist(v, arg)
|
|||||||
VALUE v;
|
VALUE v;
|
||||||
struct load_arg *arg;
|
struct load_arg *arg;
|
||||||
{
|
{
|
||||||
OBJ_TAINT(v);
|
|
||||||
if (arg->proc) {
|
if (arg->proc) {
|
||||||
rb_funcall(arg->proc, rb_intern("call"), 1, v);
|
rb_funcall(arg->proc, rb_intern("call"), 1, v);
|
||||||
}
|
}
|
||||||
rb_hash_aset(arg->data, INT2FIX(RHASH(arg->data)->tbl->num_entries), v);
|
rb_hash_aset(arg->data, INT2FIX(RHASH(arg->data)->tbl->num_entries), v);
|
||||||
|
if (arg->taint) OBJ_TAINT(v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,6 +952,7 @@ marshal_load(argc, argv)
|
|||||||
GetOpenFile(port, fptr);
|
GetOpenFile(port, fptr);
|
||||||
rb_io_check_readable(fptr);
|
rb_io_check_readable(fptr);
|
||||||
arg.fp = fptr->f;
|
arg.fp = fptr->f;
|
||||||
|
arg.taint = Qtrue;
|
||||||
}
|
}
|
||||||
else if (rb_respond_to(port, rb_intern("to_str"))) {
|
else if (rb_respond_to(port, rb_intern("to_str"))) {
|
||||||
int len;
|
int len;
|
||||||
@ -951,6 +960,7 @@ marshal_load(argc, argv)
|
|||||||
arg.fp = 0;
|
arg.fp = 0;
|
||||||
arg.ptr = rb_str2cstr(port, &len);
|
arg.ptr = rb_str2cstr(port, &len);
|
||||||
arg.end = arg.ptr + len;
|
arg.end = arg.ptr + len;
|
||||||
|
arg.taint = OBJ_TAINTED(port);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rb_raise(rb_eTypeError, "instance of IO needed");
|
rb_raise(rb_eTypeError, "instance of IO needed");
|
||||||
|
4
parse.y
4
parse.y
@ -849,6 +849,10 @@ arg : lhs '=' arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
aref_args : none
|
aref_args : none
|
||||||
|
| command_call opt_nl
|
||||||
|
{
|
||||||
|
$$ = NEW_LIST($1);
|
||||||
|
}
|
||||||
| args opt_nl
|
| args opt_nl
|
||||||
{
|
{
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
|
@ -891,8 +891,9 @@ proc_getpriority(obj, which, who)
|
|||||||
iwhich = NUM2INT(which);
|
iwhich = NUM2INT(which);
|
||||||
iwho = NUM2INT(who);
|
iwho = NUM2INT(who);
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
prio = getpriority(iwhich, iwho);
|
prio = getpriority(iwhich, iwho);
|
||||||
if (prio < 0) rb_sys_fail(0);
|
if (errno) rb_sys_fail(0);
|
||||||
return INT2FIX(prio);
|
return INT2FIX(prio);
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define RUBY_VERSION "1.5.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_VERSION_CODE 154
|
||||||
#define RUBY_RELEASE_CODE 20000719
|
#define RUBY_RELEASE_CODE 20000721
|
||||||
|
Loading…
x
Reference in New Issue
Block a user