Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 58 lines (51 sloc) 1.224 kB
a0d0e21 perl 5.000
Larry Wall authored
1 /*
2 * "...we will have peace, when you and all your works have perished--and
3 * the works of your dark master to whom you would deliver us. You are a
4 * liar, Saruman, and a corrupter of men's hearts." --Theoden
5 */
6
463ee0b perl 5.0 alpha 4
Larry Wall authored
7 #include "EXTERN.h"
8 #include "perl.h"
9
10 void
7907280 perl 5.0 alpha 2
Larry Wall authored
11 taint_proper(f, s)
12 char *f;
13 char *s;
14 {
bbce6d6 [inseparable changes from patch from perl5.003_08 to perl5.003_09]
Perl 5 Porters authored
15 char *ug;
16
17 if (tainted) {
18 DEBUG_u(PerlIO_printf(PerlIO_stderr(),
19 "%s %d %d %d\n", s, tainted, uid, euid));
20 if (euid != uid)
21 ug = " while running setuid";
22 else if (egid != gid)
23 ug = " while running setgid";
24 else
25 ug = " while running with -T switch";
26 if (!unsafe)
27 croak(f, s, ug);
28 else if (dowarn)
29 warn(f, s, ug);
7907280 perl 5.0 alpha 2
Larry Wall authored
30 }
31 }
32
33 void
34 taint_env()
35 {
36 SV** svp;
bbce6d6 [inseparable changes from patch from perl5.003_08 to perl5.003_09]
Perl 5 Porters authored
37 MAGIC *mg = 0;
7907280 perl 5.0 alpha 2
Larry Wall authored
38
bbce6d6 [inseparable changes from patch from perl5.003_08 to perl5.003_09]
Perl 5 Porters authored
39 svp = hv_fetch(GvHVn(envgv),"PATH",4,FALSE);
40 if (!svp || *svp == &sv_undef ||
41 ((mg = mg_find(*svp, 't')) && mg->mg_len & 1))
42 {
43 TAINT;
44 if (mg && MgTAINTEDDIR(mg))
45 taint_proper("Insecure directory in %s%s", "$ENV{PATH}");
46 else
47 taint_proper("Insecure %s%s", "$ENV{PATH}");
7907280 perl 5.0 alpha 2
Larry Wall authored
48 }
49
bbce6d6 [inseparable changes from patch from perl5.003_08 to perl5.003_09]
Perl 5 Porters authored
50 svp = hv_fetch(GvHVn(envgv),"IFS",3,FALSE);
51 if (svp && *svp != &sv_undef &&
52 (mg = mg_find(*svp, 't')) && mg->mg_len & 1)
53 {
54 TAINT;
55 taint_proper("Insecure %s%s", "$ENV{IFS}");
56 }
57 }
Something went wrong with that request. Please try again.