From: Sean Russell Date: 2002-04-23T00:13:18+09:00 Subject: Taintedness inheritance -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have a question for the Gurus on taintedness: a = "sean" a.taint b = a.unpack("C*") b.tainted? # => false Which means: b = a.unpack("C*").pack("C*") is an efficient way of untainting a string. Now, taintedness is a property of all objects, and is /sometimes/ inherited in derived objects (most notably Strings), but most often not: b = " russell" b.tainted? # => false c = a + b c.tainted? # => true x = [1] x.taint y = [2] z = x + y z.tainted? # => false b = a.to_a b.tainted? # => false b = "" b << a b.tainted? # => true Is there a document that outlines where objects derived from tainted objects inherit taintedness, and why? What is the reasoning behind objects inheriting (or not inheriting) taintedness? Should everything that touches a tainted object become tainted? It seems sort of arbitrary at the moment; do only Strings inherit taintedness? Thanks in advance, - --- SER -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xCZEP0KxygnleI8RAp5+AKCDcXCBCTlFbNbhX0lsRnYSjsyoegCeI9Oa CP4ELmOdb7sKfVnFtmNrlno= =JK2z -----END PGP SIGNATURE-----