summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-06-27 08:15:11 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-06-27 08:15:11 +0000
commitaf419de789419c9e4520d33654a91564094b407a (patch)
treec62f4e0ce756cd82c32c69553c5d894d058aad07 /perl.c
parenta06433151b0f1a3a12ccc4d2629feb511ea9fce6 (diff)
downloadperl-af419de789419c9e4520d33654a91564094b407a.tar.gz
Introduce (global) variable PL_earlytaint which
is set very early in main(), before perl_parse() has been called and PL_tainting (or PL_taint_warn) might have been set. p4raw-id: //depot/perl@19863
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/perl.c b/perl.c
index b6231a480b..f40aaa56e5 100644
--- a/perl.c
+++ b/perl.c
@@ -154,7 +154,6 @@ perl_construct(pTHXx)
if (PL_perl_destruct_level > 0)
init_interp();
#endif
-
/* Init the real globals (and main thread)? */
if (!PL_linestr) {
#ifdef PERL_FLEXIBLE_EXCEPTIONS
@@ -3329,24 +3328,25 @@ S_init_ids(pTHX)
/* This is used very early in the lifetime of the program,
* before even the options are parsed, so PL_tainting has
- * not been initialized properly.*/
-int
+ * not been initialized properly. The variable PL_earlytaint
+ * is set early in main() to the result of this function. */
+bool
Perl_doing_taint(int argc, char *argv[], char *envp[])
{
- int uid = PerlProc_getuid();
+ int uid = PerlProc_getuid();
int euid = PerlProc_geteuid();
- int gid = PerlProc_getgid();
+ int gid = PerlProc_getgid();
int egid = PerlProc_getegid();
#ifdef VMS
- uid |= gid << 16;
+ uid |= gid << 16;
euid |= egid << 16;
#endif
if (uid && (euid != uid || egid != gid))
return 1;
- /* This is a really primitive check; $ENV{PERL_MALLOC_OPT} is
- ignored only if -T are the first chars together; otherwise one
- gets "Too late" message. */
+ /* This is a really primitive check; environment gets ignored only
+ * if -T are the first chars together; otherwise one gets
+ * "Too late" message. */
if ( argc > 1 && argv[1][0] == '-'
&& (argv[1][1] == 't' || argv[1][1] == 'T') )
return 1;