OS/390 cleanable gunk.
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 4b9b096..a2d5721 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4030,6 +4030,16 @@ PP(pp_system)
         int status;
         Sigsave_t ihand,qhand;     /* place to save signals during system() */
         
+        if (PL_tainting) {
+            SV *cmd = NULL;
+            if (PL_op->op_flags & OPf_STACKED)
+               cmd = *(MARK + 1);
+            else if (SP - MARK != 1)
+               cmd = *SP;
+            if (cmd && *(SvPV_nolen(cmd)) != '/')
+               TAINT_ENV();
+        }
+
         if (PerlProc_pipe(pp) >= 0)
              did_pipes = 1;
         while ((childpid = PerlProc_fork()) == -1) {