summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-07-13 11:28:01 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-07-13 11:28:01 +0000
commit159f47d9c50d8b3750644c8f166145335385b847 (patch)
tree98d9e7f8ce78b5278506f5dd387353e07c2f1ac5 /pp_sys.c
parentdd99735e5845ae96055c262cc6883b73fc785c44 (diff)
downloadperl-159f47d9c50d8b3750644c8f166145335385b847.tar.gz
The warning "Use of tainted arguments in %s is deprecated"
was incorrectly reported whenever system or exec was invoked with multiple arguments. p4raw-id: //depot/perl@17516
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 88f45c3ee6..2639fe9019 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4049,18 +4049,21 @@ PP(pp_system)
I32 did_pipes = 0;
if (PL_tainting) {
+ int some_arg_tainted = 0;
TAINT_ENV();
while (++MARK <= SP) {
(void)SvPV_nolen(*MARK); /* stringify for taint check */
- if (PL_tainted)
+ if (PL_tainted) {
+ some_arg_tainted = 1;
break;
+ }
}
MARK = ORIGMARK;
/* XXX Remove warning at end of deprecation cycle --RD 2002-02 */
if (SP - MARK == 1) {
TAINT_PROPER("system");
}
- else if (ckWARN2(WARN_TAINT, WARN_DEPRECATED)) {
+ else if (some_arg_tainted && ckWARN2(WARN_TAINT, WARN_DEPRECATED)) {
Perl_warner(aTHX_ packWARN2(WARN_TAINT, WARN_DEPRECATED),
"Use of tainted arguments in %s is deprecated", "system");
}
@@ -4175,18 +4178,21 @@ PP(pp_exec)
STRLEN n_a;
if (PL_tainting) {
+ int some_arg_tainted = 0;
TAINT_ENV();
while (++MARK <= SP) {
(void)SvPV_nolen(*MARK); /* stringify for taint check */
- if (PL_tainted)
+ if (PL_tainted) {
+ some_arg_tainted = 1;
break;
+ }
}
MARK = ORIGMARK;
/* XXX Remove warning at end of deprecation cycle --RD 2002-02 */
if (SP - MARK == 1) {
TAINT_PROPER("exec");
}
- else if (ckWARN2(WARN_TAINT, WARN_DEPRECATED)) {
+ else if (some_arg_tainted && ckWARN2(WARN_TAINT, WARN_DEPRECATED)) {
Perl_warner(aTHX_ packWARN2(WARN_TAINT, WARN_DEPRECATED),
"Use of tainted arguments in %s is deprecated", "exec");
}