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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: William Grant
  • Date: 2009-02-25 07:58:26 UTC
  • Revision ID: grantw@unimelb.edu.au-20090225075826-bnl57xa84zk3zwjn
ivle.makeuser.make_jail() no longer uses os.walk() to recursively set
permissions. That caused it to trip over some UTF-8 filenames.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
        # Change the ownership of all the files to the right unixid
224
224
        logging.debug("chown %s's home directory files to uid %d"
225
225
            %(user.login, user.unixid))
226
 
        os.chown(userhomedir, user.unixid, user.unixid)
227
 
        for root, dirs, files in os.walk(userhomedir):
228
 
            for fsobj in dirs + files:
229
 
                os.chown(os.path.join(root, fsobj), user.unixid, user.unixid)
 
226
        os.spawnvp(os.P_WAIT, 'chown', ['chown', '-R', '%d:%d' % (user.unixid,
 
227
                                        user.unixid), userhomedir])
230
228
    else:
231
229
        # No user jail exists
232
230
        # Set up the user's home directory