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

« back to all changes in this revision

Viewing changes to src/bin/trampoline-python

  • Committer: drtomc
  • Date: 2007-12-19 00:00:09 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:84
Add some auth fu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
def runscript(uid, jail, cwd, script):
59
59
    if uid == 0:
60
60
        sys.exit(sys.argv[0] + ": cannot run scripts as root!\n")
61
 
    if not jail.startswith("/home/mgiuca/playground"):
62
 
        sys.exit(sys.argv[0] + ": invalid jail location!\n")
 
61
    # os.chroot(os.path.join(<<base-directory-for-jails>>, jail))
63
62
    os.chroot(jail)
64
63
    os.chdir(cwd)
65
64
    os.setuid(uid)
66
 
    # throttle()
 
65
    throttle()
67
66
    m = compile(file(script,'r').read(), script, 'exec')
68
67
    g = {}
69
68
    g['__builtins__'] = globals()['__builtins__']
73
72
    #eval(m)
74
73
    sys.exit(0)
75
74
 
76
 
runscript(int(sys.argv[1]), sys.argv[2], sys.argv[3], sys.argv[4])
 
75
runscript(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])