From: Eric Wong Date: 2017-07-13T06:22:13+00:00 Subject: [ruby-core:82025] Re: [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems ko1@atdot.net wrote: > Thank you for survey. No problem :) > normalperson (Eric Wong) wrote: > > > I think we don't need to prepare frozen string table for tainted string because most of people don't use tainted strings. We need to measure the counts of that before commit it. If there are many of tainted strings, I need to change the mind... > > > > Here is my measurement patch: > > > > https://80x24.org/spew/20170713025614.GB18169@starla/raw > > patch requires gcc for __attribute__((destructor)) > > > > It is frequent to have tainted strings when parsing YAML, HTTP > > requests/responses from pure Ruby (webrick or net/http), and > > email headers. > > * They taint string explicitly? No, all external data is tainted. IO#read/read_nonblock/readpartial/gets all return tainted data: $ ruby -e 'r, w = IO.pipe; w.write("."); p r.read(1).tainted?' true > I'm not sure we should employ tainted fstring table, or fix > these programs. Do you have opinion? I strongly favor using the tainted fstring table. It is more transparent. I don't want to ask programmers to put `-' everywhere for String#-@ dedupe. In general, I don't like asking programmers to make changes (especially not ugly ones) when Ruby can do so transparently. Honestly, I never care for taint/$SAFE, and maybe most Rubyists do not, either. However, it exists, and we need to do our best to support it. And yes, for IO#read family methods, it's forced on us to care about tainted strings, I guess. Unsubscribe: