[EMAIL PROTECTED] wrote:
[...]stas 2003/02/03 22:52:15Modified: . Changes todo missing_old_features.txt src/modules/perl mod_perl.c t/modperl .cvsignore Added: t/response/TestModperl taint.pm Log: perl 5.7.3+ has a built-in ${^TAINT} to test whether running under -(T|t). Backport ${^TAINT} for mod_perl running under 5.6.0-5.7.3, (what used to be $Apache::__T. $Apache::__T is available too, but deprecated. + tests
As you can see I want us to use ${^TAINT} instead of $Apache::__T, but the former was added only in 5.7.3. So I've backported it to 5.6.0+
+static void set_taint_var(PerlInterpreter *perl)
+{
+ dTHXa(perl);
+ GV *gv;
+
+/* 5.7.3+ has a built-in special ${^TAINT}, backport it to 5.6.0+ */
+#if PERL_REVISION == 5 && \
+ (PERL_VERSION == 6 || (PERL_VERSION == 7 && PERL_SUBVERSION < 3))
+
+ gv = gv_fetchpv("\024AINT", GV_ADDMULTI, SVt_IV);
+ sv_setiv(GvSV(gv), PL_tainting);
+ SvREADONLY_on(GvSV(gv));
+#endif /* perl v < 5.7.3 */
In 5.7.3+ ${^TAINT} is magic, but I've figured a simple read-only IV will do
the job for older perls, since we know what PL_tainting is, after starting perl.+#ifdef MP_COMPAT_1XI'd move the compat $Apache::__T bit to compat.pm, but there is no way to set the variable as read-only from core perl. I doubt it's used at all other than in Apache::Registry, so may be we drop it?
+ gv = gv_fetchpv("Apache::__T", GV_ADDMULTI, SVt_PV);
+ sv_setiv(GvSV(gv), PL_tainting);
+ SvREADONLY_on(GvSV(gv));
+#endif /* MP_COMPAT_1X */
+ +}
Lemme know if you have any objections against this move.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
