[tpm] normalizing filespec paths/directories?

Fulko Hew fulko.hew at gmail.com
Wed Jul 15 07:43:54 PDT 2009


OK, my next query for a code/module recommendation is:

'What is the best/easiest way to normalize a directory from what
 someone may have provided into something thats potentially real.'

Ie. eliminate '../' scenarios.

For example, something that translates the following (and all other
nasties)...

If our home directory is '/home/myaccount',
and someone provides '../../etc/passwd'
whats the easiest way to figure out that the real path will
end up being '/etc/passwd' ?

TIA
Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20090715/3d424a76/attachment.html>


More information about the toronto-pm mailing list