summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-04-18 10:10:41 -0600
committerKarl Williamson <khw@cpan.org>2019-05-24 17:09:30 -0600
commitbc2f1ca15922645b3e432d3a3ef7142fe6baedbb (patch)
tree05c6daba222497ada027aae89ddcdb5e0b874580 /perl.h
parent6aba5c5eec25a6294e01899eb55a31bf5b889900 (diff)
downloadperl-bc2f1ca15922645b3e432d3a3ef7142fe6baedbb.tar.gz
Add some comments around tainting
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/perl.h b/perl.h
index e5a55850f1..a4d8ab656a 100644
--- a/perl.h
+++ b/perl.h
@@ -623,16 +623,24 @@
# define TAINT_WARN_get 0
# define TAINT_WARN_set(s) NOOP
#else
+ /* Set to tainted if we are running under tainting mode */
# define TAINT (PL_tainted = PL_tainting)
-# define TAINT_NOT (PL_tainted = FALSE)
-# define TAINT_IF(c) if (UNLIKELY(c)) { PL_tainted = PL_tainting; }
+
+# define TAINT_NOT (PL_tainted = FALSE) /* Untaint */
+# define TAINT_IF(c) if (UNLIKELY(c)) { TAINT; } /* Conditionally taint */
# define TAINT_ENV() if (UNLIKELY(PL_tainting)) { taint_env(); }
-# define TAINT_PROPER(s) if (UNLIKELY(PL_tainting)) { taint_proper(NULL, s); }
+ /* croak or warn if tainting */
+# define TAINT_PROPER(s) if (UNLIKELY(PL_tainting)) { \
+ taint_proper(NULL, s); \
+ }
# define TAINT_set(s) (PL_tainted = (s))
# define TAINT_get (PL_tainted)
-# define TAINTING_get (PL_tainting)
+# define TAINTING_get (PL_tainting) /* Is taint checking enabled? */
# define TAINTING_set(s) (PL_tainting = (s))
-# define TAINT_WARN_get (PL_taint_warn)
+# define TAINT_WARN_get (PL_taint_warn) /* FALSE => tainting violations
+ are fatal
+ TRUE => they're just
+ warnings */
# define TAINT_WARN_set(s) (PL_taint_warn = (s))
#endif