summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2001-11-26 20:42:29 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-26 23:55:02 +0000
commit52a55424e4624fc79eb8894fb91c5e2f4a9018ab (patch)
tree755e7bc8e040f7f66f6a0b2c70d3c2d3bfe780e7 /pp_sys.c
parentdbda34347e3a4321b3c3ae9358f7e2c5c89ad933 (diff)
downloadperl-52a55424e4624fc79eb8894fb91c5e2f4a9018ab.tar.gz
system and taintedness
Message-ID: <15362.28917.697078.551412@ix.netsoft.ro> p4raw-id: //depot/perl@13287
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 4b9b0963d7..a2d57219f8 100644
--- 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) {