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

« back to all changes in this revision

Viewing changes to www/common/jail.py

  • Committer: mattgiuca
  • Date: 2008-02-01 07:46:26 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:375
www/common/makeuser.py:
    Now accepts a large number of arguments for all the fields of the user.
    (password, full name, nick name, student id, role)
    Creates a new user in the DB.
    Creates a Unix account for the user on the current machine. (This will
    need to change to create one on the central machine to be propagated).
makeuser script: Accepts all the arguments as above and passes them along to
    www/common/makeuser.py.

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
 
    if os.getuid() != <<www-uid>>>:
8
 
        raise Exception, 'I will not setup a root jail! Go away!'
9
 
 
10
 
    # FIXME - config this
11
 
    os.chroot(os.path.join('<<jail_base>>', jail))
12
 
    os.chdir(cwd)
13
 
    os.setuid(uid)
14