Author: stas
Date: Tue Dec 21 09:44:20 2004
New Revision: 122973

URL: http://svn.apache.org/viewcvs?view=rev&rev=122973
Log:
replace the added in 1.99_17 code on resetting/restoring PL_tainted,
with explicit reset before and after each each callback. This solves a
complicated tainting issues caused when perl exception object is
thrown. rgs suggested that it should be safe, similar to perl's own
pp_nextstate which says: /* Each statement is presumed innocent */

Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/src/modules/perl/modperl_callback.c

Modified: perl/modperl/trunk/Changes
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=122973&p1=perl/modperl/trunk/Changes&r1=122972&p2=perl/modperl/trunk/Changes&r2=122973
==============================================================================
--- perl/modperl/trunk/Changes  (original)
+++ perl/modperl/trunk/Changes  Tue Dec 21 09:44:20 2004
@@ -12,6 +12,13 @@
 
 =item 1.99_19-dev
 
+replace the added in 1.99_17 code on resetting/restoring PL_tainted,
+with explicit reset before and after each each callback. This solves a
+complicated tainting issues caused when perl exception object is
+thrown. rgs suggested that it should be safe, similar to perl's own
+pp_nextstate which says: /* Each statement is presumed innocent */
+[Stas]
+
 New configuration directives: [Gozer]
  - PerlConfigRequire
     Just like PerlRequire, but _always_ triggers an immediate

Modified: perl/modperl/trunk/src/modules/perl/modperl_callback.c
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_callback.c?view=diff&rev=122973&p1=perl/modperl/trunk/src/modules/perl/modperl_callback.c&r1=122972&p2=perl/modperl/trunk/src/modules/perl/modperl_callback.c&r2=122973
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_callback.c      (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_callback.c      Tue Dec 21 
09:44:20 2004
@@ -22,23 +22,21 @@
     I32 flags = G_EVAL|G_SCALAR;
     dSP;
     int count, status = OK;
-    int tainted_orig = PL_tainted;
 
     /* handler callbacks shouldn't affect each other's taintedness
-     * state, so start every callback with a clear record and restore
-     * at the end. one of the main problems we are trying to solve is
-     * that when modperl_croak called (which calls perl's
-     * croak(Nullch) to throw an error object) it leaves the
-     * interprter in the tainted state (which supposedly will be fixed
-     * in 5.8.6) which later affects other callbacks that call eval,
-     * etc, which triggers perl crash with:
-     * Insecure dependency in eval while running setgid.
-     * Callback called exit.
+     * state, so start every callback with a clear tainted status
+     * before and after the callback one of the main problems we are
+     * trying to solve is that when modperl_croak called (which calls
+     * perl's croak(Nullch) to throw an error object) it leaves the
+     * interpreter in the tainted state which later affects other
+     * callbacks that call eval, etc., which triggers perl crash with:
+     * Insecure dependency in eval while running setgid.  Callback
+     * called exit.
      */
     TAINT_NOT;
 
     if ((status = modperl_handler_resolve(aTHX_ &handler, p, s)) != OK) {
-        PL_tainted = tainted_orig;
+        TAINT_NOT;
         return status;
     }
 
@@ -136,7 +134,7 @@
         }
     }
 
-    PL_tainted = tainted_orig;
+    TAINT_NOT;
 
     return status;
 }

Reply via email to