[FRPythoneers] chroot()

Theodore A. Roth troth at verinet.com
Wed Sep 5 15:42:32 MDT 2001


I've searched high low, but it doesn't look to me like python supplies the
chroot() function ala 'man 2 chroot'. Is this true?

I'm trying to use python, via cgi, as a photo album generator. I want to
let the user supply the directory to list the contents of, but I would
like to protect against the user doing something like
'../../../../../some/dir// to list files outside of where the pictures are
kept. Thus, chroot()ing into my base photo directory after loading all the
modules I need would be a handy thing to do.

Any one have a better idea?

Ted Roth




More information about the FRPythoneers mailing list