X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=taint.c;h=88ca8a5a48d0fa00e5ba3a4df4d9d8030812340d;hb=3280af22f58e7b37514ed104858e2c2fc55ceeeb;hp=3ce09423d8da2b2822fff76f85f32845d0223eab;hpb=ef6361f9c2260919aefcc17b1b80f8857c67a84a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/taint.c b/taint.c index 3ce0942..88ca8a5 100644 --- a/taint.c +++ b/taint.c @@ -14,18 +14,18 @@ taint_proper(const char *f, char *s) char *ug; DEBUG_u(PerlIO_printf(Perl_debug_log, - "%s %d %d %d\n", s, tainted, uid, euid)); + "%s %d %d %d\n", s, PL_tainted, PL_uid, PL_euid)); - if (tainted) { - if (euid != uid) + if (PL_tainted) { + if (PL_euid != PL_uid) ug = " while running setuid"; - else if (egid != gid) + else if (PL_egid != PL_gid) ug = " while running setgid"; else ug = " while running with -T switch"; - if (!unsafe) + if (!PL_unsafe) croak(f, s, ug); - else if (dowarn) + else if (PL_dowarn) warn(f, s, ug); } } @@ -68,7 +68,7 @@ taint_env(void) } #endif /* VMS */ - svp = hv_fetch(GvHVn(envgv),"PATH",4,FALSE); + svp = hv_fetch(GvHVn(PL_envgv),"PATH",4,FALSE); if (svp && *svp) { if (SvTAINTED(*svp)) { dTHR; @@ -84,13 +84,13 @@ taint_env(void) #ifndef VMS /* tainted $TERM is okay if it contains no metachars */ - svp = hv_fetch(GvHVn(envgv),"TERM",4,FALSE); + svp = hv_fetch(GvHVn(PL_envgv),"TERM",4,FALSE); if (svp && *svp && SvTAINTED(*svp)) { dTHR; /* just for taint */ - bool was_tainted = tainted; - char *t = SvPV(*svp, na); - char *e = t + na; - tainted = was_tainted; + bool was_tainted = PL_tainted; + char *t = SvPV(*svp, PL_na); + char *e = t + PL_na; + PL_tainted = was_tainted; if (t < e && isALNUM(*t)) t++; while (t < e && (isALNUM(*t) || *t == '-' || *t == ':')) @@ -103,8 +103,8 @@ taint_env(void) #endif /* !VMS */ for (e = misc_env; *e; e++) { - svp = hv_fetch(GvHVn(envgv), *e, strlen(*e), FALSE); - if (svp && *svp != &sv_undef && SvTAINTED(*svp)) { + svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE); + if (svp && *svp != &PL_sv_undef && SvTAINTED(*svp)) { dTHR; /* just for taint */ TAINT; taint_proper("Insecure $ENV{%s}%s", *e);