in reply to Re: File::Find untaint in taint-mode under Win32
in thread File::Find untaint in taint-mode under Win32

Yeah, and if you had read the code, you wouldn't have posted a useless comment.

Anyway, the problem is that the default untaint_pattern is set to qr|^([-+@\w./]+)$| and the cwd on windows most likely contains :, like in C:/some/path.

So, you have to fix the untaint pattern using something like: untaint_pattern => qr|^([-+@\w./]+)$|

Replies are listed 'Best First'.
Re^3: File::Find untaint in taint-mode under Win32
by jmcnamara (Monsignor) on May 09, 2011 at 12:17 UTC
    In the context of your answer the untaint_pattern should probably be:
    untaint_pattern => qr|^([-+@\w./:]+)$|
    Or to allow for Windows style directory separators as well (is that necessary?) something like:
    untaint_pattern => qr|^([-+@\w./:\\]+)$|
    Anyone see any omissions or gotchas here for Windows or other platforms?

    --
    John.

      I don't understand the purpose, why not /(.*)/ ?
        I don't know.

        A similar regex is used on Mac OS according to the docs:

        The default untaint_pattern ... on Mac OS is set to qr|^(.+)$|

        --
        John.