#include "support.h"
#include "config.h"
#include "control.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
#include "database.h"
#include "room_ops.h"
#include "user_ops.h"
}
+/*
+ * Back end processing function for convert_bbsuid_to_minusone()
+ */
+void cbtm_backend(struct usersupp *usbuf, void *data) {
+ static struct UserProcList *uplist = NULL;
+ struct UserProcList *ptr;
+ struct usersupp us;
+
+ /* Lazy programming here. Call this function as a ForEachUser backend
+ * in order to queue up the room names, or call it with a null user
+ * to make it do the processing.
+ */
+ if (usbuf != NULL) {
+ ptr = (struct UserProcList *)
+ mallok(sizeof (struct UserProcList));
+ if (ptr == NULL) return;
+
+ safestrncpy(ptr->user, usbuf->fullname, sizeof ptr->user);
+ ptr->next = uplist;
+ uplist = ptr;
+ return;
+ }
+
+ while (uplist != NULL) {
+
+ if (lgetuser(&us, uplist->user) == 0) {
+ lprintf(9, "Processing <%s>...\n", uplist->user);
+ if (us.uid == BBSUID) {
+ us.uid = (-1);
+ }
+ lputuser(&us);
+ }
+
+ ptr = uplist;
+ uplist = uplist->next;
+ phree(ptr);
+ }
+}
+
+/*
+ * quick fix to change all BBSUID users to (-1)
+ */
+void convert_bbsuid_to_minusone(void) {
+ lprintf(5, "Applying uid changes\n");
+ ForEachUser(cbtm_backend, NULL);
+ cbtm_backend(NULL, NULL);
+ return;
+}
+
+
+/*
+ * This field was originally used for something else, so when we upgrade
+ * we have to initialize it to 0 in case there was trash in that space.
+ */
+void initialize_c_rfc822_strict_from(void) {
+ get_config();
+ config.c_rfc822_strict_from = 0;
+ put_config();
+}
if (CitControl.version < 555) do_pre555_usersupp_upgrade();
if (CitControl.version < 591) bump_mailbox_generation_numbers();
+ if (CitControl.version < 606) initialize_c_rfc822_strict_from();
+ if (CitControl.version < 608) convert_bbsuid_to_minusone();
CitControl.version = REV_LEVEL;
put_control();
-char *Dynamic_Module_Init(void)
+char *serv_upgrade_init(void)
{
check_server_upgrades();
return "$Id$";