48
50
os.path.basename(sys.argv[0])
56
if len(arguments) == 0:
57
print >> sys.stderr, "must be run with -a or a username"
59
list = [db.get_user(arguments[0])]
60
res = db.get_all('login', ['login', 'unixid'])
62
return (flds['login'], flds['unixid'])
63
uids = dict(map(repack,res))
64
except Exception, message:
65
logging.error(str(message))
53
config = ivle.config.Config()
54
store = ivle.database.get_store(config)
57
users = store.find(ivle.database.User).order_by(ivle.database.User.login)
59
if len(arguments) == 0:
60
print >> sys.stderr, "must be run with -a or a username"
62
users = [ivle.database.User.get_by_login(store, arguments[0])]
68
64
logging.info("rebuild started")
70
list.sort(key=lambda user: user.login)
75
# Resolve the user's login into a UID
79
raise Exception("user %s does not have a unixid in the database"
81
# Remake the user's jail
82
ivle.makeuser.make_jail(login, uid)
68
ivle.makeuser.make_jail(user, config)
83
69
except Exception, message:
84
logging.warning(str(message))
70
logging.error("Failed to recreate jail for %s.\n%s" %
71
(user.login, traceback.format_exc()))
87
logging.debug("recreated user %s's jail." % login)
74
logging.debug("recreated user %s's jail." % user.login)
89
76
logging.info("rebuild completed successfully")