summaryrefslogtreecommitdiff
path: root/taint.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-06-23 21:04:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-23 18:53:04 +0000
commit8772537cf6d022a54f738ccb84b65a7f21ccf1b2 (patch)
treea17781729c582f324a835278656c8f20a0ce1bfd /taint.c
parent5b35fc8b5884b43fcc53d952f9dc9ad629b742f1 (diff)
downloadperl-8772537cf6d022a54f738ccb84b65a7f21ccf1b2.tar.gz
Pre-YAPC consting fun
Message-ID: <20050623190423.GA13835@petdance.com> p4raw-id: //depot/perl@24965
Diffstat (limited to 'taint.c')
-rw-r--r--taint.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/taint.c b/taint.c
index 6acad15980..e0869a9bad 100644
--- a/taint.c
+++ b/taint.c
@@ -24,24 +24,22 @@
void
Perl_taint_proper(pTHX_ const char *f, const char *s)
{
- const char *ug;
-
#if defined(HAS_SETEUID) && defined(DEBUGGING)
# if Uid_t_size == 1
{
- UV uid = PL_uid;
- UV euid = PL_euid;
+ const UV uid = PL_uid;
+ const UV euid = PL_euid;
- DEBUG_u(PerlIO_printf(Perl_debug_log,
+ DEBUG_u(PerlIO_printf(Perl_debug_log,
"%s %d %"UVuf" %"UVuf"\n",
s, PL_tainted, uid, euid));
}
# else
{
- IV uid = PL_uid;
- IV euid = PL_euid;
+ const IV uid = PL_uid;
+ const IV euid = PL_euid;
- DEBUG_u(PerlIO_printf(Perl_debug_log,
+ DEBUG_u(PerlIO_printf(Perl_debug_log,
"%s %d %"IVdf" %"IVdf"\n",
s, PL_tainted, uid, euid));
}
@@ -49,6 +47,8 @@ Perl_taint_proper(pTHX_ const char *f, const char *s)
#endif
if (PL_tainted) {
+ const char *ug;
+
if (!f)
f = PL_no_security;
if (PL_euid != PL_uid)
@@ -91,7 +91,7 @@ Perl_taint_env(pTHX)
if (!GvHV(PL_envgv) || !(SvRMAGICAL(GvHV(PL_envgv))
&& mg_find((SV*)GvHV(PL_envgv), PERL_MAGIC_env))) {
const bool was_tainted = PL_tainted;
- const char *name = GvENAME(PL_envgv);
+ const char * const name = GvENAME(PL_envgv);
PL_tainted = TRUE;
if (strEQ(name,"ENV"))
/* hash alias */
@@ -146,7 +146,7 @@ Perl_taint_env(pTHX)
STRLEN len;
const bool was_tainted = PL_tainted;
const char *t = SvPV_const(*svp, len);
- const char *e = t + len;
+ const char * const e = t + len;
PL_tainted = was_tainted;
if (t < e && isALNUM(*t))
t++;
@@ -160,7 +160,7 @@ Perl_taint_env(pTHX)
#endif /* !VMS */
for (e = misc_env; *e; e++) {
- svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
+ SV ** const svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
if (svp && *svp != &PL_sv_undef && SvTAINTED(*svp)) {
TAINT;
taint_proper("Insecure $ENV{%s}%s", *e);