Skip to content

Commit

Permalink
The taint mechanism will be deprecated in Ruby 2.7 (#1083)
Browse files Browse the repository at this point in the history
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
  • Loading branch information
kamipo authored and sodabrew committed Dec 1, 2019
1 parent db6733a commit 785969f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/mysql2/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static void rb_mysql_client_mark(void * wrapper) {

static VALUE rb_raise_mysql2_error(mysql_client_wrapper *wrapper) {
VALUE rb_error_msg = rb_str_new2(mysql_error(wrapper->client));
VALUE rb_sql_state = rb_tainted_str_new2(mysql_sqlstate(wrapper->client));
VALUE rb_sql_state = rb_str_new2(mysql_sqlstate(wrapper->client));
VALUE e;

rb_enc_associate(rb_error_msg, rb_utf8_encoding());
Expand Down
2 changes: 1 addition & 1 deletion ext/mysql2/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void rb_raise_mysql2_stmt_error(mysql_stmt_wrapper *stmt_wrapper) {
VALUE e;
GET_CLIENT(stmt_wrapper->client);
VALUE rb_error_msg = rb_str_new2(mysql_stmt_error(stmt_wrapper->stmt));
VALUE rb_sql_state = rb_tainted_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));
VALUE rb_sql_state = rb_str_new2(mysql_stmt_sqlstate(stmt_wrapper->stmt));

rb_encoding *conn_enc;
conn_enc = rb_to_encoding(wrapper->encoding);
Expand Down

0 comments on commit 785969f

Please sign in to comment.