~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to src/common/jail.py

  • Committer: William Grant
  • Date: 2012-06-28 01:52:02 UTC
  • Revision ID: me@williamgrant.id.au-20120628015202-f6ru7o367gt6nvgz
Hah

Show diffs side-by-side

added added

removed removed

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