48
48
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))
51
store = ivle.database.get_store()
54
users = store.find(ivle.database.User).order_by(ivle.database.User.login)
56
if len(arguments) == 0:
57
print >> sys.stderr, "must be run with -a or a username"
59
users = [ivle.database.User.get_by_login(store, arguments[0])]
68
61
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)
65
ivle.makeuser.make_jail(user)
83
66
except Exception, message:
84
67
logging.warning(str(message))
87
logging.debug("recreated user %s's jail." % login)
70
logging.debug("recreated user %s's jail." % user.login)
89
72
logging.info("rebuild completed successfully")