X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserver_main.c;h=ea03a202caf2dc8d28383f9cd15cfb8cfd2d1960;hb=e739cb7572012e2a0a9b820757f4e2adf7b37a63;hp=cfb7ce64f0a4bbde9b7fc92c2bf6e9d15bf1d033;hpb=60617b628daa3da5c4d8343d7623e70666ff4a3e;p=citadel.git diff --git a/citadel/server_main.c b/citadel/server_main.c index cfb7ce64f..ea03a202c 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -249,18 +249,21 @@ int main(int argc, char **argv) */ master_startup(); + /* + * Run any upgrade entry points + */ + CtdlLogPrintf(CTDL_INFO, "Upgrading modules.\n"); + upgrade_modules(); -/* - * Initialise the user 0 to have a name. It would be nice to do it in InitializeMasterCC - * since it is contained within the MasterCC but we can't because the DB isn't available - * at that time so we do it seperate. +/** + * Load the user for the masterCC or create them if they don't exist */ - /** Give user 0 a name and create them if necessary */ - if (getuser(&masterCC.user, "Citadel")) + if (getuser(&masterCC.user, "SYS_Citadel")) { - getuserbynumber(&masterCC.user, 0); - strcpy (masterCC.user.fullname, "Citadel"); + /** User doesn't exist. We can't use create user here as the user number needs to be 0 */ + strcpy (masterCC.user.fullname, "SYS_Citadel") ; putuser(&masterCC.user); + getuser(&masterCC.user, "SYS_Citadel"); /** Just to be safe */ } /* @@ -284,11 +287,6 @@ int main(int argc, char **argv) CitadelServiceTCP); - /* - * Run any upgrade entry points - */ - CtdlLogPrintf(CTDL_INFO, "Upgrading modules.\n"); - upgrade_modules(); /*