serv_upgrade.c now has pre- and post- startup sections. The import of email addresse...
authorArt Cancro <ajc@citadel.org>
Tue, 26 Dec 2017 20:01:48 +0000 (15:01 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 26 Dec 2017 20:01:48 +0000 (15:01 -0500)
13 files changed:
citadel/citadel.h
citadel/configure.ac
citadel/debian/changelog
citadel/internet_addressing.c
citadel/modules/inetcfg/serv_inetcfg.c
citadel/modules/upgrade/serv_upgrade.c
citadel/modules/vcard/serv_vcard.c
libcitadel/configure.in
libcitadel/debian/changelog
libcitadel/lib/libcitadel.h
webcit/configure.ac
webcit/debian/changelog
webcit/webcit.h

index 4c6775d..843f050 100644 (file)
@@ -45,10 +45,10 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      913             // This version
+#define REV_LEVEL      914             // This version
 #define REV_MIN                591             // Oldest compatible database
 #define EXPORT_REV_MIN 760             // Oldest compatible export files
-#define LIBCITADEL_MIN 903             // Minimum required version of libcitadel
+#define LIBCITADEL_MIN 914             // Minimum required version of libcitadel
 
 #define SERVER_TYPE 0                  // zero for stock Citadel; other developers please
                                        // obtain SERVER_TYPE codes for your implementations
index 94ba60d..7faa9e5 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [912], [http://www.citadel.org/])
+AC_INIT([Citadel], [914], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_CONFIG_HEADER(sysdep.h)
index 9d8b4a8..eb42548 100644 (file)
@@ -1,3 +1,9 @@
+citadel (9.14-1) stable; urgency=low
+
+  * new release
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Wed, 26 Dec 2017 12:56:30 -0400
+
 citadel (9.01-1) stable; urgency=low
 
   * new release
index a9c1b64..5a27eec 100644 (file)
@@ -285,6 +285,7 @@ int CtdlHostAlias(char *fqdn) {
        char host[256], type[256];
        int found = 0;
 
+       syslog(LOG_DEBUG, "EVQ: CtdlHostAlias(%s)", fqdn);
        if (fqdn == NULL)                                       return(hostalias_nomatch);
        if (IsEmptyStr(fqdn))                                   return(hostalias_nomatch);
        if (!strcasecmp(fqdn, "localhost"))                     return(hostalias_localhost);
@@ -293,6 +294,7 @@ int CtdlHostAlias(char *fqdn) {
        if (inetcfg == NULL)                                    return(hostalias_nomatch);
 
        config_lines = num_tokens(inetcfg, '\n');
+       syslog(LOG_DEBUG, "EVQ: inetcfg config_lines is %d", config_lines);
        for (i=0; i<config_lines; ++i) {
                extract_token(buf, inetcfg, i, '\n', sizeof buf);
                extract_token(host, buf, 0, '|', sizeof host);
index c0ddb35..29e6f3c 100644 (file)
@@ -125,6 +125,7 @@ void inetcfg_init_backend(long msgnum, void *userdata) {
 
 
 void inetcfg_init(void) {
+       syslog(LOG_DEBUG, "EVQ: called inetcfg_init()");
        if (CtdlGetRoom(&CC->room, SYSCONFIGROOM) != 0) {
                return;
        }
index 0e68f3b..bc471dc 100644 (file)
@@ -142,10 +142,6 @@ void reindex_uids_backend(struct ctdluser *usbuf, void *data) {
                        }
                        CtdlPutUserLock(&us);
                        if ((us.uid > 0) && (us.uid != NATIVE_AUTH_UID)) {              // if non-native auth , index by uid
-
-                               syslog(LOG_DEBUG, "\033[31m attaching %d to %s \033[0m", us.uid , us.fullname);
-
-
                                StrBuf *claimed_id = NewStrBuf();
                                StrBufPrintf(claimed_id, "uid:%d", us.uid);
                                attach_extauth(&us, claimed_id);
@@ -159,6 +155,7 @@ void reindex_uids_backend(struct ctdluser *usbuf, void *data) {
        }
 }
 
+
 /*
  * Build extauth index of all users with uid-based join (system auth, LDAP auth)
  * Also changes all users with a uid of CTDLUID to NATIVE_AUTH_UID (-1)
@@ -171,7 +168,6 @@ void reindex_uids(void) {
 }
 
 
-
 /*
  * These accounts may have been created by code that ran between mid 2008 and early 2011.
  * If present they are no longer in use and may be deleted.
@@ -528,14 +524,14 @@ void move_inet_addrs_from_vcards_to_user_records(void)
  * Based on the server version number reported by the existing database,
  * run in-place data format upgrades until everything is up to date.
  */
-void check_server_upgrades(void) {
+void pre_startup_upgrades(void) {
 
        oldver = CtdlGetConfigInt("MM_hosted_upgrade_level");
        syslog(LOG_INFO, "Existing database version on disk is %d", oldver);
        update_config();
 
        if (oldver < REV_LEVEL) {
-               syslog(LOG_WARNING, "Server hosted updates need to be processed at this time.  Please wait...");
+               syslog(LOG_WARNING, "Running pre-startup database upgrades.");
        }
        else {
                return;
@@ -572,10 +568,6 @@ void check_server_upgrades(void) {
                ingest_old_roominfo_and_roompic_files();
        }
 
-       if ((oldver > 000) && (oldver < 912)) {
-               move_inet_addrs_from_vcards_to_user_records();
-       }
-
        CtdlSetConfigInt("MM_hosted_upgrade_level", REV_LEVEL);
 
        /*
@@ -596,10 +588,42 @@ void check_server_upgrades(void) {
 }
 
 
+/*
+ * Based on the server version number reported by the existing database,
+ * run in-place data format upgrades until everything is up to date.
+ */
+void post_startup_upgrades(void) {
+
+       syslog(LOG_INFO, "Existing database version on disk is %d", oldver);
+
+       if (oldver < REV_LEVEL) {
+               syslog(LOG_WARNING, "Running post-startup database upgrades.");
+       }
+       else {
+               return;
+       }
+
+       if ((oldver > 000) && (oldver < 912)) {
+               move_inet_addrs_from_vcards_to_user_records();
+       }
+}
+
+
 CTDL_MODULE_UPGRADE(upgrade)
 {
-       check_server_upgrades();
+       pre_startup_upgrades();
        
        /* return our module id for the Log */
        return "upgrade";
 }
+
+CTDL_MODULE_INIT(upgrade)
+{
+       if(!threading)
+       {
+               post_startup_upgrades();
+       }
+       
+       /* return our module name for the log */
+        return "upgrade";
+}
index f3624bd..fe77e6b 100644 (file)
@@ -99,8 +99,7 @@ void vcard_extract_internet_addresses(struct CtdlMessage *msg, int (*callback)(c
 
        if (CM_IsEmpty(msg, eAuthor)) return;
        if (CM_IsEmpty(msg, eNodeName)) return;
-       snprintf(citadel_address, sizeof citadel_address, "%s @ %s",
-               msg->cm_fields[eAuthor], msg->cm_fields[eNodeName]);
+       snprintf(citadel_address, sizeof citadel_address, "%s @ %s", msg->cm_fields[eAuthor], msg->cm_fields[eNodeName]);
 
        v = vcard_load(msg->cm_fields[eMesageText]);
        if (v == NULL) return;
@@ -142,8 +141,8 @@ void vcard_extract_internet_addresses(struct CtdlMessage *msg, int (*callback)(c
 void extract_inet_email_addrs(char *emailaddrbuf, size_t emailaddrbuf_len,
                              char *secemailaddrbuf, size_t secemailaddrbuf_len,
                              struct vCard *v,
-                             int local_addrs_only)
-{
+                             int local_addrs_only
+{
        struct CitContext *CCC = CC;            /* put this on the stack, just for speed */
        char *s, *k, *addr;
        int instance = 0;
@@ -159,6 +158,9 @@ void extract_inet_email_addrs(char *emailaddrbuf, size_t emailaddrbuf_len,
                        striplt(addr);
                        if (!IsEmptyStr(addr)) {
                                IsDirectoryAddress = IsDirectory(addr, 1);
+
+                               syslog(LOG_DEBUG, "EVQ: addr=<%s> IsDirectoryAddress=<%d> local_addrs_only=<%d>", addr, IsDirectoryAddress, local_addrs_only);
+
                                if ( IsDirectoryAddress || !local_addrs_only)
                                {
                                        ++saved_instance;
@@ -801,7 +803,6 @@ void vcard_newuser(struct ctdluser *usbuf) {
 
 syslog(LOG_DEBUG, "\033[31m FIXME BORK BORK BORK try lookup by uid , or maybe dn?\033[0m");
 
-
                found_user = CtdlTryUserLDAP(usbuf->fullname, ldap_dn, sizeof ldap_dn, ldap_cn, sizeof ldap_cn, &usbuf->uid);
                if (found_user == 0) {
                        if (Ctdl_LDAP_to_vCard(ldap_dn, v)) {
@@ -1413,7 +1414,6 @@ CTDL_MODULE_INIT(vcard)
                CtdlRegisterSessionHook(vcard_session_login_hook, EVT_LOGIN, PRIO_LOGIN + 70);
                CtdlRegisterMessageHook(vcard_upload_beforesave, EVT_BEFORESAVE);
                CtdlRegisterMessageHook(vcard_upload_aftersave, EVT_AFTERSAVE);
-               CtdlRegisterDeleteHook(vcard_delete_remove);
                CtdlRegisterProtoHook(cmd_regi, "REGI", "Enter registration info");
                CtdlRegisterProtoHook(cmd_greg, "GREG", "Get registration info");
                CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
@@ -1422,7 +1422,10 @@ CTDL_MODULE_INIT(vcard)
                CtdlRegisterProtoHook(cmd_dvca, "DVCA", "Dump VCard Addresses");
                CtdlRegisterUserHook(vcard_newuser, EVT_NEWUSER);
                CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);
-               CtdlRegisterNetprocHook(vcard_extract_from_network);
+
+               CtdlRegisterDeleteHook(vcard_delete_remove);                    // FIXME this is obsolete, right?
+               CtdlRegisterNetprocHook(vcard_extract_from_network);            // FIXME this is obsolete, right?
+
                CtdlRegisterSessionHook(store_harvested_addresses, EVT_TIMER, PRIO_CLEANUP + 470);
                CtdlRegisterFixedOutputHook("text/x-vcard", vcard_fixed_output);
                CtdlRegisterFixedOutputHook("text/vcard", vcard_fixed_output);
@@ -1435,32 +1438,6 @@ CTDL_MODULE_INIT(vcard)
                        qr.QRep.expire_mode = EXPIRE_MANUAL;
                        qr.QRdefaultview = VIEW_ADDRESSBOOK;    /* 2 = address book view */
                        CtdlPutRoomLock(&qr);
-
-                       /*
-                        * Also make sure it has a netconfig file, so the networker runs
-                        * on this room even if we don't share it with any other nodes.
-                        * This allows the CANCEL messages (i.e. "Purge this vCard") to be
-                        * purged.
-                        *
-                        * FIXME this no longer works
-                        *
-                        */
-                       //assoc_file_name(filename, sizeof filename, &qr, ctdl_netcfg_dir);
-                       //fp = fopen(filename, "a");
-                       //if (fp != NULL) {
-                               //fclose(fp);
-                               //rv = chown(filename, CTDLUID, (-1));
-                               //if (rv == -1) {
-                                       //syslog(LOG_ERR, "vcard: failed to adjust ownership of %s: %m", filename);
-                               //}
-                               //rv = chmod(filename, 0600);
-                               //if (rv == -1) {
-                                       //syslog(LOG_ERR, "vcard: failed to adjust ownership of %s: %m", filename);
-                               //}
-                       //}
-                       //else {
-                               //syslog(LOG_ERR, "vcard: cannot create %s: %m", filename);
-                       //}
                }
 
                /* for postfix tcpdict */
index 21c0636..625498d 100755 (executable)
@@ -5,7 +5,7 @@ dnl
 dnl Ensure that libcitadel is configured with autoconf 2.52 or newer
 AC_PREREQ(2.52)
 
-AC_INIT(libcitadel, 904, http://uncensored.citadel.org)
+AC_INIT(libcitadel, 914, http://uncensored.citadel.org)
 
 AC_CONFIG_SRCDIR(Makefile.in)
 AC_CONFIG_AUX_DIR(conftools)
@@ -20,7 +20,7 @@ dnl Set LIBAGE to 0.
 dnl
 
 LIBCURRENT=4
-LIBREVISION=904
+LIBREVISION=914
 LIBAGE=0
 
 sinclude(conftools/libtool.m4)
index b26175f..186ea22 100644 (file)
@@ -1,3 +1,9 @@
+libcitadel (9.14-1) stable; urgency=low
+
+  * new release
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Wed, 26 Dec 2017 12:56:30 -0400
+
 libcitadel (9.01-1) stable; urgency=low
 
   * new release
index 4757d09..ad7058a 100644 (file)
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#define LIBCITADEL_VERSION_NUMBER      904
+#define LIBCITADEL_VERSION_NUMBER      914
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
index bda5ae8..4d6c981 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
-AC_INIT([WebCit], [912], [http://www.citadel.org/])
+AC_INIT([WebCit], [914], [http://www.citadel.org/])
 
 
 AC_SUBST(PROG_SUBDIRS)
index d482533..cc75463 100644 (file)
@@ -1,8 +1,8 @@
-webcit (9.01-1) stable; urgency=low
+webcit (9.14-1) stable; urgency=low
 
   * new release
 
- -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Wed, 01 Apr 2015 12:56:30 -0400
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Wed, 26 Dec 2017 12:56:30 -0400
 
 webcit (8.29-1) stable; urgency=low
 
index 11cdc6f..54410d0 100644 (file)
@@ -127,9 +127,9 @@ extern char *ssl_cipher_list;
 #define PORT_NUM               2000            /* port number to listen on */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         912             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    912             /* Minimum required version of Citadel server */
-#define        LIBCITADEL_MIN          903             /* Minimum required version of libcitadel */
+#define CLIENT_VERSION         914             /* This version of WebCit */
+#define MINIMUM_CIT_VERSION    914             /* Minimum required version of Citadel server */
+#define        LIBCITADEL_MIN          914             /* Minimum required version of libcitadel */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define TARGET                 "webcit01"      /* Window target for inline URL's */