logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: maint @ 19893: msg#00075

Subject: Re: maint @ 19893
Jarkko Hietaniemi <jhi@xxxxxx> writes:
>       http://www.iki.fi/jhi/perl@xxxxxxxxx
>       http://www.iki.fi/jhi/perl@xxxxxxxxx
>
>(or rsync -avz ftp.linux.activestate.com::perl-5.8.x perl-5.8.x)
>
>(This just in after I already rolled the tarballs: Win32ers may
> need to add dTHX; at the top of the Perl_doing_taint() in perl.c)

Which will get it to compile but it won't run.

Win32 perl starts thus:

EXTERN_C DllExport int
RunPerl(int argc, char **argv, char **env)
{
...
    PERL_SYS_INIT(&argc,&argv);

    if (!(my_perl = perl_alloc()))
        return (1);
    perl_construct(my_perl);
...


dosish.h:#    define PERL_SYS_INIT(c,v) EARLY_INIT2(*c,*v) 
MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v)

#ifndef EARLY_INIT2
#  define EARLY_INIT2(argcp,argvp) \
        STMT_START {            \
                PL_earlytaint = doing_taint(argcp, argvp, 0); \
        } STMT_END;
#endif


And 

Perl_doing_taint(int argc, char *argv[], char *envp[])
{
    dTHX;  // even if added
    int uid  = PerlProc_getuid();

}

Which is redirected via interpreter's "host".

So Win32 cannot call getuid() until it has an interpreter to contain a host 
to point at function to call. 

Adding the dTHX just gets a nice segfault when the NULL is de-refed.

HOWEVER as:

uid_t
getuid(void)
{
    return ROOT_UID;
}

uid_t
geteuid(void)
{
    return ROOT_UID;
}

and groups likewise (win32.c)


A fix is probably 

bool
Perl_doing_taint(int argc, char *argv[], char *envp[])
{
#ifdef WIN32
   return 0;
#else
...
#endif
}

My  guess is netware is probably similar.

So it might be easier to initialze PL_earlytaint = 0 
and not add the EARLY_INIT2() stuff to platforms which don't 
(really) "do" uid/gid.


-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>