rallhook 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/ext/rallhook_base/rallhook.c +2 -0
- data/ext/rallhook_base/restrict_def.c +10 -4
- data/ext/rallhook_base/restrict_def.h +2 -0
- data/ext/rallhook_base/ruby_redirect.c +2 -1
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -118,7 +118,13 @@ void rb_add_method_fake(
|
|
118
118
|
if (FL_TEST(klass, FL_SINGLETON)) {
|
119
119
|
// singleton method over classes are illegal
|
120
120
|
if ( strcmp( rb_class2name(klass), "Class") == 0) {
|
121
|
+
|
122
|
+
#ifdef RUBY1_9
|
123
|
+
st_data_t result;
|
124
|
+
#endif
|
125
|
+
#ifdef RUBY1_8
|
121
126
|
int result;
|
127
|
+
#endif
|
122
128
|
if (st_lookup(RCLASS(klass)->m_tbl,id,&result) ) {
|
123
129
|
rb_raise(rb_eSecurityError, "Illegal overwrite of singleton method %s", rb_id2name(id) );
|
124
130
|
}
|
@@ -131,7 +137,6 @@ void rb_add_method_fake(
|
|
131
137
|
} else {
|
132
138
|
rb_add_method_copy(klass,id,node,noex);
|
133
139
|
}
|
134
|
-
|
135
140
|
}
|
136
141
|
|
137
142
|
void shadow_redirect(VALUE* klass, VALUE* recv, ID* mid) {
|
@@ -144,9 +149,7 @@ void shadow_redirect(VALUE* klass, VALUE* recv, ID* mid) {
|
|
144
149
|
|
145
150
|
int add_method_code_changed = 0;
|
146
151
|
|
147
|
-
void
|
148
|
-
|
149
|
-
|
152
|
+
void hook_rb_add_method() {
|
150
153
|
if (!add_method_code_changed) {
|
151
154
|
|
152
155
|
void* handle = dlopen(current_libruby(),0x101);
|
@@ -163,6 +166,9 @@ void init_restrict_def() {
|
|
163
166
|
|
164
167
|
add_method_code_changed = 1;
|
165
168
|
}
|
169
|
+
}
|
170
|
+
|
171
|
+
void init_restrict_def() {
|
166
172
|
|
167
173
|
__shadow___id = rb_intern("__shadow__");
|
168
174
|
__unshadow___id = rb_intern("__unshadow__");
|
@@ -100,8 +100,9 @@ pthread_mutex_t put_redirect_handler_mutex;
|
|
100
100
|
int put_redirect_handler( REDIRECTHANDLER redirect_handler) {
|
101
101
|
|
102
102
|
pthread_mutex_lock(&put_redirect_handler_mutex);
|
103
|
-
put_redirect_handler_(redirect_handler);
|
103
|
+
int ret = put_redirect_handler_(redirect_handler);
|
104
104
|
pthread_mutex_unlock(&put_redirect_handler_mutex);
|
105
|
+
return ret;
|
105
106
|
}
|
106
107
|
|
107
108
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rallhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 5
|
10
|
+
version: 0.7.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dario Seminara
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07
|
18
|
+
date: 2010-08-07 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|