summaryrefslogtreecommitdiff
path: root/taint.c
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-12-13 14:27:08 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-14 14:43:40 +0000
commit6537fe72dd6d63cc0c7164fec44beb82d2568599 (patch)
tree32c01336d785c38d130126526438bf4951f89791 /taint.c
parenta58d912c5262ef3032191d4aea207683577527bb (diff)
downloadperl-6537fe72dd6d63cc0c7164fec44beb82d2568599.tar.gz
-t taint warnings
Message-ID: <20011214002707.GA10532@blackrider> (reword the perlrun -t description a bit, and move the Itaint_warn to the bottom of the intrpvar.h for binary compatibility) p4raw-id: //depot/perl@13684
Diffstat (limited to 'taint.c')
-rw-r--r--taint.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/taint.c b/taint.c
index 1ce27e324f..9bf00bcf07 100644
--- a/taint.c
+++ b/taint.c
@@ -25,12 +25,17 @@ Perl_taint_proper(pTHX_ const char *f, const char *s)
ug = " while running setuid";
else if (PL_egid != PL_gid)
ug = " while running setgid";
- else
+ else if (PL_taint_warn)
+ ug = " while running with -t switch";
+ else
ug = " while running with -T switch";
- if (!PL_unsafe)
- Perl_croak(aTHX_ f, s, ug);
- else if (ckWARN(WARN_TAINT))
- Perl_warner(aTHX_ WARN_TAINT, f, s, ug);
+ if (PL_unsafe || PL_taint_warn) {
+ if(ckWARN(WARN_TAINT))
+ Perl_warner(aTHX_ WARN_TAINT, f, s, ug);
+ }
+ else {
+ Perl_croak(aTHX_ f, s, ug);
+ }
}
}