1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import os def setup(uid, jail, cwd): if uid == 0: raise Exception, 'I will not setup a root jail! Go away!' if os.getuid() != <<www-uid>>>: raise Exception, 'I will not setup a root jail! Go away!' # FIXME - config this os.chroot(os.path.join('<<jail_base>>', jail)) os.chdir(cwd) os.setuid(uid) |