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 4c6775d8f0d6ce63d2460749a0e9d83198554f75..843f050a60aed520b6b7f46e21bbb2d1f836d7f5 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 94ba60de5ae4ea528232e6edcd66ea9ccc1cc770..7faa9e52b0f9e5d191a52b5c35c8f2ffc1b15368 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 9d8b4a8ba7cae46aab6c3e0e558941a0ee3e0e2a..eb42548bfdfebddfd273cef3df13faec74097d5b 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 a9c1b6481521b626bb113f4873fb0338710999b1..5a27eec51920b2a33a8c55b7b85eebd9f5cbd4df 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 c0ddb356669726b8f0b1adce5e8b3ba88fc56441..29e6f3cbbcc16b089c4cec79e8c4f5ba504ad8c9 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 0e68f3b161966a8478ed3308f3b3654f4ef957b3..bc471dc1af349b9c28e51296b44038f66a5e985b 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 f3624bdc451e8891b0e02ccf430ca2dd64f14196..fe77e6ba00803447e32d6bcf5f00cb4a7791251e 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 21c0636d0afde3781938327a2db56e1bb5e51604..625498d8bf41c13e064173fb4677ba083a340f44 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 b26175f6a165667c897196e639b5f06b3e387549..186ea22f2cfdfc5443ce92c4ec22ea6d80a7deff 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 4757d092591f8499f8e615d5eb495c5927f33689..ad7058a0b76b43fb911146d88ee7e1ad85c6af3c 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 bda5ae80fc54b20bd22b1d55476644fe91bf36be..4d6c981ba8c73dbbf3d8824a12dd319eaebe1d7d 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 d48253326a83bce0b6a266672738f2b095ce3fbd..cc75463b41229632fa4fad9c6b2b292f9b7d94d9 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 11cdc6f784993f3496f6aab9cd940582b3038830..54410d05bd676d5ea45690226a5bda1cd318b4aa 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 */