diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-29 09:28:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-29 09:28:58 +0000 |
commit | 1199dd43248b0956628341f2a63939a8378c8016 (patch) | |
tree | 57ca33b5b1f2b53e78bef1deb208fbccb0860308 | |
parent | 24130e51d52fd22992dd62e432895a9115f3a585 (diff) | |
download | perl-1199dd43248b0956628341f2a63939a8378c8016.tar.gz |
Move the PL_earlytaint initialization to the PERL_SYS_INIT()
as per suggestion from Sarathy.
p4raw-id: //depot/perl@19878
-rw-r--r-- | dosish.h | 8 | ||||
-rw-r--r-- | epoc/epocish.h | 2 | ||||
-rw-r--r-- | miniperlmain.c | 3 | ||||
-rw-r--r-- | mpeix/mpeixish.h | 2 | ||||
-rw-r--r-- | os2/os2ish.h | 4 | ||||
-rw-r--r-- | perl.h | 17 | ||||
-rw-r--r-- | plan9/plan9ish.h | 2 | ||||
-rw-r--r-- | unixish.h | 2 | ||||
-rw-r--r-- | vms/vmsish.h | 2 |
9 files changed, 30 insertions, 12 deletions
@@ -16,7 +16,7 @@ #ifdef DJGPP # define BIT_BUCKET "nul" # define OP_BINARY O_BINARY -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v) +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v) # define init_os_extras Perl_init_os_extras # include <signal.h> # define HAS_UTIME @@ -29,15 +29,15 @@ # define PERL_FS_VER_FMT "%d_%d_%d" #else /* DJGPP */ # ifdef WIN32 -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v) +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v) # define PERL_SYS_TERM() Perl_win32_term() # define BIT_BUCKET "nul" # else # ifdef NETWARE -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v) +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v) # define BIT_BUCKET "nwnul" # else -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) # define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */ # endif /* NETWARE */ # endif diff --git a/epoc/epocish.h b/epoc/epocish.h index a971a8e6c7..f7d38443d8 100644 --- a/epoc/epocish.h +++ b/epoc/epocish.h @@ -108,7 +108,7 @@ /* epocemx setenv bug workaround */ #ifndef PERL_SYS_INIT -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) putenv(".dummy=foo"); putenv(".dummy"); MALLOC_INIT +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) putenv(".dummy=foo"); putenv(".dummy"); MALLOC_INIT #endif #ifndef PERL_SYS_TERM diff --git a/miniperlmain.c b/miniperlmain.c index ec9604eae6..4e9e5e889e 100644 --- a/miniperlmain.c +++ b/miniperlmain.c @@ -56,9 +56,6 @@ main(int argc, char **argv, char **env) /* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */ PERL_GPROF_MONCONTROL(0); - /* To be used instead PL_taining before perl_parse() */ - PL_earlytaint = doing_taint(argc, argv, env); - PERL_SYS_INIT3(&argc,&argv,&env); #if defined(USE_ITHREADS) diff --git a/mpeix/mpeixish.h b/mpeix/mpeixish.h index 92c588352d..2ed9faf332 100644 --- a/mpeix/mpeixish.h +++ b/mpeix/mpeixish.h @@ -113,7 +113,7 @@ #define Mkdir(path,mode) mkdir((path),(mode)) #ifndef PERL_SYS_INIT -# define PERL_SYS_INIT(c,v) PERL_FPU_INIT MALLOC_INIT +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) PERL_FPU_INIT MALLOC_INIT #endif #ifndef PERL_SYS_TERM diff --git a/os2/os2ish.h b/os2/os2ish.h index 225d271236..45e80b5208 100644 --- a/os2/os2ish.h +++ b/os2/os2ish.h @@ -218,6 +218,7 @@ void Perl_OS2_term(void **excH, int exitstatus, int flags); # define PERL_SYS_INIT3(argcp, argvp, envp) \ { void *xreg[2]; \ + EARLY_INIT3(argcp, argvp, envp) \ MALLOC_CHECK_TAINT(*argcp, *argvp, *envp) \ _response(argcp, argvp); \ _wildcard(argcp, argvp); \ @@ -225,6 +226,7 @@ void Perl_OS2_term(void **excH, int exitstatus, int flags); # define PERL_SYS_INIT(argcp, argvp) { \ { void *xreg[2]; \ + EARLY_INIT2(argcp, argvp) \ _response(argcp, argvp); \ _wildcard(argcp, argvp); \ Perl_OS2_init3(NULL, xreg, 0) @@ -233,9 +235,11 @@ void Perl_OS2_term(void **excH, int exitstatus, int flags); # define PERL_SYS_INIT3(argcp, argvp, envp) \ { void *xreg[2]; \ + EARLY_INIT3(argcp, argvp, envp) \ Perl_OS2_init3(*envp, xreg, 0) # define PERL_SYS_INIT(argcp, argvp) { \ { void *xreg[2]; \ + EARLY_INIT2(argcp, argvp) \ Perl_OS2_init3(NULL, xreg, 0) #endif @@ -1942,6 +1942,23 @@ typedef struct clone_params CLONE_PARAMS; # endif #endif +/* The PL_earlytaint is to be used instead PL_tainting before + * perl_parse() has had the chance to set up PL_tainting. */ + +#ifndef EARLY_INIT3 +# define EARLY_INIT3(argvp,argcp,envp) \ + STMT_START { \ + PL_earlytaint = doing_taint(argcp, argvp, envp); \ + } STMT_END; +#endif + +#ifndef EARLY_INIT2 +# define EARLY_INIT2(argvp,argcp) \ + STMT_START { \ + PL_earlytaint = doing_taint(argcp, argvp, 0); \ + } STMT_END; +#endif + #ifndef PERL_SYS_INIT3 # define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp) #endif diff --git a/plan9/plan9ish.h b/plan9/plan9ish.h index 5c922cf0ba..dd32f69f5a 100644 --- a/plan9/plan9ish.h +++ b/plan9/plan9ish.h @@ -106,7 +106,7 @@ #define ABORT() kill(PerlProc_getpid(),SIGABRT); #define BIT_BUCKET "/dev/null" -#define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) MALLOC_INIT +#define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) MALLOC_INIT #define dXSUB_SYS #define PERL_SYS_TERM() MALLOC_TERM @@ -129,7 +129,7 @@ #define Mkdir(path,mode) mkdir((path),(mode)) #ifndef PERL_SYS_INIT -# define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT MALLOC_INIT +# define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT MALLOC_INIT #endif #ifndef PERL_SYS_TERM diff --git a/vms/vmsish.h b/vms/vmsish.h index 076a6967f6..1ab2df09e0 100644 --- a/vms/vmsish.h +++ b/vms/vmsish.h @@ -331,7 +331,7 @@ struct interp_intern { #endif #define BIT_BUCKET "_NLA0:" -#define PERL_SYS_INIT(c,v) MALLOC_CHECK_TAINT2(*c,*v) vms_image_init((c),(v)); MALLOC_INIT +#define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) MALLOC_CHECK_TAINT2(*c,*v) vms_image_init((c),(v)); MALLOC_INIT #define PERL_SYS_TERM() OP_REFCNT_TERM; MALLOC_TERM #define dXSUB_SYS #define HAS_KILL |