style cleanup
authorArt Cancro <ajc@citadel.org>
Sat, 4 Mar 2017 05:26:45 +0000 (00:26 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 4 Mar 2017 05:26:45 +0000 (00:26 -0500)
13 files changed:
citadel/context.c
citadel/database.c
citadel/event_client.c
citadel/internet_addressing.c
citadel/modules/ctdlproto/serv_ctdlproto.c
citadel/modules/ctdlproto/serv_file.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtpqueue.c
citadel/modules/smtp/smtp_util.c
citadel/msgbase.c
citadel/nttlist.c
citadel/serv_extensions.c
citadel/user_ops.c

index 576e9359c7da3cc9efeea5b6f6644d8e740f174f..82ab97b43ce99da4808b162bc7cd29983ef6199e 100644 (file)
@@ -102,7 +102,7 @@ int CtdlTerminateOtherSession (int session_num)
 
        aide = ( (CCC->user.axlevel >= AxAideU) || (CCC->internal_pgm) ) ;
 
-       CONM_syslog(LOG_DEBUG, "Locating session to kill\n");
+       syslog(LOG_DEBUG, "Locating session to kill\n");
        begin_critical_section(S_SESSION_TABLE);
        for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
                if (session_num == ccptr->cs_pid) {
@@ -259,9 +259,9 @@ void terminate_idle_sessions(void)
        }
        end_critical_section(S_SESSION_TABLE);
        if (killed > 0)
-               CON_syslog(LOG_INFO, "Scheduled %d idle sessions for termination\n", killed);
+               syslog(LOG_INFO, "Scheduled %d idle sessions for termination\n", killed);
        if (longrunners > 0)
-               CON_syslog(LOG_INFO, "Didn't terminate %d protected idle sessions", longrunners);
+               syslog(LOG_INFO, "Didn't terminate %d protected idle sessions", longrunners);
 }
 
 
@@ -278,10 +278,10 @@ void terminate_all_sessions(void)
                if (ccptr->client_socket != -1)
                {
                        if (ccptr->IO != NULL) {
-                               CON_syslog(LOG_INFO, "terminate_all_sessions() is murdering %s IO[%ld]CC[%d]", ccptr->curr_user, ccptr->IO->ID, ccptr->cs_pid);
+                               syslog(LOG_INFO, "terminate_all_sessions() is murdering %s IO[%ld]CC[%d]", ccptr->curr_user, ccptr->IO->ID, ccptr->cs_pid);
                        }
                        else {
-                               CON_syslog(LOG_INFO, "terminate_all_sessions() is murdering %s CC[%d]", ccptr->curr_user, ccptr->cs_pid);
+                               syslog(LOG_INFO, "terminate_all_sessions() is murdering %s CC[%d]", ccptr->curr_user, ccptr->cs_pid);
                        }
                        close(ccptr->client_socket);
                        ccptr->client_socket = -1;
@@ -290,7 +290,7 @@ void terminate_all_sessions(void)
        }
        end_critical_section(S_SESSION_TABLE);
        if (killed > 0) {
-               CON_syslog(LOG_INFO, "Flushed %d stuck sessions\n", killed);
+               syslog(LOG_INFO, "Flushed %d stuck sessions\n", killed);
        }
 }
 
@@ -303,14 +303,14 @@ void RemoveContext (CitContext *con)
 {
        const char *c;
        if (con == NULL) {
-               CONM_syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!");
+               syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!");
                return;
        }
        c = con->ServiceName;
        if (c == NULL) {
                c = "WTF?";
        }
-       CON_syslog(LOG_DEBUG, "RemoveContext(%s) session %d", c, con->cs_pid);
+       syslog(LOG_DEBUG, "RemoveContext(%s) session %d", c, con->cs_pid);
 ///    cit_backtrace();
 
        /* Run any cleanup routines registered by loadable modules.
@@ -323,7 +323,7 @@ void RemoveContext (CitContext *con)
        client_close();                         /* If the client is still connected, blow 'em away. */
        become_session(NULL);
 
-       CON_syslog(LOG_NOTICE, "[%3d]SRV[%s] Session ended.", con->cs_pid, c);
+       syslog(LOG_NOTICE, "[%3d]SRV[%s] Session ended.", con->cs_pid, c);
 
        /* 
         * If the client is still connected, blow 'em away. 
@@ -331,7 +331,7 @@ void RemoveContext (CitContext *con)
         */
        if (con->client_socket > 0)
        {
-               CON_syslog(LOG_NOTICE, "Closing socket %d", con->client_socket);
+               syslog(LOG_NOTICE, "Closing socket %d", con->client_socket);
                close(con->client_socket);
        }
 
@@ -347,7 +347,7 @@ void RemoveContext (CitContext *con)
                free(con->cached_msglist);
        }
 
-       CONM_syslog(LOG_DEBUG, "Done with RemoveContext()");
+       syslog(LOG_DEBUG, "Done with RemoveContext()");
 }
 
 
@@ -363,7 +363,7 @@ CitContext *CreateNewContext(void) {
 
        me = (CitContext *) malloc(sizeof(CitContext));
        if (me == NULL) {
-               CONM_syslog(LOG_ALERT, "citserver: can't allocate memory!!\n");
+               syslog(LOG_ALERT, "citserver: can't allocate memory!!\n");
                return NULL;
        }
        memset(me, 0, sizeof(CitContext));
@@ -412,7 +412,7 @@ CitContext *CloneContext(CitContext *CloneMe) {
 
        me = (CitContext *) malloc(sizeof(CitContext));
        if (me == NULL) {
-               CONM_syslog(LOG_ALERT, "citserver: can't allocate memory!!\n");
+               syslog(LOG_ALERT, "citserver: can't allocate memory!!\n");
                return NULL;
        }
        memcpy(me, CloneMe, sizeof(CitContext));
@@ -612,7 +612,7 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        if (context->user.usernum == 0)
        {       /* old system user with number 0, upgrade it */
                context->user.usernum = get_new_user_number();
-               CON_syslog(LOG_INFO, "Upgrading system user \"%s\" from user number 0 to user number %ld\n", context->user.fullname, context->user.usernum);
+               syslog(LOG_INFO, "Upgrading system user \"%s\" from user number 0 to user number %ld\n", context->user.fullname, context->user.usernum);
                /* add user to the database */
                CtdlPutUser(&(context->user));
                cdb_store(CDB_USERSBYNUMBER, &(context->user.usernum), sizeof(long), context->user.fullname, strlen(context->user.fullname)+1);
@@ -646,7 +646,7 @@ void context_cleanup(void)
                rem = ptr->next;
                --num_sessions;
 
-               CON_syslog(LOG_DEBUG, "context_cleanup(): purging session %d\n", ptr->cs_pid);
+               syslog(LOG_DEBUG, "context_cleanup(): purging session %d\n", ptr->cs_pid);
                RemoveContext(ptr);
                free (ptr);
                ptr = rem;
@@ -706,7 +706,7 @@ void dead_session_purge(int force) {
         * is allocated privately on this thread's stack.
         */
        while (rem != NULL) {
-               CON_syslog(LOG_DEBUG, "dead_session_purge(): purging session %d, reason=%d\n", rem->cs_pid, rem->kill_me);
+               syslog(LOG_DEBUG, "dead_session_purge(): purging session %d, reason=%d\n", rem->cs_pid, rem->kill_me);
                RemoveContext(rem);
                ptr = rem;
                rem = rem->next;
@@ -737,7 +737,7 @@ void InitializeMasterCC(void) {
  */
 void set_async_waiting(struct CitContext *ccptr)
 {
-       CON_syslog(LOG_DEBUG, "Setting async_waiting flag for session %d\n", ccptr->cs_pid);
+       syslog(LOG_DEBUG, "Setting async_waiting flag for session %d\n", ccptr->cs_pid);
        if (ccptr->is_async) {
                ccptr->async_waiting++;
                if (ccptr->state == CON_IDLE) {
index 977814d424127e395068136e1e4d4c68181900a5..aec4a61f6f0806edba3766977cbca0dcc5aa77b7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This is a data store backend for the Citadel server which uses Berkeley DB.
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License version 3.
@@ -213,7 +213,7 @@ void cdb_checkpoint(void)
 {
        int ret;
 
-       MARKM_syslog(LOG_DEBUG, "-- db checkpoint --");
+       syslog(LOG_DEBUG, "-- db checkpoint --");
        ret = dbenv->txn_checkpoint(dbenv, MAX_CHECKPOINT_KBYTES, MAX_CHECKPOINT_MINUTES, 0);
 
        if (ret != 0) {
@@ -873,18 +873,6 @@ void cdb_trunc(int cdb)
 
 int SeentDebugEnabled = 0;
 
-#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (SeentDebugEnabled != 0))
-#define SEENM_syslog(LEVEL, FORMAT)                                    \
-       DBGLOG(LEVEL) syslog(LEVEL,                                     \
-                            "%s[%ld]CC[%ld] SEEN[%s][%d] " FORMAT,     \
-                            IOSTR, ioid, ccid, Facility, cType)
-
-#define SEEN_syslog(LEVEL, FORMAT, ...)                                        \
-       DBGLOG(LEVEL) syslog(LEVEL,                                     \
-                            "%s[%ld]CC[%ld] SEEN[%s][%d] " FORMAT,     \
-                            IOSTR, ioid, ccid, Facility, cType,        \
-                            __VA_ARGS__)
-
 time_t CheckIfAlreadySeen(const char *Facility,
                          StrBuf *guid,
                          time_t now,
@@ -899,7 +887,7 @@ time_t CheckIfAlreadySeen(const char *Facility,
 
        if (cType != eWrite)
        {
-               SEEN_syslog(LOG_DEBUG, "Loading [%s]", ChrPtr(guid));
+               syslog(LOG_DEBUG, "Loading [%s]", ChrPtr(guid));
                cdbut = cdb_fetch(CDB_USETABLE, SKEY(guid));
                if ((cdbut != NULL) && (cdbut->ptr != NULL)) {
                        memcpy(&ut, cdbut->ptr,
@@ -909,13 +897,13 @@ time_t CheckIfAlreadySeen(const char *Facility,
 
                        if (InDBTimeStamp < antiexpire)
                        {
-                               SEEN_syslog(LOG_DEBUG, "Found - Not expired %ld < %ld", InDBTimeStamp, antiexpire);
+                               syslog(LOG_DEBUG, "Found - Not expired %ld < %ld", InDBTimeStamp, antiexpire);
                                cdb_free(cdbut);
                                return InDBTimeStamp;
                        }
                        else
                        {
-                               SEEN_syslog(LOG_DEBUG, "Found - Expired. %ld >= %ld", InDBTimeStamp, antiexpire);
+                               syslog(LOG_DEBUG, "Found - Expired. %ld >= %ld", InDBTimeStamp, antiexpire);
                                cdb_free(cdbut);
                        }
                }
@@ -923,7 +911,7 @@ time_t CheckIfAlreadySeen(const char *Facility,
                {
                        if (cdbut) cdb_free(cdbut);
                        
-                       SEENM_syslog(LOG_DEBUG, "not Found");
+                       syslog(LOG_DEBUG, "not Found");
                        if (cType == eCheckUpdate)
                                return 0;
                }
@@ -935,13 +923,13 @@ time_t CheckIfAlreadySeen(const char *Facility,
        memcpy(ut.ut_msgid, SKEY(guid));
        ut.ut_timestamp = now;
 
-       SEENM_syslog(LOG_DEBUG, "Saving new Timestamp");
+       syslog(LOG_DEBUG, "Saving new Timestamp");
        /* rewrite the record anyway, to update the timestamp */
        cdb_store(CDB_USETABLE,
                  SKEY(guid),
                  &ut, sizeof(struct UseTable) );
 
-       SEENM_syslog(LOG_DEBUG, "Done Saving");
+       syslog(LOG_DEBUG, "Done Saving");
        return InDBTimeStamp;
 }
 
index 4ab63a4a292bbd1edb08e490b195698d75decddf..1d0fad5429915c8c4b13e9d341a562d7128bacd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -109,11 +109,11 @@ eNextState QueueAnDBOperation(AsyncIO *IO)
        {
                /* shutting down... */
                free(h);
-               EVM_syslog(LOG_DEBUG, "DBEVENT Q exiting.\n");
+               syslog(LOG_DEBUG, "DBEVENT Q exiting.\n");
                pthread_mutex_unlock(&DBEventQueueMutex);
                return eAbort;
        }
-       EVM_syslog(LOG_DEBUG, "DBEVENT Q\n");
+       syslog(LOG_DEBUG, "DBEVENT Q\n");
        i = ++evdb_count ;
        Put(DBInboundEventQueue, IKEY(i), h, NULL);
        pthread_mutex_unlock(&DBEventQueueMutex);
@@ -127,7 +127,7 @@ eNextState QueueAnDBOperation(AsyncIO *IO)
        ev_async_send (event_db, &DBAddJob);
        pthread_mutex_unlock(&DBEventExitQueueMutex);
 
-       EVQM_syslog(LOG_DEBUG, "DBEVENT Q Done.\n");
+       syslog(LOG_DEBUG, "DBEVENT Q Done.\n");
        return eDBQuery;
 }
 
@@ -144,7 +144,7 @@ void ShutDownDBCLient(AsyncIO *IO)
        become_session(Ctx);
 
        SetEVState(IO, eDBTerm);
-       EVM_syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
+       syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
        StopDBWatchers(IO);
 
        assert(IO->DBTerminate);
@@ -158,7 +158,7 @@ DB_PerformNext(struct ev_loop *loop, ev_idle *watcher, int revents)
 
        SetEVState(IO, eDBNext);
        SET_EV_TIME(IO, event_db);
-       EV_syslog(LOG_DEBUG, "%s()", __FUNCTION__);
+       syslog(LOG_DEBUG, "%s()", __FUNCTION__);
        become_session(IO->CitContext);
 
        ev_idle_stop(event_db, &IO->db_unwind_stack);
@@ -220,7 +220,7 @@ static void IO_abort_shutdown_callback(struct ev_loop *loop,
        AsyncIO *IO = watcher->data;
 
        SetEVState(IO, eIOAbort);
-       EV_syslog(LOG_DEBUG, "EVENT Q: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "EVENT Q: %s\n", __FUNCTION__);
        SET_EV_TIME(IO, event_base);
        assert(IO->ShutdownAbort);
        IO->ShutdownAbort(IO);
@@ -249,11 +249,11 @@ eNextState QueueAnEventContext(AsyncIO *IO)
        {
                free(h);
                /* shutting down... */
-               EVM_syslog(LOG_DEBUG, "EVENT Q exiting.\n");
+               syslog(LOG_DEBUG, "EVENT Q exiting.\n");
                pthread_mutex_unlock(&EventQueueMutex);
                return eAbort;
        }
-       EVM_syslog(LOG_DEBUG, "EVENT Q\n");
+       syslog(LOG_DEBUG, "EVENT Q\n");
        i = ++evbase_count;
        Put(InboundEventQueue, IKEY(i), h, NULL);
        pthread_mutex_unlock(&EventQueueMutex);
@@ -265,7 +265,7 @@ eNextState QueueAnEventContext(AsyncIO *IO)
        }
        ev_async_send (event_base, &AddJob);
        pthread_mutex_unlock(&EventExitQueueMutex);
-       EVM_syslog(LOG_DEBUG, "EVENT Q Done.\n");
+       syslog(LOG_DEBUG, "EVENT Q Done.\n");
        return eSendReply;
 }
 
@@ -305,12 +305,12 @@ eNextState QueueCurlContext(AsyncIO *IO)
        {
                /* shutting down... */
                free(h);
-               EVM_syslog(LOG_DEBUG, "EVENT Q exiting.\n");
+               syslog(LOG_DEBUG, "EVENT Q exiting.\n");
                pthread_mutex_unlock(&EventQueueMutex);
                return eAbort;
        }
 
-       EVM_syslog(LOG_DEBUG, "EVENT Q\n");
+       syslog(LOG_DEBUG, "EVENT Q\n");
        i = ++evbase_count;
        Put(InboundEventQueue, IKEY(i), h, NULL);
        pthread_mutex_unlock(&EventQueueMutex);
@@ -323,7 +323,7 @@ eNextState QueueCurlContext(AsyncIO *IO)
        ev_async_send (event_base, &AddJob);
        pthread_mutex_unlock(&EventExitQueueMutex);
 
-       EVM_syslog(LOG_DEBUG, "EVENT Q Done.\n");
+       syslog(LOG_DEBUG, "EVENT Q Done.\n");
        return eSendReply;
 }
 
@@ -357,7 +357,7 @@ void FreeAsyncIOContents(AsyncIO *IO)
 void DestructCAres(AsyncIO *IO);
 void StopClientWatchers(AsyncIO *IO, int CloseFD)
 {
-       EVM_syslog(LOG_DEBUG, "EVENT StopClientWatchers");
+       syslog(LOG_DEBUG, "EVENT StopClientWatchers");
        
        DestructCAres(IO);
 
@@ -379,7 +379,7 @@ void StopClientWatchers(AsyncIO *IO, int CloseFD)
 
 void StopCurlWatchers(AsyncIO *IO)
 {
-       EVM_syslog(LOG_DEBUG, "EVENT StopCurlWatchers \n");
+       syslog(LOG_DEBUG, "EVENT StopCurlWatchers \n");
 
        ev_timer_stop (event_base, &IO->rw_timeout);
        ev_timer_stop(event_base, &IO->conn_fail);
@@ -407,7 +407,7 @@ eNextState ShutDownCLient(AsyncIO *IO)
        SetEVState(IO, eExit);
        become_session(Ctx);
 
-       EVM_syslog(LOG_DEBUG, "EVENT Terminating \n");
+       syslog(LOG_DEBUG, "EVENT Terminating \n");
 
        StopClientWatchers(IO, 1);
 
@@ -673,7 +673,7 @@ IO_send_callback(struct ev_loop *loop, ev_io *watcher, int revents)
        else if (rc < 0) {
                if (errno != EAGAIN) {
                        StopClientWatchers(IO, 1);
-                       EV_syslog(LOG_DEBUG,
+                       syslog(LOG_DEBUG,
                                  "IO_send_callback(): Socket Invalid! [%d] [%s] [%d]\n",
                                  errno, strerror(errno), IO->SendBuf.fd);
                        StrBufPrintf(IO->ErrMsg,
@@ -814,7 +814,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents)
 
        SetEVState(IO, eIOConnNow);
        SET_EV_TIME(IO, event_base);
-        EVM_syslog(LOG_DEBUG, "connect() succeeded.\n");
+        syslog(LOG_DEBUG, "connect() succeeded.\n");
 
         ev_io_stop(loop, &IO->conn_event);
         ev_timer_stop(event_base, &IO->conn_fail);
@@ -827,7 +827,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents)
 
         if ((err == 0) && (so_err != 0))
         {
-                EV_syslog(LOG_DEBUG, "connect() failed [%d][%s]\n",
+                syslog(LOG_DEBUG, "connect() failed [%d][%s]\n",
                           so_err,
                           strerror(so_err));
                 IO_connfail_callback(loop, &IO->conn_fail, revents);
@@ -835,7 +835,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents)
         }
         else
         {
-                EVM_syslog(LOG_DEBUG, "connect() succeeded\n");
+                syslog(LOG_DEBUG, "connect() succeeded\n");
                 set_start_callback(loop, IO, revents);
         }
 }
@@ -915,7 +915,7 @@ IO_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents)
                if (errno != EAGAIN) {
                        // FD is gone. kick it. 
                        StopClientWatchers(IO, 1);
-                       EV_syslog(LOG_DEBUG,
+                       syslog(LOG_DEBUG,
                                  "IO_recv_callback(): Socket Invalid! [%d] [%s] [%d]\n",
                                  errno, strerror(errno), IO->SendBuf.fd);
                        StrBufPrintf(IO->ErrMsg,
@@ -934,7 +934,7 @@ IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents)
 
        SetEVState(IO, eCaresFinished);
        SET_EV_TIME(IO, event_base);
-       EV_syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__);
        become_session(IO->CitContext);
        assert(IO->DNS.Query->PostDNS);
        switch (IO->DNS.Query->PostDNS(IO))
@@ -989,7 +989,7 @@ eNextState EvConnectSock(AsyncIO *IO,
                        IPPROTO_TCP);
 
        if (IO->SendBuf.fd < 0) {
-               EV_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                          "EVENT: socket() failed: %s\n",
                          strerror(errno));
 
@@ -1001,7 +1001,7 @@ eNextState EvConnectSock(AsyncIO *IO,
        }
        fdflags = fcntl(IO->SendBuf.fd, F_GETFL);
        if (fdflags < 0) {
-               EV_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                          "EVENT: unable to get socket %d flags! %s \n",
                          IO->SendBuf.fd,
                          strerror(errno));
@@ -1015,7 +1015,7 @@ eNextState EvConnectSock(AsyncIO *IO,
        }
        fdflags = fdflags | O_NONBLOCK;
        if (fcntl(IO->SendBuf.fd, F_SETFL, fdflags) < 0) {
-               EV_syslog(
+               syslog(
                        LOG_ERR,
                        "EVENT: unable to set socket %d nonblocking flags! %s \n",
                        IO->SendBuf.fd,
@@ -1076,13 +1076,13 @@ eNextState EvConnectSock(AsyncIO *IO,
 
        if (rc >= 0){
                SetEVState(IO, eIOConnNow);
-               EV_syslog(LOG_DEBUG, "connect() = %d immediate success.\n", IO->SendBuf.fd);
+               syslog(LOG_DEBUG, "connect() = %d immediate success.\n", IO->SendBuf.fd);
                set_start_callback(event_base, IO, 0);
                return IO->NextState;
        }
        else if (errno == EINPROGRESS) {
                SetEVState(IO, eIOConnWait);
-               EV_syslog(LOG_DEBUG, "connect() = %d have to wait now.\n", IO->SendBuf.fd);
+               syslog(LOG_DEBUG, "connect() = %d have to wait now.\n", IO->SendBuf.fd);
 
                ev_io_init(&IO->conn_event,
                           IO_connestd_callback,
@@ -1102,7 +1102,7 @@ eNextState EvConnectSock(AsyncIO *IO,
                IO->conn_fail_immediate.data = IO;
                ev_idle_start(event_base, &IO->conn_fail_immediate);
 
-               EV_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                          "connect() = %d failed: %s\n",
                          IO->SendBuf.fd,
                          strerror(errno));
@@ -1176,7 +1176,7 @@ void InitIOStruct(AsyncIO *IO,
        IO->SendBuf.Buf   = NewStrBufPlain(NULL, 1024);
        IO->RecvBuf.Buf   = NewStrBufPlain(NULL, 1024);
        IO->IOBuf         = NewStrBuf();
-       EV_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                  "EVENT: Session lives at %p IO at %p \n",
                  Data, IO);
 
@@ -1220,7 +1220,7 @@ eNextState KillTerminate(AsyncIO *IO)
 {
        long id;
        KillOtherSessionContext *Ctx = (KillOtherSessionContext*)IO->Data;
-       EV_syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__);
        id = IO->ID;
        FreeAsyncIOContents(IO);
        memset(Ctx, 0, sizeof(KillOtherSessionContext));
@@ -1315,10 +1315,10 @@ void EV_backtrace(AsyncIO *IO)
        strings = backtrace_symbols(stack_frames, size);
        for (i = 0; i < size; i++) {
                if (strings != NULL) {
-                       EV_syslog(LOG_ALERT, " BT %s\n", strings[i]);
+                       syslog(LOG_ALERT, " BT %s\n", strings[i]);
                }
                else {
-                       EV_syslog(LOG_ALERT, " BT %p\n", stack_frames[i]);
+                       syslog(LOG_ALERT, " BT %p\n", stack_frames[i]);
                }
        }
        free(strings);
index d7473e8529687a8eac87868bd3714aecb9568327..c18f8b3643d28ad77ab794cf7d32915a2147bbe9 100644 (file)
@@ -2,7 +2,7 @@
  * This file contains functions which handle the mapping of Internet addresses
  * to users on the Citadel system.
  *
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -410,7 +410,6 @@ void remove_any_whitespace_to_the_left_or_right_of_at_symbol(char *name)
  */
 int alias(char *name)
 {                              /* process alias and routing info for mail */
-       struct CitContext *CCC = CC;
        FILE *fp;
        int a, i;
        char aaa[SIZ], bbb[SIZ];
@@ -460,7 +459,7 @@ int alias(char *name)
        }
 
        if (strcasecmp(original_name, name)) {
-               MSG_syslog(LOG_INFO, "%s is being forwarded to %s\n", original_name, name);
+               syslog(LOG_INFO, "%s is being forwarded to %s\n", original_name, name);
        }
 
        /* Change "user @ xxx" to "user" if xxx is an alias for this host */
@@ -468,7 +467,7 @@ int alias(char *name)
                if (name[a] == '@') {
                        if (CtdlHostAlias(&name[a+1]) == hostalias_localhost) {
                                name[a] = 0;
-                               MSG_syslog(LOG_INFO, "Changed to <%s>\n", name);
+                               syslog(LOG_INFO, "Changed to <%s>\n", name);
                                break;
                        }
                }
@@ -621,7 +620,7 @@ recptypes *validate_recipients(const char *supplied_recipients,
                striplt(this_recp);
                if (IsEmptyStr(this_recp))
                        break;
-               MSG_syslog(LOG_DEBUG, "Evaluating recipient #%d: %s\n", num_recps, this_recp);
+               syslog(LOG_DEBUG, "Evaluating recipient #%d: %s\n", num_recps, this_recp);
                ++num_recps;
 
                strcpy(org_recp, this_recp);
@@ -774,12 +773,12 @@ recptypes *validate_recipients(const char *supplied_recipients,
                strcpy(ret->errormsg, "No recipients specified.");
        }
 
-       MSGM_syslog(LOG_DEBUG, "validate_recipients()\n");
-       MSG_syslog(LOG_DEBUG, " local: %d <%s>\n", ret->num_local, ret->recp_local);
-       MSG_syslog(LOG_DEBUG, "  room: %d <%s>\n", ret->num_room, ret->recp_room);
-       MSG_syslog(LOG_DEBUG, "  inet: %d <%s>\n", ret->num_internet, ret->recp_internet);
-       MSG_syslog(LOG_DEBUG, " ignet: %d <%s>\n", ret->num_ignet, ret->recp_ignet);
-       MSG_syslog(LOG_DEBUG, " error: %d <%s>\n", ret->num_error, ret->errormsg);
+       syslog(LOG_DEBUG, "validate_recipients()\n");
+       syslog(LOG_DEBUG, " local: %d <%s>\n", ret->num_local, ret->recp_local);
+       syslog(LOG_DEBUG, "  room: %d <%s>\n", ret->num_room, ret->recp_room);
+       syslog(LOG_DEBUG, "  inet: %d <%s>\n", ret->num_internet, ret->recp_internet);
+       syslog(LOG_DEBUG, " ignet: %d <%s>\n", ret->num_ignet, ret->recp_ignet);
+       syslog(LOG_DEBUG, " error: %d <%s>\n", ret->num_error, ret->errormsg);
 
        free(recipients);
        return(ret);
@@ -796,8 +795,7 @@ void free_recipients(recptypes *valid) {
        }
 
        if (valid->recptypes_magic != RECPTYPES_MAGIC) {
-               struct CitContext *CCC = CC;
-               MSGM_syslog(LOG_EMERG, "Attempt to call free_recipients() on some other data type!\n");
+               syslog(LOG_EMERG, "Attempt to call free_recipients() on some other data type!\n");
                abort();
        }
 
@@ -817,7 +815,6 @@ void free_recipients(recptypes *valid) {
 
 char *qp_encode_email_addrs(char *source)
 {
-       struct CitContext *CCC = CC;
        char *user, *node, *name;
        const char headerStr[] = "=?UTF-8?Q?";
        char *Encoded;
@@ -836,8 +833,7 @@ char *qp_encode_email_addrs(char *source)
 
        if (source == NULL) return source;
        if (IsEmptyStr(source)) return source;
-       if (MessageDebugEnabled != 0) cit_backtrace();
-       MSG_syslog(LOG_DEBUG, "qp_encode_email_addrs: [%s]\n", source);
+       syslog(LOG_DEBUG, "qp_encode_email_addrs: [%s]\n", source);
 
        AddrPtr = malloc (sizeof (long) * nAddrPtrMax);
        AddrUtf8 = malloc (sizeof (long) * nAddrPtrMax);
@@ -1176,7 +1172,6 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
  * message text.
  */
 int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
-       struct CitContext *CCC = CC;
        char *key, *value, *valueend;
        long len;
        const char *pos;
@@ -1226,7 +1221,7 @@ int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
 
        else if (!strcasecmp(key, "From")) {
                process_rfc822_addr(value, user, node, name);
-               MSG_syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
+               syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
                snprintf(addr, sizeof(addr), "%s@%s", user, node);
                if (CM_IsEmpty(msg, eAuthor) && !IsEmptyStr(name))
                        CM_SetField(msg, eAuthor, name, strlen(name));
@@ -1531,7 +1526,6 @@ char *rfc822_fetch_field(const char *rfc822, const char *fieldname) {
 void directory_key(char *key, char *addr) {
        int i;
        int keylen = 0;
-       struct CitContext *CCC = CC;
 
        for (i=0; !IsEmptyStr(&addr[i]); ++i) {
                if (!isspace(addr[i])) {
@@ -1540,7 +1534,7 @@ void directory_key(char *key, char *addr) {
        }
        key[keylen++] = 0;
 
-       MSG_syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
+       syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
 }
 
 
@@ -1582,11 +1576,10 @@ void CtdlDirectoryInit(void) {
  */
 int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
        char key[SIZ];
-       struct CitContext *CCC = CC;
 
        if (IsDirectory(internet_addr, 0) == 0) 
                return 0;
-       MSG_syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
+       syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
        directory_key(key, internet_addr);
        cdb_store(CDB_DIRECTORY, key, strlen(key), citadel_addr, strlen(citadel_addr)+1 );
        return 1;
@@ -1601,9 +1594,8 @@ int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
  */
 int CtdlDirectoryDelUser(char *internet_addr, char *citadel_addr) {
        char key[SIZ];
-       struct CitContext *CCC = CC;
        
-       MSG_syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
+       syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
        directory_key(key, internet_addr);
        return cdb_delete(CDB_DIRECTORY, key, strlen(key) ) == 0;
 }
index 811fcb6dc96e6f1183b7c5c979ed3906500e5ae1..cf51e62c31f27abeeec2dedc9c17749ba879381c 100644 (file)
@@ -1,7 +1,7 @@
 /* 
- * Citadel protocoll main dispatcher
+ * Citadel protocol main dispatcher
  *
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -28,19 +28,19 @@ void do_command_loop(void) {
        time(&CCC->lastcmd);
        memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
        if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
-               CTDLM_syslog(LOG_INFO, "Citadel client disconnected: ending session.");
+               syslog(LOG_INFO, "Citadel client disconnected: ending session.");
                CCC->kill_me = KILLME_CLIENT_DISCONNECTED;
                return;
        }
 
        /* Log the server command, but don't show passwords... */
        if ( (strncasecmp(cmdbuf, "PASS", 4)) && (strncasecmp(cmdbuf, "SETP", 4)) ) {
-               CTDL_syslog(LOG_DEBUG, "[%s(%ld)] %s",
+               syslog(LOG_DEBUG, "[%s(%ld)] %s",
                        CCC->curr_user, CCC->user.usernum, cmdbuf
                );
        }
        else {
-               CTDL_syslog(LOG_DEBUG, "[%s(%ld)] <password command hidden from log>",
+               syslog(LOG_DEBUG, "[%s(%ld)] <password command hidden from log>",
                            CCC->curr_user, CCC->user.usernum
                );
        }
index 9ffb51b0500c945031b8d71629381b51861be7cd..0b5ebc0c152e8a10d4b2069c57902ab972c44747 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Server functions which handle file transfers and room directories.
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -35,14 +35,12 @@ void cmd_delf(char *filename)
                return;
 
        if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
-               cprintf("%d No directory in this room.\n",
-                       ERROR + NOT_HERE);
+               cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
                return;
        }
 
        if (IsEmptyStr(filename)) {
-               cprintf("%d You must specify a file name.\n",
-                       ERROR + FILE_NOT_FOUND);
+               cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
                return;
        }
        for (a = 0; !IsEmptyStr(&filename[a]); ++a) {
@@ -51,22 +49,20 @@ void cmd_delf(char *filename)
                }
        }
        snprintf(pathname, sizeof pathname,
-                        "%s/%s/%s",
-                        ctdl_file_dir,
-                        CC->room.QRdirname, filename);
+                "%s/%s/%s",
+                ctdl_file_dir,
+                CC->room.QRdirname, filename
+       );
        a = unlink(pathname);
        if (a == 0) {
                cprintf("%d File '%s' deleted.\n", CIT_OK, pathname);
        }
        else {
-               cprintf("%d File '%s' not found.\n",
-                       ERROR + FILE_NOT_FOUND, pathname);
+               cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname);
        }
 }
 
 
-
-
 /*
  * move a file from one room directory to another
  */
@@ -86,14 +82,12 @@ void cmd_movf(char *cmdbuf)
        if (CtdlAccessCheck(ac_room_aide)) return;
 
        if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
-               cprintf("%d No directory in this room.\n",
-                       ERROR + NOT_HERE);
+               cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
                return;
        }
 
        if (IsEmptyStr(filename)) {
-               cprintf("%d You must specify a file name.\n",
-                       ERROR + FILE_NOT_FOUND);
+               cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
                return;
        }
 
@@ -102,11 +96,9 @@ void cmd_movf(char *cmdbuf)
                        filename[a] = '_';
                }
        }
-       snprintf(pathname, sizeof pathname, "./files/%s/%s",
-                CC->room.QRdirname, filename);
+       snprintf(pathname, sizeof pathname, "./files/%s/%s", CC->room.QRdirname, filename);
        if (access(pathname, 0) != 0) {
-               cprintf("%d File '%s' not found.\n",
-                       ERROR + FILE_NOT_FOUND, pathname);
+               cprintf("%d File '%s' not found.\n", ERROR + FILE_NOT_FOUND, pathname);
                return;
        }
 
@@ -115,23 +107,18 @@ void cmd_movf(char *cmdbuf)
                return;
        }
        if ((qrbuf.QRflags & QR_DIRECTORY) == 0) {
-               cprintf("%d '%s' is not a directory room.\n",
-                       ERROR + NOT_HERE, qrbuf.QRname);
+               cprintf("%d '%s' is not a directory room.\n", ERROR + NOT_HERE, qrbuf.QRname);
                return;
        }
-       snprintf(newpath, sizeof newpath, "./files/%s/%s", qrbuf.QRdirname,
-                filename);
+       snprintf(newpath, sizeof newpath, "./files/%s/%s", qrbuf.QRdirname, filename);
        if (link(pathname, newpath) != 0) {
-               cprintf("%d Couldn't move file: %s\n", ERROR + INTERNAL_ERROR,
-                       strerror(errno));
+               cprintf("%d Couldn't move file: %s\n", ERROR + INTERNAL_ERROR, strerror(errno));
                return;
        }
        unlink(pathname);
 
        /* this is a crude method of copying the file description */
-       snprintf(buf, sizeof buf,
-                "cat ./files/%s/filedir |grep \"%s\" >>./files/%s/filedir",
-                CC->room.QRdirname, filename, qrbuf.QRdirname);
+       snprintf(buf, sizeof buf, "cat ./files/%s/filedir |grep \"%s\" >>./files/%s/filedir", CC->room.QRdirname, filename, qrbuf.QRdirname);
        system(buf);
        cprintf("%d File '%s' has been moved.\n", CIT_OK, filename);
 }
@@ -155,8 +142,7 @@ void OpenCmdResult(char *filename, const char *mime_type)
        filesize = (long) statbuf.st_size;
        modtime = (time_t) statbuf.st_mtime;
 
-       cprintf("%d %ld|%ld|%s|%s\n",
-               CIT_OK, filesize, (long)modtime, filename, mime_type);
+       cprintf("%d %ld|%ld|%s|%s\n", CIT_OK, filesize, (long)modtime, filename, mime_type);
 }
 
 
@@ -174,26 +160,22 @@ void cmd_open(char *cmdbuf)
        if (CtdlAccessCheck(ac_logged_in)) return;
 
        if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
-               cprintf("%d No directory in this room.\n",
-                       ERROR + NOT_HERE);
+               cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
                return;
        }
 
        if (IsEmptyStr(filename)) {
-               cprintf("%d You must specify a file name.\n",
-                       ERROR + FILE_NOT_FOUND);
+               cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
                return;
        }
        if (strstr(filename, "../") != NULL)
        {
-               cprintf("%d syntax error.\n",
-                       ERROR + ILLEGAL_VALUE);
+               cprintf("%d syntax error.\n", ERROR + ILLEGAL_VALUE);
                return;
        }
 
        if (CC->download_fp != NULL) {
-               cprintf("%d You already have a download file open.\n",
-                       ERROR + RESOURCE_BUSY);
+               cprintf("%d You already have a download file open.\n", ERROR + RESOURCE_BUSY);
                return;
        }
 
@@ -203,21 +185,18 @@ void cmd_open(char *cmdbuf)
                }
        }
 
-       snprintf(pathname, sizeof pathname,
-                        "%s/%s/%s",
-                        ctdl_file_dir,
-                        CC->room.QRdirname, filename);
+       snprintf(pathname, sizeof pathname, "%s/%s/%s", ctdl_file_dir, CC->room.QRdirname, filename);
        CC->download_fp = fopen(pathname, "r");
 
        if (CC->download_fp == NULL) {
-               cprintf("%d cannot open %s: %s\n",
-                       ERROR + INTERNAL_ERROR, pathname, strerror(errno));
+               cprintf("%d cannot open %s: %s\n", ERROR + INTERNAL_ERROR, pathname, strerror(errno));
                return;
        }
 
        OpenCmdResult(filename, "application/octet-stream");
 }
 
+
 /*
  * open an image file
  */
@@ -231,14 +210,12 @@ void cmd_oimg(char *cmdbuf)
        extract_token(filename, cmdbuf, 0, '|', sizeof filename);
 
        if (IsEmptyStr(filename)) {
-               cprintf("%d You must specify a file name.\n",
-                       ERROR + FILE_NOT_FOUND);
+               cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
                return;
        }
 
        if (CC->download_fp != NULL) {
-               cprintf("%d You already have a download file open.\n",
-                       ERROR + RESOURCE_BUSY);
+               cprintf("%d You already have a download file open.\n", ERROR + RESOURCE_BUSY);
                return;
        }
 
@@ -248,8 +225,7 @@ void cmd_oimg(char *cmdbuf)
                CC->download_fp = fopen(pathname, "rb");
        }
        if (CC->download_fp == NULL) {
-               cprintf("%d Cannot open %s: %s\n",
-                       ERROR + FILE_NOT_FOUND, pathname, strerror(errno));
+               cprintf("%d Cannot open %s: %s\n", ERROR + FILE_NOT_FOUND, pathname, strerror(errno));
                return;
        }
        rv = fread(&MimeTestBuf[0], 1, 32, CC->download_fp);
@@ -277,20 +253,17 @@ void cmd_uopn(char *cmdbuf)
        if (CtdlAccessCheck(ac_logged_in)) return;
 
        if ((CC->room.QRflags & QR_DIRECTORY) == 0) {
-               cprintf("%d No directory in this room.\n",
-                       ERROR + NOT_HERE);
+               cprintf("%d No directory in this room.\n", ERROR + NOT_HERE);
                return;
        }
 
        if (IsEmptyStr(CC->upl_file)) {
-               cprintf("%d You must specify a file name.\n",
-                       ERROR + FILE_NOT_FOUND);
+               cprintf("%d You must specify a file name.\n", ERROR + FILE_NOT_FOUND);
                return;
        }
 
        if (CC->upload_fp != NULL) {
-               cprintf("%d You already have a upload file open.\n",
-                       ERROR + RESOURCE_BUSY);
+               cprintf("%d You already have a upload file open.\n", ERROR + RESOURCE_BUSY);
                return;
        }
 
@@ -299,35 +272,26 @@ void cmd_uopn(char *cmdbuf)
                        CC->upl_file[a] = '_';
                }
        }
-       snprintf(CC->upl_path, sizeof CC->upl_path, 
-                        "%s/%s/%s",
-                        ctdl_file_dir,
-                        CC->room.QRdirname, CC->upl_file);
-       snprintf(CC->upl_filedir, sizeof CC->upl_filedir,
-                        "%s/%s/filedir", 
-                        ctdl_file_dir,
-                        CC->room.QRdirname);
+       snprintf(CC->upl_path, sizeof CC->upl_path, "%s/%s/%s", ctdl_file_dir, CC->room.QRdirname, CC->upl_file);
+       snprintf(CC->upl_filedir, sizeof CC->upl_filedir, "%s/%s/filedir", ctdl_file_dir, CC->room.QRdirname);
 
        CC->upload_fp = fopen(CC->upl_path, "r");
        if (CC->upload_fp != NULL) {
                fclose(CC->upload_fp);
                CC->upload_fp = NULL;
-               cprintf("%d '%s' already exists\n",
-                       ERROR + ALREADY_EXISTS, CC->upl_path);
+               cprintf("%d '%s' already exists\n", ERROR + ALREADY_EXISTS, CC->upl_path);
                return;
        }
 
        CC->upload_fp = fopen(CC->upl_path, "wb");
        if (CC->upload_fp == NULL) {
-               cprintf("%d Cannot open %s: %s\n",
-                       ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
+               cprintf("%d Cannot open %s: %s\n", ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
                return;
        }
        cprintf("%d Ok\n", CIT_OK);
 }
 
 
-
 /*
  * open an image file for uploading
  */
@@ -346,8 +310,7 @@ void cmd_uimg(char *cmdbuf)
        extract_token(CC->upl_mimetype, cmdbuf, 1, '|', sizeof CC->upl_mimetype);
        extract_token(basenm, cmdbuf, 2, '|', sizeof basenm);
        if (CC->upload_fp != NULL) {
-               cprintf("%d You already have an upload file open.\n",
-                       ERROR + RESOURCE_BUSY);
+               cprintf("%d You already have an upload file open.\n", ERROR + RESOURCE_BUSY);
                return;
        }
 
@@ -361,15 +324,11 @@ void cmd_uimg(char *cmdbuf)
        }
 
        if (CC->user.axlevel >= AxAideU) {
-               snprintf(CC->upl_path, sizeof CC->upl_path, 
-                                "%s/%s",
-                                ctdl_image_dir,
-                                basenm);
+               snprintf(CC->upl_path, sizeof CC->upl_path, "%s/%s", ctdl_image_dir, basenm);
        }
 
        if (IsEmptyStr(CC->upl_path)) {
-               cprintf("%d Higher access required.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
+               cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED);
                return;
        }
 
@@ -380,8 +339,7 @@ void cmd_uimg(char *cmdbuf)
 
        CC->upload_fp = fopen(CC->upl_path, "wb");
        if (CC->upload_fp == NULL) {
-               cprintf("%d Cannot open %s: %s\n",
-                       ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
+               cprintf("%d Cannot open %s: %s\n", ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
                return;
        }
        cprintf("%d Ok\n", CIT_OK);
@@ -397,8 +355,7 @@ void cmd_clos(char *cmdbuf)
        char buf[256];
 
        if (CC->download_fp == NULL) {
-               cprintf("%d You don't have a download file open.\n",
-                       ERROR + RESOURCE_NOT_OPEN);
+               cprintf("%d You don't have a download file open.\n", ERROR + RESOURCE_NOT_OPEN);
                return;
        }
 
@@ -407,10 +364,7 @@ void cmd_clos(char *cmdbuf)
 
        if (CC->dl_is_net == 1) {
                CC->dl_is_net = 0;
-               snprintf(buf, sizeof buf, 
-                                "%s/%s",
-                                ctdl_netout_dir,
-                                CC->net_node);
+               snprintf(buf, sizeof buf, "%s/%s", ctdl_netout_dir, CC->net_node);
                unlink(buf);
        }
 
@@ -431,7 +385,6 @@ void abort_upl(CitContext *who)
 }
 
 
-
 /*
  * close the upload file
  */
@@ -455,26 +408,17 @@ void cmd_ucls(char *cmd)
 
                if (CCC->upload_type == UPL_NET) {
                        char final_filename[PATH_MAX];
-                       snprintf(final_filename, sizeof final_filename,
-                               "%s/%s.%04lx.%04x",
-                               ctdl_netin_dir,
-                               CCC->net_node,
-                               (long)getpid(),
-                               ++seq
-                       );
+                       snprintf(final_filename, sizeof final_filename, "%s/%s.%04lx.%04x", ctdl_netin_dir, CCC->net_node, (long)getpid(), ++seq);
 
                        if (link(CCC->upl_path, final_filename) == 0) {
-                               CTDL_syslog(LOG_INFO, "UCLS: updoaded %s", final_filename);
+                               syslog(LOG_INFO, "UCLS: updoaded %s", final_filename);
                                unlink(CCC->upl_path);
                        }
                        else {
-                               CTDL_syslog(LOG_INFO, "Cannot link %s to %s: %s",
+                               syslog(LOG_INFO, "Cannot link %s to %s: %s",
                                            CCC->upl_path, final_filename, strerror(errno)
                                );
                        }
-                       
-
-                       /* FIXME ... here we need to trigger a network run */
                }
 
                CCC->upload_type = UPL_FILE;
@@ -488,9 +432,7 @@ void cmd_ucls(char *cmd)
                        fp = fopen(CCC->upl_filedir, "w");
                }
                if (fp != NULL) {
-                       fprintf(fp, "%s %s %s\n", CCC->upl_file,
-                               CCC->upl_mimetype,
-                               CCC->upl_comment);
+                       fprintf(fp, "%s %s %s\n", CCC->upl_file, CCC->upl_mimetype, CCC->upl_comment);
                        fclose(fp);
                }
 
@@ -530,8 +472,7 @@ void cmd_read(char *cmdbuf)
        }
 
        if (CC->download_fp == NULL) {
-               cprintf("%d You don't have a download file open.\n",
-                       ERROR + RESOURCE_NOT_OPEN);
+               cprintf("%d You don't have a download file open.\n", ERROR + RESOURCE_NOT_OPEN);
                return;
        }
 
@@ -542,12 +483,12 @@ void cmd_read(char *cmdbuf)
 
        rc = fseek(CC->download_fp, start_pos, 0);
        if (rc < 0) {
-               struct CitContext *CCC = CC;
                cprintf("%d your file is smaller then %ld.\n", ERROR + ILLEGAL_VALUE, start_pos);
-               CTDL_syslog(LOG_ERR, "your file %s is smaller then %ld. [%s]", 
+               syslog(LOG_ERR, "your file %s is smaller then %ld. [%s]", 
                            CC->upl_path, 
                            start_pos,
-                           strerror(errno));
+                           strerror(errno)
+               );
 
                return;
        }
@@ -595,14 +536,12 @@ void cmd_writ(char *cmdbuf)
        client_read(buf, bytes);
        rv = fwrite(buf, bytes, 1, CCC->upload_fp);
        if (rv == -1) {
-               CTDL_syslog(LOG_EMERG, "Couldn't write: %s", strerror(errno));
+               syslog(LOG_EMERG, "Couldn't write: %s", strerror(errno));
        }
        free(buf);
 }
 
 
-
-
 /*
  * cmd_ndop() - open a network spool file for downloading
  */
@@ -655,6 +594,7 @@ void cmd_ndop(char *cmdbuf)
        cprintf("%d %ld\n", CIT_OK, (long)statbuf.st_size);
 }
 
+
 /*
  * cmd_nuop() - open a network spool file for uploading
  */
@@ -675,31 +615,32 @@ void cmd_nuop(char *cmdbuf)
        }
 
        snprintf(CC->upl_path, sizeof CC->upl_path,
-                        "%s/%s.%04lx.%04x",
-                        ctdl_nettmp_dir,
-                        CC->net_node, 
-                        (long)getpid(), 
-                        ++seq);
+                "%s/%s.%04lx.%04x",
+                ctdl_nettmp_dir,
+                CC->net_node, 
+                (long)getpid(), 
+                ++seq
+       );
 
        CC->upload_fp = fopen(CC->upl_path, "r");
        if (CC->upload_fp != NULL) {
                fclose(CC->upload_fp);
                CC->upload_fp = NULL;
-               cprintf("%d '%s' already exists\n",
-                       ERROR + ALREADY_EXISTS, CC->upl_path);
+               cprintf("%d '%s' already exists\n", ERROR + ALREADY_EXISTS, CC->upl_path);
                return;
        }
 
        CC->upload_fp = fopen(CC->upl_path, "w");
        if (CC->upload_fp == NULL) {
-               cprintf("%d Cannot open %s: %s\n",
-                       ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
+               cprintf("%d Cannot open %s: %s\n", ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
                return;
        }
 
        CC->upload_type = UPL_NET;
        cprintf("%d Ok\n", CIT_OK);
 }
+
+
 void files_logout_hook(void)
 {
         CitContext *CCC = MyContext();
@@ -721,6 +662,7 @@ void files_logout_hook(void)
 
 }
 
+
 /* 
  * help_subst()  -  support routine for help file viewer
  */
@@ -736,6 +678,7 @@ void help_subst(char *strbuf, char *source, char *dest)
        }
 }
 
+
 void do_help_subst(char *buffer)
 {
        char buf2[16];
@@ -853,7 +796,6 @@ CTDL_MODULE_INIT(file_ops)
 {
        if (!threading) {
                 CtdlRegisterSessionHook(files_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 8);
-
                CtdlRegisterProtoHook(cmd_delf, "DELF", "Delete a file");
                CtdlRegisterProtoHook(cmd_movf, "MOVF", "Move a file");
                CtdlRegisterProtoHook(cmd_open, "OPEN", "Open a download file transfer");
@@ -866,7 +808,6 @@ CTDL_MODULE_INIT(file_ops)
                CtdlRegisterProtoHook(cmd_nuop, "NUOP", "Open a network spool file for upload");
                CtdlRegisterProtoHook(cmd_oimg, "OIMG", "Open an image file for download");
                CtdlRegisterProtoHook(cmd_uimg, "UIMG", "Upload an image file");
-
                CtdlRegisterProtoHook(cmd_mesg, "MESG", "fetch system banners");
                CtdlRegisterProtoHook(cmd_emsg, "EMSG", "submit system banners");
        }
index 94d8a5fa34a0738a7374df3e718a3088c1e5dfa9..40779c598cd1ffea3624841b934c1ff53d540f0e 100644 (file)
 
 struct RoomProcList *sieve_list = NULL;
 char *msiv_extensions = NULL;
-int SieveDebugEnable = 0;
-
-#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (SieveDebugEnable != 0))
-
-#define SV_syslog(LEVEL, FORMAT, ...)                          \
-       DBGLOG(LEVEL) syslog(LEVEL,                             \
-                            "Sieve: " FORMAT, __VA_ARGS__)
-
-#define SVM_syslog(LEVEL, FORMAT)              \
-       DBGLOG(LEVEL) syslog(LEVEL,             \
-                            "Sieve: " FORMAT);
 
 
 /*
@@ -69,7 +58,7 @@ int SieveDebugEnable = 0;
  */
 int ctdl_debug(sieve2_context_t *s, void *my)
 {
-       SV_syslog(LOG_DEBUG, "%s", sieve2_getvalue_string(s, "message"));
+       syslog(LOG_DEBUG, "%s", sieve2_getvalue_string(s, "message"));
        return SIEVE2_OK;
 }
 
@@ -79,7 +68,7 @@ int ctdl_debug(sieve2_context_t *s, void *my)
  */
 int ctdl_errparse(sieve2_context_t *s, void *my)
 {
-       SV_syslog(LOG_WARNING, "Error in script, line %d: %s",
+       syslog(LOG_WARNING, "Error in script, line %d: %s",
                  sieve2_getvalue_int(s, "lineno"),
                  sieve2_getvalue_string(s, "message")
        );
@@ -92,7 +81,7 @@ int ctdl_errparse(sieve2_context_t *s, void *my)
  */
 int ctdl_errexec(sieve2_context_t *s, void *my)
 {
-       SV_syslog(LOG_WARNING, "Error executing script: %s",
+       syslog(LOG_WARNING, "Error executing script: %s",
                  sieve2_getvalue_string(s, "message")
                );
        return SIEVE2_OK;
@@ -111,22 +100,22 @@ int ctdl_redirect(sieve2_context_t *s, void *my)
 
        safestrncpy(recp, sieve2_getvalue_string(s, "address"), sizeof recp);
 
-       SV_syslog(LOG_DEBUG, "Action is REDIRECT, recipient <%s>", recp);
+       syslog(LOG_DEBUG, "Action is REDIRECT, recipient <%s>", recp);
 
        valid = validate_recipients(recp, NULL, 0);
        if (valid == NULL) {
-               SV_syslog(LOG_WARNING, "REDIRECT failed: bad recipient <%s>", recp);
+               syslog(LOG_WARNING, "REDIRECT failed: bad recipient <%s>", recp);
                return SIEVE2_ERROR_BADARGS;
        }
        if (valid->num_error > 0) {
-               SV_syslog(LOG_WARNING, "REDIRECT failed: bad recipient <%s>", recp);
+               syslog(LOG_WARNING, "REDIRECT failed: bad recipient <%s>", recp);
                free_recipients(valid);
                return SIEVE2_ERROR_BADARGS;
        }
 
        msg = CtdlFetchMessage(cs->msgnum, 1, 1);
        if (msg == NULL) {
-               SV_syslog(LOG_WARNING, "REDIRECT failed: unable to fetch msg %ld", cs->msgnum);
+               syslog(LOG_WARNING, "REDIRECT failed: unable to fetch msg %ld", cs->msgnum);
                free_recipients(valid);
                return SIEVE2_ERROR_BADARGS;
        }
@@ -146,7 +135,7 @@ int ctdl_keep(sieve2_context_t *s, void *my)
 {
        struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
        
-       SVM_syslog(LOG_DEBUG, "Action is KEEP");
+       syslog(LOG_DEBUG, "Action is KEEP");
 
        cs->keep = 1;
        cs->cancel_implicit_keep = 1;
@@ -165,7 +154,7 @@ int ctdl_fileinto(sieve2_context_t *s, void *my)
        char foldername[256];
        char original_room_name[ROOMNAMELEN];
 
-       SV_syslog(LOG_DEBUG, "Action is FILEINTO, destination is <%s>", dest_folder);
+       syslog(LOG_DEBUG, "Action is FILEINTO, destination is <%s>", dest_folder);
 
        /* FILEINTO 'INBOX' is the same thing as KEEP */
        if ( (!strcasecmp(dest_folder, "INBOX")) || (!strcasecmp(dest_folder, MAILROOM)) ) {
@@ -188,7 +177,7 @@ int ctdl_fileinto(sieve2_context_t *s, void *my)
        }
 
        if (c != 0) {
-               SV_syslog(LOG_WARNING, "FILEINTO failed: target <%s> does not exist", dest_folder);
+               syslog(LOG_WARNING, "FILEINTO failed: target <%s> does not exist", dest_folder);
                return SIEVE2_ERROR_BADARGS;
        }
 
@@ -219,7 +208,7 @@ int ctdl_discard(sieve2_context_t *s, void *my)
 {
        struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
 
-       SVM_syslog(LOG_DEBUG, "Action is DISCARD");
+       syslog(LOG_DEBUG, "Action is DISCARD");
 
        /* Cancel the implicit keep.  That's all there is to it. */
        cs->cancel_implicit_keep = 1;
@@ -236,11 +225,11 @@ int ctdl_reject(sieve2_context_t *s, void *my)
        struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
        char *reject_text = NULL;
 
-       SVM_syslog(LOG_DEBUG, "Action is REJECT");
+       syslog(LOG_DEBUG, "Action is REJECT");
 
        /* If we don't know who sent the message, do a DISCARD instead. */
        if (IsEmptyStr(cs->sender)) {
-               SVM_syslog(LOG_INFO, "Unknown sender.  Doing DISCARD instead of REJECT.");
+               syslog(LOG_INFO, "Unknown sender.  Doing DISCARD instead of REJECT.");
                return ctdl_discard(s, my);
        }
 
@@ -291,7 +280,7 @@ int ctdl_vacation(sieve2_context_t *s, void *my)
        char *vacamsg_text = NULL;
        char vacamsg_subject[1024];
 
-       SVM_syslog(LOG_DEBUG, "Action is VACATION");
+       syslog(LOG_DEBUG, "Action is VACATION");
 
        message = sieve2_getvalue_string(s, "message");
        if (message == NULL) return SIEVE2_ERROR_BADARGS;
@@ -311,7 +300,7 @@ int ctdl_vacation(sieve2_context_t *s, void *my)
        for (vptr = cs->u->first_vacation; vptr != NULL; vptr = vptr->next) {
                if (!strcasecmp(vptr->fromaddr, cs->sender)) {
                        if ( (time(NULL) - vptr->timestamp) < (days * 86400) ) {
-                               SV_syslog(LOG_DEBUG, "Already alerted <%s> recently.", cs->sender);
+                               syslog(LOG_DEBUG, "Already alerted <%s> recently.", cs->sender);
                                return SIEVE2_OK;
                        }
                }
@@ -396,9 +385,9 @@ int ctdl_getenvelope(sieve2_context_t *s, void *my)
 {
        struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
 
-       SVM_syslog(LOG_DEBUG, "Action is GETENVELOPE");
-       SV_syslog(LOG_DEBUG, "EnvFrom: %s", cs->envelope_from);
-       SV_syslog(LOG_DEBUG, "EnvTo: %s", cs->envelope_to);
+       syslog(LOG_DEBUG, "Action is GETENVELOPE");
+       syslog(LOG_DEBUG, "EnvFrom: %s", cs->envelope_from);
+       syslog(LOG_DEBUG, "EnvTo: %s", cs->envelope_to);
 
        if (cs->envelope_from != NULL) {
                if ((cs->envelope_from[0] != '@')&&(cs->envelope_from[strlen(cs->envelope_from)-1] != '@')) {
@@ -469,12 +458,12 @@ char *get_active_script(struct sdm_userdata *u) {
 
        for (sptr=u->first_script; sptr!=NULL; sptr=sptr->next) {
                if (sptr->script_active > 0) {
-                       SV_syslog(LOG_DEBUG, "get_active_script() is using script '%s'", sptr->script_name);
+                       syslog(LOG_DEBUG, "get_active_script() is using script '%s'", sptr->script_name);
                        return(sptr->script_content);
                }
        }
 
-       SVM_syslog(LOG_DEBUG, "get_active_script() found no active script");
+       syslog(LOG_DEBUG, "get_active_script() found no active script");
        return(NULL);
 }
 
@@ -501,7 +490,7 @@ int ctdl_getheaders(sieve2_context_t *s, void *my) {
 
        struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
 
-       SVM_syslog(LOG_DEBUG, "ctdl_getheaders() was called");
+       syslog(LOG_DEBUG, "ctdl_getheaders() was called");
        sieve2_setvalue_string(s, "allheaders", cs->rfc822headers);
        return SIEVE2_OK;
 }
@@ -522,7 +511,7 @@ void sieve_queue_room(struct ctdlroom *which_room) {
        ptr->next = sieve_list;
        sieve_list = ptr;
        end_critical_section(S_SIEVELIST);
-       SV_syslog(LOG_DEBUG, "<%s> queued for Sieve processing", which_room->QRname);
+       syslog(LOG_DEBUG, "<%s> queued for Sieve processing", which_room->QRname);
 }
 
 
@@ -542,13 +531,13 @@ void sieve_do_msg(long msgnum, void *userdata) {
 
        if (u == NULL)
        {
-               SV_syslog(LOG_EMERG, "Can't process message <%ld> without userdata!", msgnum);
+               syslog(LOG_EMERG, "Can't process message <%ld> without userdata!", msgnum);
                return;
        }
 
        sieve2_context = u->sieve2_context;
 
-       SV_syslog(LOG_DEBUG, "Performing sieve processing on msg <%ld>", msgnum);
+       syslog(LOG_DEBUG, "Performing sieve processing on msg <%ld>", msgnum);
 
        /*
         * Make sure you include message body so you can get those second-level headers ;)
@@ -657,10 +646,10 @@ void sieve_do_msg(long msgnum, void *userdata) {
 
        CM_Free(msg);
        
-       SVM_syslog(LOG_DEBUG, "Calling sieve2_execute()");
+       syslog(LOG_DEBUG, "Calling sieve2_execute()");
        res = sieve2_execute(sieve2_context, &my);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_execute() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_execute() returned %d: %s", res, sieve2_errstr(res));
        }
 
        free(my.rfc822headers);
@@ -671,11 +660,11 @@ void sieve_do_msg(long msgnum, void *userdata) {
         * if no other action was successfully taken.
         */
        if ( (!my.keep) && (my.cancel_implicit_keep) ) {
-               SVM_syslog(LOG_DEBUG, "keep is 0 -- deleting message from inbox");
+               syslog(LOG_DEBUG, "keep is 0 -- deleting message from inbox");
                CtdlDeleteMessages(CC->room.QRname, &msgnum, 1, "");
        }
 
-       SV_syslog(LOG_DEBUG, "Completed sieve processing on msg <%ld>", msgnum);
+       syslog(LOG_DEBUG, "Completed sieve processing on msg <%ld>", msgnum);
        u->lastproc = msgnum;
 
        return;
@@ -885,7 +874,7 @@ void sieve_do_room(char *roomname) {
         */
        snprintf(u.config_roomname, sizeof u.config_roomname, "%010ld.%s", atol(roomname), USERCONFIGROOM);
        if (CtdlGetRoom(&CC->room, u.config_roomname) != 0) {
-               SV_syslog(LOG_DEBUG, "<%s> does not exist.  No processing is required.", u.config_roomname);
+               syslog(LOG_DEBUG, "<%s> does not exist.  No processing is required.", u.config_roomname);
                return;
        }
 
@@ -897,7 +886,7 @@ void sieve_do_room(char *roomname) {
                get_sieve_config_backend, (void *)&u );
 
        if (u.config_msgnum < 0) {
-               SVM_syslog(LOG_DEBUG, "No Sieve rules exist.  No processing is required.");
+               syslog(LOG_DEBUG, "No Sieve rules exist.  No processing is required.");
                return;
        }
 
@@ -909,14 +898,14 @@ void sieve_do_room(char *roomname) {
                (get_active_script(&u) == NULL)
                || (strchr(get_active_script(&u), ';') == NULL)
        ) {
-               SVM_syslog(LOG_DEBUG, "Sieve script is empty.  No processing is required.");
+               syslog(LOG_DEBUG, "Sieve script is empty.  No processing is required.");
                return;
        }
 
-       SV_syslog(LOG_DEBUG, "Rules found.  Performing Sieve processing for <%s>", roomname);
+       syslog(LOG_DEBUG, "Rules found.  Performing Sieve processing for <%s>", roomname);
 
        if (CtdlGetRoom(&CC->room, roomname) != 0) {
-               SV_syslog(LOG_CRIT, "ERROR: cannot load <%s>", roomname);
+               syslog(LOG_CRIT, "ERROR: cannot load <%s>", roomname);
                return;
        }
 
@@ -924,13 +913,13 @@ void sieve_do_room(char *roomname) {
        
        res = sieve2_alloc(&sieve2_context);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_alloc() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_alloc() returned %d: %s", res, sieve2_errstr(res));
                return;
        }
 
        res = sieve2_callbacks(sieve2_context, ctdl_sieve_callbacks);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_callbacks() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_callbacks() returned %d: %s", res, sieve2_errstr(res));
                goto BAIL;
        }
 
@@ -941,7 +930,7 @@ void sieve_do_room(char *roomname) {
        my.u = &u;
        res = sieve2_validate(sieve2_context, &my);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_validate() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_validate() returned %d: %s", res, sieve2_errstr(res));
                goto BAIL;
        }
 
@@ -956,7 +945,7 @@ void sieve_do_room(char *roomname) {
 BAIL:
        res = sieve2_free(&sieve2_context);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_free() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_free() returned %d: %s", res, sieve2_errstr(res));
        }
 
        /* Rewrite the config if we have to */
@@ -971,7 +960,7 @@ void perform_sieve_processing(void) {
        struct RoomProcList *ptr = NULL;
 
        if (sieve_list != NULL) {
-               SVM_syslog(LOG_DEBUG, "Begin Sieve processing");
+               syslog(LOG_DEBUG, "Begin Sieve processing");
                while (sieve_list != NULL) {
                        char spoolroomname[ROOMNAMELEN];
                        safestrncpy(spoolroomname, sieve_list->name, sizeof spoolroomname);
@@ -1288,7 +1277,7 @@ void ctdl_sieve_init(void) {
                strcpy(&cred[55], "...");
        }
 
-       SV_syslog(LOG_INFO, "%s",cred);
+       syslog(LOG_INFO, "%s",cred);
        free(cred);
 
        /* Briefly initialize a Sieve parser instance just so we can list the
@@ -1296,22 +1285,22 @@ void ctdl_sieve_init(void) {
         */
        res = sieve2_alloc(&sieve2_context);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_alloc() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_alloc() returned %d: %s", res, sieve2_errstr(res));
                return;
        }
 
        res = sieve2_callbacks(sieve2_context, ctdl_sieve_callbacks);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_callbacks() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_callbacks() returned %d: %s", res, sieve2_errstr(res));
                goto BAIL;
        }
 
        msiv_extensions = strdup(sieve2_listextensions(sieve2_context));
-       SV_syslog(LOG_INFO, "Extensions: %s", msiv_extensions);
+       syslog(LOG_INFO, "Extensions: %s", msiv_extensions);
 
 BAIL:  res = sieve2_free(&sieve2_context);
        if (res != SIEVE2_OK) {
-               SV_syslog(LOG_CRIT, "sieve2_free() returned %d: %s", res, sieve2_errstr(res));
+               syslog(LOG_CRIT, "sieve2_free() returned %d: %s", res, sieve2_errstr(res));
        }
 
 }
@@ -1343,15 +1332,10 @@ int serv_sieve_room(struct ctdlroom *room)
        return 0;
 }
 
-void LogSieveDebugEnable(const int n)
-{
-       SieveDebugEnable = n;
-}
 CTDL_MODULE_INIT(sieve)
 {
        if (!threading)
        {
-               CtdlRegisterDebugFlagHook(HKEY("sieve"), LogSieveDebugEnable, &SieveDebugEnable);
                ctdl_sieve_init();
                CtdlRegisterProtoHook(cmd_msiv, "MSIV", "Manage Sieve scripts");
                CtdlRegisterRoomHook(serv_sieve_room);
index 59dcd64a403205ea16a3a31153148f663e69e347..44a54872296657b7764966fdfe8c7618300a807d 100644 (file)
@@ -166,11 +166,11 @@ void RemoveQItem(OneQueItem *MyQItem)
                DeleteEntryFromHash(ActiveQItems, It);
        else
        {
-               SMTPC_syslog(LOG_WARNING,
+               syslog(LOG_WARNING,
                             "unable to find QItem with ID[%ld]",
                             MyQItem->MessageID);
                while (GetNextHashPos(ActiveQItems, It, &len, &Key, &VData))
-                       SMTPC_syslog(LOG_WARNING,
+                       syslog(LOG_WARNING,
                                     "have_: ID[%ld]",
                                     ((OneQueItem *)VData)->MessageID);
        }
@@ -183,7 +183,7 @@ void FreeMailQEntry(void *qv)
 {
        MailQEntry *Q = qv;
 /*
-       SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
+       syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
        cit_backtrace();
 */
        FreeStrBuf(&Q->Recipient);
@@ -195,7 +195,7 @@ void FreeMailQEntry(void *qv)
 void FreeQueItem(OneQueItem **Item)
 {
 /*
-       SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
+       syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
        cit_backtrace();
 */
        DeleteHash(&(*Item)->MailQEntries);
@@ -493,7 +493,7 @@ StrBuf *smtp_load_msg(OneQueItem *MyQItem, int n, char **Author, char **Address)
        CCC->redirect_buffer = NULL;
        if ((StrLength(SendMsg) > 0) &&
            ChrPtr(SendMsg)[StrLength(SendMsg) - 1] != '\n') {
-               SMTPC_syslog(LOG_WARNING,
+               syslog(LOG_WARNING,
                             "[%d] Possible problem: message did not "
                             "correctly terminate. (expecting 0x10, got 0x%02x)\n",
                             MsgCount, //yes uncool, but best choice here...
@@ -531,7 +531,7 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
        int num_bounces = 0;
        int give_up = 0;
 
-       SMTPCM_syslog(LOG_DEBUG, "smtp_do_bounce() called\n");
+       syslog(LOG_DEBUG, "smtp_do_bounce() called\n");
 
        if (MyQItem->SendBounceMail == 0)
                return;
@@ -574,7 +574,7 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
        DeleteHashPos(&It);
 
        /* Deliver the bounce if there's anything worth mentioning */
-       SMTPC_syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
+       syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
 
        if (num_bounces == 0) {
                FreeStrBuf(&Msg);
@@ -612,7 +612,7 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
                StrLength(OMsgTxt)); /* the original message */
        if (BounceMB == NULL) {
                FreeStrBuf(&boundary);
-               SMTPCM_syslog(LOG_ERR, "Failed to alloc() bounce message.\n");
+               syslog(LOG_ERR, "Failed to alloc() bounce message.\n");
 
                return;
        }
@@ -621,7 +621,7 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
        if (bmsg == NULL) {
                FreeStrBuf(&boundary);
                FreeStrBuf(&BounceMB);
-               SMTPCM_syslog(LOG_ERR, "Failed to alloc() bounce message.\n");
+               syslog(LOG_ERR, "Failed to alloc() bounce message.\n");
 
                return;
        }
@@ -703,10 +703,10 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
 
        /* First try the user who sent the message */
        if (StrLength(MyQItem->BounceTo) == 0) {
-               SMTPCM_syslog(LOG_ERR, "No bounce address specified\n");
+               syslog(LOG_ERR, "No bounce address specified\n");
        }
        else {
-               SMTPC_syslog(LOG_DEBUG, "bounce to user? <%s>\n",
+               syslog(LOG_DEBUG, "bounce to user? <%s>\n",
                       ChrPtr(MyQItem->BounceTo));
        }
 
@@ -726,7 +726,7 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay)
        free_recipients(valid);
        FreeStrBuf(&boundary);
        CM_Free(bmsg);
-       SMTPCM_syslog(LOG_DEBUG, "Done processing bounces\n");
+       syslog(LOG_DEBUG, "Done processing bounces\n");
 }
 
 ParsedURL *LoadRelayUrls(OneQueItem *MyQItem,
@@ -752,7 +752,7 @@ ParsedURL *LoadRelayUrls(OneQueItem *MyQItem,
                {
                        StrBufExtract_NextToken(One, All, &Pos, '|');
                        if (!ParseURL(Url, One, DefaultMXPort)) {
-                               SMTPC_syslog(LOG_DEBUG,
+                               syslog(LOG_DEBUG,
                                             "Failed to parse: %s\n",
                                             ChrPtr(One));
                        }
@@ -789,7 +789,7 @@ ParsedURL *LoadRelayUrls(OneQueItem *MyQItem,
                                }
                        }
                        if (!ParseURL(Url, One, DefaultMXPort)) {
-                               SMTPC_syslog(LOG_DEBUG,
+                               syslog(LOG_DEBUG,
                                             "Failed to parse: %s\n",
                                             ChrPtr(One));
                        }
@@ -827,18 +827,18 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
        StrBuf *Msg =NULL;
 
        if (mynumsessions > max_sessions_for_outbound_smtp) {
-               SMTPC_syslog(LOG_INFO,
+               syslog(LOG_INFO,
                             "skipping because of num jobs %d > %d max_sessions_for_outbound_smtp",
                             mynumsessions,
                             max_sessions_for_outbound_smtp);
        }
 
-       SMTPC_syslog(LOG_DEBUG, "smtp_do_procmsg(%ld)\n", msgnum);
+       syslog(LOG_DEBUG, "smtp_do_procmsg(%ld)\n", msgnum);
        ///strcpy(envelope_from, "");
 
        msg = CtdlFetchMessage(msgnum, 1, 1);
        if (msg == NULL) {
-               SMTPC_syslog(LOG_ERR, "tried %ld but no such message!\n",
+               syslog(LOG_ERR, "tried %ld but no such message!\n",
                       msgnum);
                return;
        }
@@ -862,7 +862,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
        FreeStrBuf(&PlainQItem);
 
        if (MyQItem == NULL) {
-               SMTPC_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                             "Msg No %ld: already in progress!\n",
                             msgnum);
                return; /* s.b. else is already processing... */
@@ -876,7 +876,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
            (now < MyQItem->ReattemptWhen) &&
            (run_queue_now == 0))
        {
-               SMTPC_syslog(LOG_DEBUG, 
+               syslog(LOG_DEBUG, 
                             "Retry time not yet reached. %ld seconds left.",
                             MyQItem->ReattemptWhen - now);
 
@@ -900,7 +900,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
         * Bail out if there's no actual message associated with this
         */
        if (MyQItem->MessageID < 0L) {
-               SMTPCM_syslog(LOG_ERR, "no 'msgid' directive found!\n");
+               syslog(LOG_ERR, "no 'msgid' directive found!\n");
                It = GetNewHashPos(MyQItem->MailQEntries, 0);
                pthread_mutex_lock(&ActiveQItemsLock);
                {
@@ -922,7 +922,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
        while (GetNextHashPos(MyQItem->MailQEntries, It, &len, &Key, &vQE))
        {
                MailQEntry *ThisItem = vQE;
-               SMTPC_syslog(LOG_DEBUG, "SMTP Queue: Task: <%s> %d\n",
+               syslog(LOG_DEBUG, "SMTP Queue: Task: <%s> %d\n",
                             ChrPtr(ThisItem->Recipient),
                             ThisItem->Active);
        }
@@ -941,7 +941,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
            (((MyQItem->ActiveDeliveries * 2)  < max_sessions_for_outbound_smtp)))
        {
                /* abort delivery for another time. */
-               SMTPC_syslog(LOG_INFO,
+               syslog(LOG_INFO,
                             "SMTP Queue: skipping because of num jobs %d + %ld > %d max_sessions_for_outbound_smtp",
                             mynumsessions,
                             MyQItem->ActiveDeliveries,
@@ -992,7 +992,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                nActivated++;
 
                                if (i > 1) n = MsgCount++;
-                               SMTPC_syslog(LOG_INFO,
+                               syslog(LOG_INFO,
                                             "SMTPC: giving up on <%ld> <%s> %d / %d \n",
                                             MyQItem->MessageID,
                                             ChrPtr(ThisItem->Recipient),
@@ -1034,7 +1034,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                        usleep(delay_msec);
 
                                if (i > 1) n = MsgCount++;
-                               SMTPC_syslog(LOG_DEBUG,
+                               syslog(LOG_DEBUG,
                                             "SMTPC: Trying <%ld> <%s> %d / %d \n",
                                             MyQItem->MessageID,
                                             ChrPtr(ThisItem->Recipient),
@@ -1072,7 +1072,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                const char* Key;
                                void *VData;
 
-                               SMTPC_syslog(LOG_WARNING,
+                               syslog(LOG_WARNING,
                                             "unable to find QItem with ID[%ld]",
                                             MyQItem->MessageID);
                                while (GetNextHashPos(ActiveQItems,
@@ -1081,7 +1081,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                                      &Key,
                                                      &VData))
                                {
-                                       SMTPC_syslog(LOG_WARNING,
+                                       syslog(LOG_WARNING,
                                                     "have: ID[%ld]",
                                                     ((OneQueItem *)VData)->MessageID);
                                }
@@ -1113,10 +1113,10 @@ void smtp_do_queue(void) {
        int num_activated = 0;
 
        pthread_setspecific(MyConKey, (void *)&smtp_queue_CC);
-       SMTPCM_syslog(LOG_DEBUG, "processing outbound queue");
+       syslog(LOG_DEBUG, "processing outbound queue");
 
        if (CtdlGetRoom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
-               SMTPC_syslog(LOG_ERR, "Cannot find room <%s>", SMTP_SPOOLOUT_ROOM);
+               syslog(LOG_ERR, "Cannot find room <%s>", SMTP_SPOOLOUT_ROOM);
        }
        else {
                num_processed = CtdlForEachMessage(MSGS_ALL,
@@ -1128,7 +1128,7 @@ void smtp_do_queue(void) {
                                                   &num_activated);
        }
        if (num_activated > 0) {
-               SMTPC_syslog(LOG_INFO,
+               syslog(LOG_INFO,
                             "queue run completed; %d messages processed %d activated",
                             num_processed, num_activated);
        }
@@ -1213,12 +1213,11 @@ int smtp_aftersave(struct CtdlMessage *msg,
        if ((recps != NULL) && (recps->num_internet > 0)) {
                struct CtdlMessage *imsg = NULL;
                char recipient[SIZ];
-               CitContext *CCC = MyContext();
                StrBuf *SpoolMsg = NewStrBuf();
                long nTokens;
                int i;
 
-               MSGM_syslog(LOG_DEBUG, "Generating delivery instructions\n");
+               syslog(LOG_DEBUG, "Generating delivery instructions\n");
 
                StrBufPrintf(SpoolMsg,
                             "Content-type: "SPOOLMIME"\n"
index 7484cd5f4a18b0ede753bb629d1824e9b41cffdf..550c2e6afc9fdc8278b177574a3c6a71c1118bb1 100644 (file)
@@ -20,7 +20,7 @@
  * The VRFY and EXPN commands have been removed from this implementation
  * because nobody uses these commands anymore, except for spammers.
  *
- * Copyright (c) 1998-2015 by the citadel.org team
+ * Copyright (c) 1998-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -121,7 +121,7 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        StrBuf *BounceMB;
        long omsgid = (-1);
 
-       SMTPCM_syslog(LOG_DEBUG, "smtp_do_bounce() called");
+       syslog(LOG_DEBUG, "smtp_do_bounce() called");
        strcpy(bounceto, "");
        boundary = NewStrBufPlain(HKEY("=_Citadel_Multipart_"));
 
@@ -206,8 +206,7 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
                dsnlen = extract_token(dsn, buf, 3, '|', sizeof dsn);
                bounce_this = 0;
 
-               SMTPC_syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>",
-                            key, addr, status, dsn);
+               syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>", key, addr, status, dsn);
 
                if (!strcasecmp(key, "bounceto")) {
                        strcpy(bounceto, addr);
@@ -279,15 +278,15 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
 
        /* Deliver the bounce if there's anything worth mentioning */
-       SMTPC_syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
+       syslog(LOG_DEBUG, "num_bounces = %d", num_bounces);
        if (num_bounces > 0) {
 
                /* First try the user who sent the message */
                if (IsEmptyStr(bounceto)) {
-                       SMTPCM_syslog(LOG_ERR, "No bounce address specified");
+                       syslog(LOG_ERR, "No bounce address specified");
                }
                else {
-                       SMTPC_syslog(LOG_DEBUG, "bounce to user <%s>", bounceto);
+                       syslog(LOG_DEBUG, "bounce to user <%s>", bounceto);
                }
                /* Can we deliver the bounce to the original sender? */
                valid = validate_recipients(bounceto,
@@ -312,5 +311,5 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        }
        FreeStrBuf(&boundary);
        CM_Free(bmsg);
-       SMTPCM_syslog(LOG_DEBUG, "Done processing bounces\n");
+       syslog(LOG_DEBUG, "Done processing bounces");
 }
index 466175a8cffc5f0fa16ae430c8112486b3fa2634..20e0a39b3f268dffda765ead7e7b0178faeed137 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Implements the message store.
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -39,8 +39,6 @@ struct addresses_to_be_filed *atbf = NULL;
 static FILE *arcfp = NULL;
 void AdjRefCountList(long *msgnum, long nmsg, int incr);
 
-int MessageDebugEnabled = 0;
-
 /*
  * These are the four-character field headers we use when outputting
  * messages in Citadel format (as opposed to RFC822 format).
@@ -294,8 +292,7 @@ int CM_IsValidMsg(struct CtdlMessage *msg) {
        if (msg == NULL)
                return 0;
        if ((msg->cm_magic) != CTDLMESSAGE_MAGIC) {
-               struct CitContext *CCC = CC;
-               MSGM_syslog(LOG_WARNING, "CM_IsValidMsg() -- self-check failed\n");
+               syslog(LOG_WARNING, "CM_IsValidMsg() -- self-check failed\n");
                return 0;
        }
        return 1;
@@ -411,11 +408,10 @@ int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template) {
  * Retrieve the "seen" message list for the current room.
  */
 void CtdlGetSeen(char *buf, int which_set) {
-       struct CitContext *CCC = CC;
        visit vbuf;
 
        /* Learn about the user and room in question */
-       CtdlGetRelationship(&vbuf, &CCC->user, &CCC->room);
+       CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
 
        if (which_set == ctdlsetseen_seen)
                safestrncpy(buf, vbuf.v_seen, SIZ);
@@ -431,7 +427,6 @@ void CtdlGetSeen(char *buf, int which_set) {
 void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
                int target_setting, int which_set,
                struct ctdluser *which_user, struct ctdlroom *which_room) {
-       struct CitContext *CCC = CC;
        struct cdbdata *cdbfr;
        int i, k;
        int is_seen = 0;
@@ -455,15 +450,15 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
 
        /* If no room was specified, we go with the current room. */
        if (!which_room) {
-               which_room = &CCC->room;
+               which_room = &CC->room;
        }
 
        /* If no user was specified, we go with the current user. */
        if (!which_user) {
-               which_user = &CCC->user;
+               which_user = &CC->user;
        }
 
-       MSG_syslog(LOG_DEBUG, "CtdlSetSeen(%d msgs starting with %ld, %s, %d) in <%s>\n",
+       syslog(LOG_DEBUG, "CtdlSetSeen(%d msgs starting with %ld, %s, %d) in <%s>\n",
                   num_target_msgnums, target_msgnums[0],
                   (target_setting ? "SET" : "CLEAR"),
                   which_set,
@@ -500,17 +495,17 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
 
 
 #if 0  /* This is a special diagnostic section.  Do not allow it to run during normal operation. */
-       MSG_syslog(LOG_DEBUG, "There are %d messages in the room.\n", num_msgs);
+       syslog(LOG_DEBUG, "There are %d messages in the room.\n", num_msgs);
        for (i=0; i<num_msgs; ++i) {
                if ((i > 0) && (msglist[i] <= msglist[i-1])) abort();
        }
-       MSG_syslog(LOG_DEBUG, "We are twiddling %d of them.\n", num_target_msgnums);
+       syslog(LOG_DEBUG, "We are twiddling %d of them.\n", num_target_msgnums);
        for (k=0; k<num_target_msgnums; ++k) {
                if ((k > 0) && (target_msgnums[k] <= target_msgnums[k-1])) abort();
        }
 #endif
 
-       MSG_syslog(LOG_DEBUG, "before update: %s\n", ChrPtr(vset));
+       syslog(LOG_DEBUG, "before update: %s\n", ChrPtr(vset));
 
        /* Translate the existing sequence set into an array of booleans */
        setstr = NewStrBuf();
@@ -633,7 +628,7 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
                vset = new_set;
        }
 
-       MSG_syslog(LOG_DEBUG, " after update: %s\n", ChrPtr(vset));
+       syslog(LOG_DEBUG, " after update: %s\n", ChrPtr(vset));
 
        /* Decide which message set we're manipulating */
        switch (which_set) {
@@ -662,7 +657,6 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
                         ForEachMsgCallback CallBack,
                        void *userdata)
 {
-       struct CitContext *CCC = CC;
        int a, i, j;
        visit vbuf;
        struct cdbdata *cdbfr;
@@ -691,13 +685,13 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
                if (need_to_free_re) regfree(&re);
                return -1;
        }
-       CtdlGetUser(&CCC->user, CCC->curr_user);
+       CtdlGetUser(&CC->user, CC->curr_user);
 
        if (server_shutting_down) {
                if (need_to_free_re) regfree(&re);
                return -1;
        }
-       CtdlGetRelationship(&vbuf, &CCC->user, &CCC->room);
+       CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
 
        if (server_shutting_down) {
                if (need_to_free_re) regfree(&re);
@@ -705,7 +699,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
        }
 
        /* Load the message list */
-       cdbfr = cdb_fetch(CDB_MSGLISTS, &CCC->room.QRnumber, sizeof(long));
+       cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
        if (cdbfr == NULL) {
                if (need_to_free_re) regfree(&re);
                return 0;       /* No messages at all?  No further action. */
@@ -852,7 +846,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
                                || ((mode == MSGS_EQ) && (thismsg == ref))
                            )
                            ) {
-                               if ((mode == MSGS_NEW) && (CCC->user.flags & US_LASTOLD) && (lastold > 0L) && (printed_lastold == 0) && (!is_seen)) {
+                               if ((mode == MSGS_NEW) && (CC->user.flags & US_LASTOLD) && (lastold > 0L) && (printed_lastold == 0) && (!is_seen)) {
                                        if (CallBack)
                                                CallBack(lastold, userdata);
                                        printed_lastold = 1;
@@ -867,12 +861,12 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
        /*
         * We cache the most recent msglist in order to do security checks later
         */
-       if (CCC->client_socket > 0) {
-               if (CCC->cached_msglist != NULL) {
-                       free(CCC->cached_msglist);
+       if (CC->client_socket > 0) {
+               if (CC->cached_msglist != NULL) {
+                       free(CC->cached_msglist);
                }
-               CCC->cached_msglist = msglist;
-               CCC->cached_num_msgs = num_msgs;
+               CC->cached_msglist = msglist;
+               CC->cached_num_msgs = num_msgs;
        }
        else {
                free(msglist);
@@ -894,7 +888,6 @@ void memfmout(
        char *mptr,             /* where are we going to get our text from? */
        const char *nl          /* string to terminate lines with */
 ) {
-       struct CitContext *CCC = CC;
        int column = 0;
        unsigned char ch = 0;
        char outbuf[1024];
@@ -908,13 +901,13 @@ void memfmout(
                if (ch == '\n') {
                        if (client_write(outbuf, len) == -1)
                        {
-                               MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                               syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                return;
                        }
                        len = 0;
                        if (client_write(nl, nllen) == -1)
                        {
-                               MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                               syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                return;
                        }
                        column = 0;
@@ -926,13 +919,13 @@ void memfmout(
                        if (column > 72) {              /* Beyond 72 columns, break on the next space */
                                if (client_write(outbuf, len) == -1)
                                {
-                                       MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                                       syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                        return;
                                }
                                len = 0;
                                if (client_write(nl, nllen) == -1)
                                {
-                                       MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                                       syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                        return;
                                }
                                column = 0;
@@ -948,13 +941,13 @@ void memfmout(
                        if (column > 1000) {            /* Beyond 1000 columns, break anywhere */
                                if (client_write(outbuf, len) == -1)
                                {
-                                       MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                                       syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                        return;
                                }
                                len = 0;
                                if (client_write(nl, nllen) == -1)
                                {
-                                       MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                                       syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                                        return;
                                }
                                column = 0;
@@ -964,7 +957,7 @@ void memfmout(
        if (len) {
                if (client_write(outbuf, len) == -1)
                {
-                       MSGM_syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
+                       syslog(LOG_ERR, "memfmout(): aborting due to write failure.\n");
                        return;
                }
                client_write(nl, nllen);
@@ -1045,37 +1038,36 @@ void mime_download(char *name, char *filename, char *partnum, char *disp,
                   char *encoding, char *cbid, void *cbuserdata)
 {
        int rv = 0;
-       CitContext *CCC = MyContext();
 
        /* Silently go away if there's already a download open. */
-       if (CCC->download_fp != NULL)
+       if (CC->download_fp != NULL)
                return;
 
        if (
-               (!IsEmptyStr(partnum) && (!strcasecmp(CCC->download_desired_section, partnum)))
-       ||      (!IsEmptyStr(cbid) && (!strcasecmp(CCC->download_desired_section, cbid)))
+               (!IsEmptyStr(partnum) && (!strcasecmp(CC->download_desired_section, partnum)))
+       ||      (!IsEmptyStr(cbid) && (!strcasecmp(CC->download_desired_section, cbid)))
        ) {
-               CCC->download_fp = tmpfile();
-               if (CCC->download_fp == NULL) {
-                       MSG_syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n",
+               CC->download_fp = tmpfile();
+               if (CC->download_fp == NULL) {
+                       syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n",
                                    strerror(errno));
                        cprintf("%d cannot open temporary file: %s\n",
                                ERROR + INTERNAL_ERROR, strerror(errno));
                        return;
                }
        
-               rv = fwrite(content, length, 1, CCC->download_fp);
+               rv = fwrite(content, length, 1, CC->download_fp);
                if (rv <= 0) {
-                       MSG_syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n",
+                       syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n",
                                   strerror(errno));
                        cprintf("%d unable to write tempfile.\n",
                                ERROR + TOO_BIG);
-                       fclose(CCC->download_fp);
-                       CCC->download_fp = NULL;
+                       fclose(CC->download_fp);
+                       CC->download_fp = NULL;
                        return;
                }
-               fflush(CCC->download_fp);
-               rewind(CCC->download_fp);
+               fflush(CC->download_fp);
+               rewind(CC->download_fp);
        
                OpenCmdResult(filename, cbtype);
        }
@@ -1111,7 +1103,6 @@ void mime_spew_section(char *name, char *filename, char *partnum, char *disp,
 
 struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const char *Buffer, long Length)
 {
-       struct CitContext *CCC = CC;
        struct CtdlMessage *ret = NULL;
        const char *mptr;
        const char *upper_bound;
@@ -1129,7 +1120,7 @@ struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const cha
         */
        ch = *mptr++;
        if (ch != 255) {
-               MSG_syslog(LOG_ERR, "Message %ld appears to be corrupted.\n", msgnum);
+               syslog(LOG_ERR, "Message %ld appears to be corrupted.\n", msgnum);
                return NULL;
        }
        ret = (struct CtdlMessage *) malloc(sizeof(struct CtdlMessage));
@@ -1181,20 +1172,19 @@ struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const cha
  */
 struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hooks)
 {
-       struct CitContext *CCC = CC;
        struct cdbdata *dmsgtext;
        struct CtdlMessage *ret = NULL;
 
-       MSG_syslog(LOG_DEBUG, "CtdlFetchMessage(%ld, %d)\n", msgnum, with_body);
+       syslog(LOG_DEBUG, "CtdlFetchMessage(%ld, %d)\n", msgnum, with_body);
        dmsgtext = cdb_fetch(CDB_MSGMAIN, &msgnum, sizeof(long));
        if (dmsgtext == NULL) {
-               MSG_syslog(LOG_ERR, "CtdlFetchMessage(%ld, %d) Failed!\n", msgnum, with_body);
+               syslog(LOG_ERR, "CtdlFetchMessage(%ld, %d) Failed!\n", msgnum, with_body);
                return NULL;
        }
 
        if (dmsgtext->ptr[dmsgtext->len - 1] != '\0')
        {
-               MSG_syslog(LOG_ERR, "CtdlFetchMessage(%ld, %d) Forcefully terminating message!!\n", msgnum, with_body);
+               syslog(LOG_ERR, "CtdlFetchMessage(%ld, %d) Forcefully terminating message!!\n", msgnum, with_body);
                dmsgtext->ptr[dmsgtext->len - 1] = '\0';
        }
 
@@ -1247,11 +1237,10 @@ void fixed_output_pre(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length, char *encoding,
                char *cbid, void *cbuserdata)
 {
-       struct CitContext *CCC = CC;
        struct ma_info *ma;
        
        ma = (struct ma_info *)cbuserdata;
-       MSG_syslog(LOG_DEBUG, "fixed_output_pre() type=<%s>\n", cbtype);        
+       syslog(LOG_DEBUG, "fixed_output_pre() type=<%s>\n", cbtype);    
        if (!strcasecmp(cbtype, "multipart/alternative")) {
                ++ma->is_ma;
                ma->did_print = 0;
@@ -1268,11 +1257,10 @@ void fixed_output_post(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length,
                char *encoding, char *cbid, void *cbuserdata)
 {
-       struct CitContext *CCC = CC;
        struct ma_info *ma;
        
        ma = (struct ma_info *)cbuserdata;
-       MSG_syslog(LOG_DEBUG, "fixed_output_post() type=<%s>\n", cbtype);       
+       syslog(LOG_DEBUG, "fixed_output_post() type=<%s>\n", cbtype);   
        if (!strcasecmp(cbtype, "multipart/alternative")) {
                --ma->is_ma;
                ma->did_print = 0;
@@ -1289,7 +1277,6 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length,
                char *encoding, char *cbid, void *cbuserdata)
 {
-       struct CitContext *CCC = CC;
        char *ptr;
        char *wptr;
        size_t wlen;
@@ -1297,7 +1284,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
 
        ma = (struct ma_info *)cbuserdata;
 
-       MSG_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                "fixed_output() part %s: %s (%s) (%ld bytes)\n",
                partnum, filename, cbtype, (long)length);
 
@@ -1306,7 +1293,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
         * we've already printed another section, skip this one.
         */     
        if ( (ma->is_ma) && (ma->did_print) ) {
-               MSG_syslog(LOG_DEBUG, "Skipping part %s (%s)\n", partnum, cbtype);
+               syslog(LOG_DEBUG, "Skipping part %s (%s)\n", partnum, cbtype);
                return;
        }
        ma->did_print = 1;
@@ -1363,7 +1350,6 @@ void choose_preferred(char *name, char *filename, char *partnum, char *disp,
                void *content, char *cbtype, char *cbcharset, size_t length,
                char *encoding, char *cbid, void *cbuserdata)
 {
-       struct CitContext *CCC = CC;
        char buf[1024];
        int i;
        struct ma_info *ma;
@@ -1375,11 +1361,11 @@ void choose_preferred(char *name, char *filename, char *partnum, char *disp,
        // I don't know if there are any side effects!  Please TEST TEST TEST
        //if (ma->is_ma > 0) {
 
-       for (i=0; i<num_tokens(CCC->preferred_formats, '|'); ++i) {
-               extract_token(buf, CCC->preferred_formats, i, '|', sizeof buf);
+       for (i=0; i<num_tokens(CC->preferred_formats, '|'); ++i) {
+               extract_token(buf, CC->preferred_formats, i, '|', sizeof buf);
                if ( (!strcasecmp(buf, cbtype)) && (!ma->freeze) ) {
                        if (i < ma->chosen_pref) {
-                               MSG_syslog(LOG_DEBUG, "Setting chosen part: <%s>\n", partnum);
+                               syslog(LOG_DEBUG, "Setting chosen part: <%s>\n", partnum);
                                safestrncpy(ma->chosen_part, partnum, sizeof ma->chosen_part);
                                ma->chosen_pref = i;
                        }
@@ -1402,7 +1388,6 @@ void output_preferred(char *name,
                      char *cbid, 
                      void *cbuserdata)
 {
-       struct CitContext *CCC = CC;
        int i;
        char buf[128];
        int add_newline = 0;
@@ -1420,8 +1405,8 @@ void output_preferred(char *name,
        /* If the content-type of this part is in our preferred formats
         * list, we can simply output it verbatim.
         */
-       for (i=0; i<num_tokens(CCC->preferred_formats, '|'); ++i) {
-               extract_token(buf, CCC->preferred_formats, i, '|', sizeof buf);
+       for (i=0; i<num_tokens(CC->preferred_formats, '|'); ++i) {
+               extract_token(buf, CC->preferred_formats, i, '|', sizeof buf);
                if (!strcasecmp(buf, cbtype)) {
                        /* Yeah!  Go!  W00t!! */
                        if (ma->dont_decode == 0) 
@@ -1458,7 +1443,7 @@ void output_preferred(char *name,
                        cprintf("\n");
                        if (client_write(text_content, length) == -1)
                        {
-                               MSGM_syslog(LOG_ERR, "output_preferred(): aborting due to write failure.\n");
+                               syslog(LOG_ERR, "output_preferred(): aborting due to write failure.\n");
                                return;
                        }
                        if (add_newline) cprintf("\n");
@@ -1524,13 +1509,12 @@ void extract_encapsulated_message(char *name, char *filename, char *partnum, cha
  * (This is a security check)
  */
 int check_cached_msglist(long msgnum) {
-       struct CitContext *CCC = CC;
 
        /* cases in which we skip the check */
-       if (!CCC) return om_ok;                                         /* not a session */
-       if (CCC->client_socket <= 0) return om_ok;                      /* not a client session */
-       if (CCC->cached_msglist == NULL) return om_access_denied;       /* no msglist fetched */
-       if (CCC->cached_num_msgs == 0) return om_access_denied;         /* nothing to check */
+       if (!CC) return om_ok;                                          /* not a session */
+       if (CC->client_socket <= 0) return om_ok;                       /* not a client session */
+       if (CC->cached_msglist == NULL) return om_access_denied;        /* no msglist fetched */
+       if (CC->cached_num_msgs == 0) return om_access_denied;          /* nothing to check */
 
 
        /* Do a binary search within the cached_msglist for the requested msgnum */
@@ -1539,7 +1523,7 @@ int check_cached_msglist(long msgnum) {
 
        while (max >= min) {
                int middle = min + (max-min) / 2 ;
-               if (msgnum == CCC->cached_msglist[middle]) {
+               if (msgnum == CC->cached_msglist[middle]) {
                        return om_ok;
                }
                if (msgnum > CC->cached_msglist[middle]) {
@@ -1570,13 +1554,12 @@ int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
                char **Address,
                char **MessageID
 ) {
-       struct CitContext *CCC = CC;
        struct CtdlMessage *TheMessage = NULL;
        int retcode = CIT_OK;
        struct encapmsg encap;
        int r;
 
-       MSG_syslog(LOG_DEBUG, "CtdlOutputMsg(msgnum=%ld, mode=%d, section=%s)\n", 
+       syslog(LOG_DEBUG, "CtdlOutputMsg(msgnum=%ld, mode=%d, section=%s)\n", 
                msg_num, mode,
                (section ? section : "<>")
        );
@@ -1604,8 +1587,8 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
                r = check_cached_msglist(msg_num);
        }
        if (r != om_ok) {
-               MSG_syslog(LOG_DEBUG, "Security check fail: message %ld is not in %s\n",
-                          msg_num, CCC->room.QRname
+               syslog(LOG_DEBUG, "Security check fail: message %ld is not in %s\n",
+                          msg_num, CC->room.QRname
                );
                if (do_proto) {
                        if (r == om_access_denied) {
@@ -1991,8 +1974,7 @@ void Dump_RFC822HeadersBody(
                if (outlen > 1000) {
                        if (client_write(outbuf, outlen) == -1)
                        {
-                               struct CitContext *CCC = CC;
-                               MSGM_syslog(LOG_ERR, "Dump_RFC822HeadersBody(): aborting due to write failure.\n");
+                               syslog(LOG_ERR, "Dump_RFC822HeadersBody(): aborting due to write failure.\n");
                                return;
                        }
                        lfSent =  (outbuf[outlen - 1] == '\n');
@@ -2065,8 +2047,7 @@ void DumpFormatFixed(
 
                        if (client_write(buf, buflen) == -1)
                        {
-                               struct CitContext *CCC = CC;
-                               MSGM_syslog(LOG_ERR, "DumpFormatFixed(): aborting due to write failure.\n");
+                               syslog(LOG_ERR, "DumpFormatFixed(): aborting due to write failure.\n");
                                return;
                        }
                        *buf = '\0';
@@ -2093,7 +2074,6 @@ int CtdlOutputPreLoadedMsg(
                int crlf,               /* Use CRLF newlines instead of LF? */
                int flags               /* should the bessage be exported clean? */
 ) {
-       struct CitContext *CCC = CC;
        int i;
        const char *nl; /* newline string */
        int nlen;
@@ -2109,7 +2089,7 @@ int CtdlOutputPreLoadedMsg(
        char snode[100];
        char mid[100];
 
-       MSG_syslog(LOG_DEBUG, "CtdlOutputPreLoadedMsg(TheMessage=%s, %d, %d, %d, %d\n",
+       syslog(LOG_DEBUG, "CtdlOutputPreLoadedMsg(TheMessage=%s, %d, %d, %d, %d\n",
                   ((TheMessage == NULL) ? "NULL" : "not null"),
                   mode, headers_only, do_proto, crlf);
 
@@ -2118,7 +2098,7 @@ int CtdlOutputPreLoadedMsg(
        nlen = crlf ? 2 : 1;
 
        if (!CM_IsValidMsg(TheMessage)) {
-               MSGM_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                            "ERROR: invalid preloaded message for output\n");
                cit_backtrace ();
                return(om_no_such_msg);
@@ -2137,7 +2117,7 @@ int CtdlOutputPreLoadedMsg(
                        if (do_proto)
                                cprintf("%d This is not a MIME message.\n",
                                ERROR + ILLEGAL_VALUE);
-               } else if (CCC->download_fp != NULL) {
+               } else if (CC->download_fp != NULL) {
                        if (do_proto) cprintf(
                                "%d You already have a download open.\n",
                                ERROR + RESOURCE_BUSY);
@@ -2148,14 +2128,14 @@ int CtdlOutputPreLoadedMsg(
                        /* If there's no file open by this time, the requested
                         * section wasn't found, so print an error
                         */
-                       if (CCC->download_fp == NULL) {
+                       if (CC->download_fp == NULL) {
                                if (do_proto) cprintf(
                                        "%d Section %s not found.\n",
                                        ERROR + FILE_NOT_FOUND,
-                                       CCC->download_desired_section);
+                                       CC->download_desired_section);
                        }
                }
-               return((CCC->download_fp != NULL) ? om_ok : om_mime_error);
+               return((CC->download_fp != NULL) ? om_ok : om_mime_error);
        }
 
        /* MT_SPEW_SECTION is like MT_DOWNLOAD except it outputs the whole MIME part
@@ -2178,10 +2158,10 @@ int CtdlOutputPreLoadedMsg(
                                if (do_proto) cprintf(
                                        "%d Section %s not found.\n",
                                        ERROR + FILE_NOT_FOUND,
-                                       CCC->download_desired_section);
+                                       CC->download_desired_section);
                        }
                }
-               return((CCC->download_fp != NULL) ? om_ok : om_mime_error);
+               return((CC->download_fp != NULL) ? om_ok : om_mime_error);
        }
 
        /* now for the user-mode message reading loops */
@@ -2326,7 +2306,7 @@ START_TEXT:
                        ma.use_fo_hooks = 0;
                        strcpy(ma.chosen_part, "1");
                        ma.chosen_pref = 9999;
-                       ma.dont_decode = CCC->msg4_dont_decode;
+                       ma.dont_decode = CC->msg4_dont_decode;
                        mime_parser(CM_RANGE(TheMessage, eMesageText),
                                    *choose_preferred, *fixed_output_pre,
                                    *fixed_output_post, (void *)&ma, 1);
@@ -2361,7 +2341,6 @@ DONE:     /* now we're done */
 int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newmsgs,
                        int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj
 ) {
-       struct CitContext *CCC = CC;
        int i, j, unique;
        char hold_rm[ROOMNAMELEN];
        struct cdbdata *cdbfr;
@@ -2375,12 +2354,12 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        long *msgs_to_be_merged = NULL;
        int num_msgs_to_be_merged = 0;
 
-       MSG_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                   "CtdlSaveMsgPointersInRoom(room=%s, num_msgs=%d, repl=%d, suppress_rca=%d)\n",
                   roomname, num_newmsgs, do_repl_check, suppress_refcount_adj
        );
 
-       strcpy(hold_rm, CCC->room.QRname);
+       strcpy(hold_rm, CC->room.QRname);
 
        /* Sanity checks */
        if (newmsgidlist == NULL) return(ERROR + INTERNAL_ERROR);
@@ -2388,10 +2367,10 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        if (num_newmsgs > 1) supplied_msg = NULL;
 
        /* Now the regular stuff */
-       if (CtdlGetRoomLock(&CCC->room,
-          ((roomname != NULL) ? roomname : CCC->room.QRname) )
+       if (CtdlGetRoomLock(&CC->room,
+          ((roomname != NULL) ? roomname : CC->room.QRname) )
           != 0) {
-               MSG_syslog(LOG_ERR, "No such room <%s>\n", roomname);
+               syslog(LOG_ERR, "No such room <%s>\n", roomname);
                return(ERROR + ROOM_NOT_FOUND);
        }
 
@@ -2400,7 +2379,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        num_msgs_to_be_merged = 0;
 
 
-       cdbfr = cdb_fetch(CDB_MSGLISTS, &CCC->room.QRnumber, sizeof(long));
+       cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
        if (cdbfr == NULL) {
                msglist = NULL;
                num_msgs = 0;
@@ -2428,14 +2407,14 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
                }
        }
 
-       MSG_syslog(LOG_DEBUG, "%d unique messages to be merged\n", num_msgs_to_be_merged);
+       syslog(LOG_DEBUG, "%d unique messages to be merged\n", num_msgs_to_be_merged);
 
        /*
         * Now merge the new messages
         */
        msglist = realloc(msglist, (sizeof(long) * (num_msgs + num_msgs_to_be_merged)) );
        if (msglist == NULL) {
-               MSGM_syslog(LOG_ALERT, "ERROR: can't realloc message list!\n");
+               syslog(LOG_ALERT, "ERROR: can't realloc message list!\n");
                free(msgs_to_be_merged);
                return (ERROR + INTERNAL_ERROR);
        }
@@ -2449,19 +2428,19 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        highest_msg = msglist[num_msgs - 1];
 
        /* Write it back to disk. */
-       cdb_store(CDB_MSGLISTS, &CCC->room.QRnumber, (int)sizeof(long),
+       cdb_store(CDB_MSGLISTS, &CC->room.QRnumber, (int)sizeof(long),
                  msglist, (int)(num_msgs * sizeof(long)));
 
        /* Free up the memory we used. */
        free(msglist);
 
        /* Update the highest-message pointer and unlock the room. */
-       CCC->room.QRhighest = highest_msg;
-       CtdlPutRoomLock(&CCC->room);
+       CC->room.QRhighest = highest_msg;
+       CtdlPutRoomLock(&CC->room);
 
        /* Perform replication checks if necessary */
-       if ( (DoesThisRoomNeedEuidIndexing(&CCC->room)) && (do_repl_check) ) {
-               MSGM_syslog(LOG_DEBUG, "CtdlSaveMsgPointerInRoom() doing repl checks\n");
+       if ( (DoesThisRoomNeedEuidIndexing(&CC->room)) && (do_repl_check) ) {
+               syslog(LOG_DEBUG, "CtdlSaveMsgPointerInRoom() doing repl checks\n");
 
                for (i=0; i<num_msgs_to_be_merged; ++i) {
                        msgid = msgs_to_be_merged[i];
@@ -2478,7 +2457,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
                
                                /* If the message has an Exclusive ID, index that... */
                                if (!CM_IsEmpty(msg, eExclusiveID)) {
-                                       index_message_by_euid(msg->cm_fields[eExclusiveID], &CCC->room, msgid);
+                                       index_message_by_euid(msg->cm_fields[eExclusiveID], &CC->room, msgid);
                                }
 
                                /* Free up the memory we may have allocated */
@@ -2491,14 +2470,14 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms
        }
 
        else {
-               MSGM_syslog(LOG_DEBUG, "CtdlSaveMsgPointerInRoom() skips repl checks\n");
+               syslog(LOG_DEBUG, "CtdlSaveMsgPointerInRoom() skips repl checks\n");
        }
 
        /* Submit this room for processing by hooks */
-       PerformRoomHooks(&CCC->room);
+       PerformRoomHooks(&CC->room);
 
        /* Go back to the room we were in before we wandered here... */
-       CtdlGetRoom(&CCC->room, hold_rm);
+       CtdlGetRoom(&CC->room, hold_rm);
 
        /* Bump the reference count for all messages which were merged */
        if (!suppress_refcount_adj) {
@@ -2537,7 +2516,6 @@ int CtdlSaveMsgPointerInRoom(char *roomname, long msgid,
  *
  */
 long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply) {
-       struct CitContext *CCC = CC;
        long retval;
        struct ser_ret smr;
        int is_bigmsg = 0;
@@ -2572,7 +2550,7 @@ long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply) {
                                ERROR + INTERNAL_ERROR);
                }
                else {
-                       MSGM_syslog(LOG_ERR, "CtdlSaveMessage() unable to serialize message");
+                       syslog(LOG_ERR, "CtdlSaveMessage() unable to serialize message");
 
                }
                return (-1L);
@@ -2582,7 +2560,7 @@ long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply) {
        retval = cdb_store(CDB_MSGMAIN, &msgid, (int)sizeof(long),
                           smr.ser, smr.len);
        if (retval < 0) {
-               MSG_syslog(LOG_ERR, "Can't store message %ld: %ld", msgid, retval);
+               syslog(LOG_ERR, "Can't store message %ld: %ld", msgid, retval);
        }
        else {
                if (is_bigmsg) {
@@ -2593,7 +2571,7 @@ long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply) {
                                           (holdMLen + 1)
                                );
                        if (retval < 0) {
-                               MSG_syslog(LOG_ERR, "failed to store message body for msgid %ld:  %ld",
+                               syslog(LOG_ERR, "failed to store message body for msgid %ld:  %ld",
                                           msgid, retval);
                        }
                }
@@ -2649,7 +2627,6 @@ long send_message(struct CtdlMessage *msg) {
 void CtdlSerializeMessage(struct ser_ret *ret,         /* return values */
                          struct CtdlMessage *msg)      /* unserialized msg */
 {
-       struct CitContext *CCC = CC;
        size_t wlen;
        int i;
 
@@ -2657,7 +2634,7 @@ void CtdlSerializeMessage(struct ser_ret *ret,            /* return values */
         * Check for valid message format
         */
        if (CM_IsValidMsg(msg) == 0) {
-               MSGM_syslog(LOG_ERR, "CtdlSerializeMessage() aborting due to invalid message\n");
+               syslog(LOG_ERR, "CtdlSerializeMessage() aborting due to invalid message\n");
                ret->len = 0;
                ret->ser = NULL;
                return;
@@ -2670,7 +2647,7 @@ void CtdlSerializeMessage(struct ser_ret *ret,            /* return values */
 
        ret->ser = malloc(ret->len);
        if (ret->ser == NULL) {
-               MSG_syslog(LOG_ERR, "CtdlSerializeMessage() malloc(%ld) failed: %s\n",
+               syslog(LOG_ERR, "CtdlSerializeMessage() malloc(%ld) failed: %s\n",
                           (long)ret->len, strerror(errno));
                ret->len = 0;
                ret->ser = NULL;
@@ -2695,7 +2672,7 @@ void CtdlSerializeMessage(struct ser_ret *ret,            /* return values */
                }
 
        if (ret->len != wlen) {
-               MSG_syslog(LOG_ERR, "ERROR: len=%ld wlen=%ld\n",
+               syslog(LOG_ERR, "ERROR: len=%ld wlen=%ld\n",
                           (long)ret->len, (long)wlen);
        }
 
@@ -2708,25 +2685,24 @@ void CtdlSerializeMessage(struct ser_ret *ret,          /* return values */
  * carry the same Exclusive ID as this one.  If any are found, delete them.
  */
 void ReplicationChecks(struct CtdlMessage *msg) {
-       struct CitContext *CCC = CC;
        long old_msgnum = (-1L);
 
-       if (DoesThisRoomNeedEuidIndexing(&CCC->room) == 0) return;
+       if (DoesThisRoomNeedEuidIndexing(&CC->room) == 0) return;
 
-       MSG_syslog(LOG_DEBUG, "Performing replication checks in <%s>\n",
-                  CCC->room.QRname);
+       syslog(LOG_DEBUG, "Performing replication checks in <%s>\n",
+                  CC->room.QRname);
 
        /* No exclusive id?  Don't do anything. */
        if (msg == NULL) return;
        if (CM_IsEmpty(msg, eExclusiveID)) return;
 
-       /*MSG_syslog(LOG_DEBUG, "Exclusive ID: <%s> for room <%s>\n",
-         msg->cm_fields[eExclusiveID], CCC->room.QRname);*/
+       /*syslog(LOG_DEBUG, "Exclusive ID: <%s> for room <%s>\n",
+         msg->cm_fields[eExclusiveID], CC->room.QRname);*/
 
-       old_msgnum = CtdlLocateMessageByEuid(msg->cm_fields[eExclusiveID], &CCC->room);
+       old_msgnum = CtdlLocateMessageByEuid(msg->cm_fields[eExclusiveID], &CC->room);
        if (old_msgnum > 0L) {
-               MSG_syslog(LOG_DEBUG, "ReplicationChecks() replacing message %ld\n", old_msgnum);
-               CtdlDeleteMessages(CCC->room.QRname, &old_msgnum, 1, "");
+               syslog(LOG_DEBUG, "ReplicationChecks() replacing message %ld\n", old_msgnum);
+               CtdlDeleteMessages(CC->room.QRname, &old_msgnum, 1, "");
        }
 }
 
@@ -2757,9 +2733,8 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        struct addresses_to_be_filed *aptr = NULL;
        StrBuf *saved_rfc822_version = NULL;
        int qualified_for_journaling = 0;
-       CitContext *CCC = MyContext();
 
-       MSGM_syslog(LOG_DEBUG, "CtdlSubmitMsg() called\n");
+       syslog(LOG_DEBUG, "CtdlSubmitMsg() called\n");
        if (CM_IsValidMsg(msg) == 0) return(-1);        /* self check */
 
        /* If this message has no timestamp, we take the liberty of
@@ -2794,7 +2769,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
 
        /* Learn about what's inside, because it's what's inside that counts */
        if (CM_IsEmpty(msg, eMesageText)) {
-               MSGM_syslog(LOG_ERR, "ERROR: attempt to save message with NULL body\n");
+               syslog(LOG_ERR, "ERROR: attempt to save message with NULL body\n");
                return(-2);
        }
 
@@ -2826,20 +2801,20 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        }
 
        /* Goto the correct room */
-       room = (recps) ? CCC->room.QRname : SENTITEMS;
-       MSG_syslog(LOG_DEBUG, "Selected room %s\n", room);
-       strcpy(hold_rm, CCC->room.QRname);
-       strcpy(actual_rm, CCC->room.QRname);
+       room = (recps) ? CC->room.QRname : SENTITEMS;
+       syslog(LOG_DEBUG, "Selected room %s\n", room);
+       strcpy(hold_rm, CC->room.QRname);
+       strcpy(actual_rm, CC->room.QRname);
        if (recps != NULL) {
                strcpy(actual_rm, SENTITEMS);
        }
 
        /* If the user is a twit, move to the twit room for posting */
        if (TWITDETECT) {
-               if (CCC->user.axlevel == AxProbU) {
+               if (CC->user.axlevel == AxProbU) {
                        strcpy(hold_rm, actual_rm);
                        strcpy(actual_rm, CtdlGetConfigStr("c_twitroom"));
-                       MSGM_syslog(LOG_DEBUG, "Diverting to twit room\n");
+                       syslog(LOG_DEBUG, "Diverting to twit room\n");
                }
        }
 
@@ -2848,33 +2823,33 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
                strcpy(actual_rm, force_room);
        }
 
-       MSG_syslog(LOG_DEBUG, "Final selection: %s (%s)\n", actual_rm, room);
-       if (strcasecmp(actual_rm, CCC->room.QRname)) {
-               /* CtdlGetRoom(&CCC->room, actual_rm); */
+       syslog(LOG_DEBUG, "Final selection: %s (%s)\n", actual_rm, room);
+       if (strcasecmp(actual_rm, CC->room.QRname)) {
+               /* CtdlGetRoom(&CC->room, actual_rm); */
                CtdlUserGoto(actual_rm, 0, 1, NULL, NULL, NULL, NULL);
        }
 
        /*
         * If this message has no O (room) field, generate one.
         */
-       if (CM_IsEmpty(msg, eOriginalRoom) && !IsEmptyStr(CCC->room.QRname)) {
-               CM_SetField(msg, eOriginalRoom, CCC->room.QRname, strlen(CCC->room.QRname));
+       if (CM_IsEmpty(msg, eOriginalRoom) && !IsEmptyStr(CC->room.QRname)) {
+               CM_SetField(msg, eOriginalRoom, CC->room.QRname, strlen(CC->room.QRname));
        }
 
        /* Perform "before save" hooks (aborting if any return nonzero) */
-       MSGM_syslog(LOG_DEBUG, "Performing before-save hooks\n");
+       syslog(LOG_DEBUG, "Performing before-save hooks\n");
        if (PerformMessageHooks(msg, recps, EVT_BEFORESAVE) > 0) return(-3);
 
        /*
         * If this message has an Exclusive ID, and the room is replication
         * checking enabled, then do replication checks.
         */
-       if (DoesThisRoomNeedEuidIndexing(&CCC->room)) {
+       if (DoesThisRoomNeedEuidIndexing(&CC->room)) {
                ReplicationChecks(msg);
        }
 
        /* Save it to disk */
-       MSGM_syslog(LOG_DEBUG, "Saving to disk\n");
+       syslog(LOG_DEBUG, "Saving to disk\n");
        newmsgid = send_message(msg);
        if (newmsgid <= 0L) return(-5);
 
@@ -2882,7 +2857,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
         * be a critical section because nobody else knows about this message
         * yet.
         */
-       MSGM_syslog(LOG_DEBUG, "Creating MetaData record\n");
+       syslog(LOG_DEBUG, "Creating MetaData record\n");
        memset(&smi, 0, sizeof(struct MetaData));
        smi.meta_msgnum = newmsgid;
        smi.meta_refcount = 0;
@@ -2899,28 +2874,28 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
         * 2. If journaling is enabled, we will need an RFC822 version of the
         *    message to attach to the journalized copy.
         */
-       if (CCC->redirect_buffer != NULL) {
-               MSGM_syslog(LOG_ALERT, "CCC->redirect_buffer is not NULL during message submission!\n");
+       if (CC->redirect_buffer != NULL) {
+               syslog(LOG_ALERT, "CC->redirect_buffer is not NULL during message submission!\n");
                abort();
        }
-       CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
+       CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
        CtdlOutputPreLoadedMsg(msg, MT_RFC822, HEADERS_ALL, 0, 1, QP_EADDR);
-       smi.meta_rfc822_length = StrLength(CCC->redirect_buffer);
-       saved_rfc822_version = CCC->redirect_buffer;
-       CCC->redirect_buffer = NULL;
+       smi.meta_rfc822_length = StrLength(CC->redirect_buffer);
+       saved_rfc822_version = CC->redirect_buffer;
+       CC->redirect_buffer = NULL;
 
        PutMetaData(&smi);
 
        /* Now figure out where to store the pointers */
-       MSGM_syslog(LOG_DEBUG, "Storing pointers\n");
+       syslog(LOG_DEBUG, "Storing pointers\n");
 
        /* If this is being done by the networker delivering a private
         * message, we want to BYPASS saving the sender's copy (because there
         * is no local sender; it would otherwise go to the Trashcan).
         */
-       if ((!CCC->internal_pgm) || (recps == NULL)) {
+       if ((!CC->internal_pgm) || (recps == NULL)) {
                if (CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 1, msg) != 0) {
-                       MSGM_syslog(LOG_ERR, "ERROR saving message pointer!\n");
+                       syslog(LOG_ERR, "ERROR saving message pointer!\n");
                        CtdlSaveMsgPointerInRoom(CtdlGetConfigStr("c_aideroom"), newmsgid, 0, msg);
                }
        }
@@ -2935,22 +2910,22 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
                for (i=0; i<num_tokens(recps->recp_room, '|'); ++i) {
                        extract_token(recipient, recps->recp_room, i,
                                      '|', sizeof recipient);
-                       MSG_syslog(LOG_DEBUG, "Delivering to room <%s>\n", recipient);///// xxxx
+                       syslog(LOG_DEBUG, "Delivering to room <%s>\n", recipient);///// xxxx
                        CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0, msg);
                }
 
        /* Bump this user's messages posted counter. */
-       MSGM_syslog(LOG_DEBUG, "Updating user\n");
+       syslog(LOG_DEBUG, "Updating user\n");
        CtdlLockGetCurrentUser();
-       CCC->user.posted = CCC->user.posted + 1;
+       CC->user.posted = CC->user.posted + 1;
        CtdlPutCurrentUserLock();
 
        /* Decide where bounces need to be delivered */
        if ((recps != NULL) && (recps->bounce_to == NULL))
        {
-               if (CCC->logged_in) 
+               if (CC->logged_in) 
                        snprintf(bounce_to, sizeof bounce_to, "%s@%s",
-                                CCC->user.fullname, CtdlGetConfigStr("c_nodename"));
+                                CC->user.fullname, CtdlGetConfigStr("c_nodename"));
                else 
                        snprintf(bounce_to, sizeof bounce_to, "%s@%s",
                                 msg->cm_fields[eAuthor], msg->cm_fields[eNodeName]);
@@ -2974,7 +2949,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
                for (i=0; i<ntokens; ++i)
                {
                        extract_token(recipient, pch, i, '|', sizeof recipient);
-                       MSG_syslog(LOG_DEBUG, "Delivering private local mail to <%s>\n", recipient);
+                       syslog(LOG_DEBUG, "Delivering private local mail to <%s>\n", recipient);
                        if (CtdlGetUser(&userbuf, recipient) == 0) {
                                CtdlMailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
                                CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0, msg);
@@ -2982,7 +2957,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
                                PerformMessageHooks(msg, recps, EVT_AFTERUSRMBOXSAVE);
                        }
                        else {
-                               MSG_syslog(LOG_DEBUG, "No user <%s>\n", recipient);
+                               syslog(LOG_DEBUG, "No user <%s>\n", recipient);
                                CtdlSaveMsgPointerInRoom(CtdlGetConfigStr("c_aideroom"), newmsgid, 0, msg);
                        }
                }
@@ -2990,20 +2965,20 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        }
 
        /* Perform "after save" hooks */
-       MSGM_syslog(LOG_DEBUG, "Performing after-save hooks\n");
+       syslog(LOG_DEBUG, "Performing after-save hooks\n");
 
        PerformMessageHooks(msg, recps, EVT_AFTERSAVE);
        CM_FlushField(msg, eVltMsgNum);
 
        /* Go back to the room we started from */
-       MSG_syslog(LOG_DEBUG, "Returning to original room %s\n", hold_rm);
-       if (strcasecmp(hold_rm, CCC->room.QRname))
+       syslog(LOG_DEBUG, "Returning to original room %s\n", hold_rm);
+       if (strcasecmp(hold_rm, CC->room.QRname))
                CtdlUserGoto(hold_rm, 0, 1, NULL, NULL, NULL, NULL);
 
        /*
         * Any addresses to harvest for someone's address book?
         */
-       if ( (CCC->logged_in) && (recps != NULL) ) {
+       if ( (CC->logged_in) && (recps != NULL) ) {
                collected_addresses = harvest_collected_addresses(msg);
        }
 
@@ -3011,7 +2986,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
                aptr = (struct addresses_to_be_filed *)
                        malloc(sizeof(struct addresses_to_be_filed));
                CtdlMailboxName(actual_rm, sizeof actual_rm,
-                               &CCC->user, USERCONTACTSROOM);
+                               &CC->user, USERCONTACTSROOM);
                aptr->roomname = strdup(actual_rm);
                aptr->collected_addresses = collected_addresses;
                begin_critical_section(S_ATBF);
@@ -3130,7 +3105,6 @@ void flood_protect_quickie_message(const char *from,
                                   long ioid,
                                   time_t NOW)
 {
-       struct CitContext *CCC = CC;
        int i;
        u_char rawdigest[MD5_DIGEST_LEN];
        struct MD5Context md5context;
@@ -3168,13 +3142,13 @@ void flood_protect_quickie_message(const char *from,
        {
                FreeStrBuf(&guid);
                /* yes, we did. flood protection kicks in. */
-               MSG_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                           "not sending message again - %ld < %ld \n", seenstamp, tsday);
                return;
        }
        else
        {
-               MSG_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                           "sending message. %ld >= %ld", seenstamp, tsday);
                FreeStrBuf(&guid);
                /* no, this message isn't sent recently; go ahead. */
@@ -3528,7 +3502,6 @@ struct CtdlMessage *CtdlMakeMessageLen(
        long reflen
        )
 {
-       struct CitContext *CCC = CC;
        /* Don't confuse the poor folks if it's not routed mail. * /
           char dest_node[256] = "";*/
        long blen;
@@ -3568,12 +3541,12 @@ struct CtdlMessage *CtdlMakeMessageLen(
        CM_SetAsFieldSB(msg, eAuthor, &FakeEncAuthor);
        FreeStrBuf(&FakeAuthor);
 
-       if (!!IsEmptyStr(CCC->room.QRname)) {
-               if (CCC->room.QRflags & QR_MAILBOX) {           /* room */
-                       CM_SetField(msg, eOriginalRoom, &CCC->room.QRname[11], strlen(&CCC->room.QRname[11]));
+       if (!!IsEmptyStr(CC->room.QRname)) {
+               if (CC->room.QRflags & QR_MAILBOX) {            /* room */
+                       CM_SetField(msg, eOriginalRoom, &CC->room.QRname[11], strlen(&CC->room.QRname[11]));
                }
                else {
-                       CM_SetField(msg, eOriginalRoom, CCC->room.QRname, strlen(CCC->room.QRname));
+                       CM_SetField(msg, eOriginalRoom, CC->room.QRname, strlen(CC->room.QRname));
                }
        }
 
@@ -3590,8 +3563,8 @@ struct CtdlMessage *CtdlMakeMessageLen(
        if (myelen > 0) {
                CM_SetField(msg, erFc822Addr, my_email, myelen);
        }
-       else if ( (author == &CCC->user) && (!IsEmptyStr(CCC->cs_inet_email)) ) {
-               CM_SetField(msg, erFc822Addr, CCC->cs_inet_email, strlen(CCC->cs_inet_email));
+       else if ( (author == &CC->user) && (!IsEmptyStr(CC->cs_inet_email)) ) {
+               CM_SetField(msg, erFc822Addr, CC->cs_inet_email, strlen(CC->cs_inet_email));
        }
 
        if (subject != NULL) {
@@ -3652,7 +3625,6 @@ int CtdlDeleteMessages(const char *room_name,             /* which room */
                       char *content_type       /* or "" for any.  regular expressions expected. */
        )
 {
-       struct CitContext *CCC = CC;
        struct ctdlroom qrbuf;
        struct cdbdata *cdbfr;
        long *msglist = NULL;
@@ -3670,12 +3642,12 @@ int CtdlDeleteMessages(const char *room_name,           /* which room */
                        regcomp(&re, content_type, 0);
                        need_to_free_re = 1;
                }
-       MSG_syslog(LOG_DEBUG, " CtdlDeleteMessages(%s, %d msgs, %s)\n",
+       syslog(LOG_DEBUG, " CtdlDeleteMessages(%s, %d msgs, %s)\n",
                   room_name, num_dmsgnums, content_type);
 
        /* get room record, obtaining a lock... */
        if (CtdlGetRoomLock(&qrbuf, room_name) != 0) {
-               MSG_syslog(LOG_ERR, " CtdlDeleteMessages(): Room <%s> not found\n",
+               syslog(LOG_ERR, " CtdlDeleteMessages(): Room <%s> not found\n",
                           room_name);
                if (need_to_free_re) regfree(&re);
                return (0);     /* room not found */
@@ -3702,7 +3674,7 @@ int CtdlDeleteMessages(const char *room_name,             /* which room */
                        StrBuf *dbg = NewStrBuf();
                        for (i = 0; i < num_dmsgnums; i++)
                                StrBufAppendPrintf(dbg, ", %ld", dmsgnums[i]);
-                       MSG_syslog(LOG_DEBUG, " Deleting before: %s", ChrPtr(dbg));
+                       syslog(LOG_DEBUG, " Deleting before: %s", ChrPtr(dbg));
                        FreeStrBuf(&dbg);
                }
 */
@@ -3752,7 +3724,7 @@ int CtdlDeleteMessages(const char *room_name,             /* which room */
                        StrBuf *dbg = NewStrBuf();
                        for (i = 0; i < num_deleted; i++)
                                StrBufAppendPrintf(dbg, ", %ld", dellist[i]);
-                       MSG_syslog(LOG_DEBUG, " Deleting: %s", ChrPtr(dbg));
+                       syslog(LOG_DEBUG, " Deleting: %s", ChrPtr(dbg));
                        FreeStrBuf(&dbg);
                }
 */
@@ -3784,7 +3756,7 @@ int CtdlDeleteMessages(const char *room_name,             /* which room */
        /* Now free the memory we used, and go away. */
        if (msglist != NULL) free(msglist);
        if (dellist != NULL) free(dellist);
-       MSG_syslog(LOG_DEBUG, " %d message(s) deleted.\n", num_deleted);
+       syslog(LOG_DEBUG, " %d message(s) deleted.\n", num_deleted);
        if (need_to_free_re) regfree(&re);
        return (num_deleted);
 }
@@ -3842,11 +3814,10 @@ void PutMetaData(struct MetaData *smibuf)
  */
 void AdjRefCount(long msgnum, int incr)
 {
-       struct CitContext *CCC = CC;
        struct arcq new_arcq;
        int rv = 0;
 
-       MSG_syslog(LOG_DEBUG, "AdjRefCount() msg %ld ref count delta %+d\n", msgnum, incr);
+       syslog(LOG_DEBUG, "AdjRefCount() msg %ld ref count delta %+d\n", msgnum, incr);
 
        begin_critical_section(S_SUPPMSGMAIN);
        if (arcfp == NULL) {
@@ -3858,7 +3829,7 @@ void AdjRefCount(long msgnum, int incr)
 
        /* msgnum < 0 means that we're trying to close the file */
        if (msgnum < 0) {
-               MSGM_syslog(LOG_DEBUG, "Closing the AdjRefCount queue file\n");
+               syslog(LOG_DEBUG, "Closing the AdjRefCount queue file\n");
                begin_critical_section(S_SUPPMSGMAIN);
                if (arcfp != NULL) {
                        fclose(arcfp);
@@ -3880,7 +3851,7 @@ void AdjRefCount(long msgnum, int incr)
        new_arcq.arcq_delta = incr;
        rv = fwrite(&new_arcq, sizeof(struct arcq), 1, arcfp);
        if (rv == -1) {
-               MSG_syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n",
+               syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n",
                           file_arcq,
                           strerror(errno));
        }
@@ -3891,12 +3862,11 @@ void AdjRefCount(long msgnum, int incr)
 
 void AdjRefCountList(long *msgnum, long nmsg, int incr)
 {
-       struct CitContext *CCC = CC;
        long i, the_size, offset;
        struct arcq *new_arcq;
        int rv = 0;
 
-       MSG_syslog(LOG_DEBUG, "AdjRefCountList() msg %ld ref count delta %+d\n", nmsg, incr);
+       syslog(LOG_DEBUG, "AdjRefCountList() msg %ld ref count delta %+d\n", nmsg, incr);
 
        begin_critical_section(S_SUPPMSGMAIN);
        if (arcfp == NULL) {
@@ -3927,7 +3897,7 @@ void AdjRefCountList(long *msgnum, long nmsg, int incr)
        {
                rv = fwrite(new_arcq + offset, 1, the_size - offset, arcfp);
                if (rv == -1) {
-                       MSG_syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n",
+                       syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n",
                                   file_arcq,
                                   strerror(errno));
                }
@@ -3951,7 +3921,6 @@ void AdjRefCountList(long *msgnum, long nmsg, int incr)
  */
 int TDAP_ProcessAdjRefCountQueue(void)
 {
-       struct CitContext *CCC = CC;
        char file_arcq_temp[PATH_MAX];
        int r;
        FILE *fp;
@@ -3968,7 +3937,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
 
        r = link(file_arcq, file_arcq_temp);
        if (r != 0) {
-               MSG_syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
+               syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
                end_critical_section(S_SUPPMSGMAIN);
                return(num_records_processed);
        }
@@ -3978,7 +3947,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
 
        fp = fopen(file_arcq_temp, "rb");
        if (fp == NULL) {
-               MSG_syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
+               syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
                return(num_records_processed);
        }
 
@@ -3990,7 +3959,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
        fclose(fp);
        r = unlink(file_arcq_temp);
        if (r != 0) {
-               MSG_syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
+               syslog(LOG_CRIT, "%s: %s\n", file_arcq_temp, strerror(errno));
        }
 
        return(num_records_processed);
@@ -4008,7 +3977,6 @@ int TDAP_ProcessAdjRefCountQueue(void)
  */
 void TDAP_AdjRefCount(long msgnum, int incr)
 {
-       struct CitContext *CCC = CC;
 
        struct MetaData smi;
        long delnum;
@@ -4022,7 +3990,7 @@ void TDAP_AdjRefCount(long msgnum, int incr)
        smi.meta_refcount += incr;
        PutMetaData(&smi);
        end_critical_section(S_SUPPMSGMAIN);
-       MSG_syslog(LOG_DEBUG, "TDAP_AdjRefCount() msg %ld ref count delta %+d, is now %d\n",
+       syslog(LOG_DEBUG, "TDAP_AdjRefCount() msg %ld ref count delta %+d, is now %d\n",
                   msgnum, incr, smi.meta_refcount
                );
 
@@ -4030,7 +3998,7 @@ void TDAP_AdjRefCount(long msgnum, int incr)
         * (and its supplementary record as well).
         */
        if (smi.meta_refcount == 0) {
-               MSG_syslog(LOG_DEBUG, "Deleting message <%ld>\n", msgnum);
+               syslog(LOG_DEBUG, "Deleting message <%ld>\n", msgnum);
                
                /* Call delete hooks with NULL room to show it has gone altogether */
                PerformDeleteHooks(NULL, msgnum);
@@ -4063,7 +4031,6 @@ void CtdlWriteObject(char *req_room,                      /* Room to stuff it in */
                     unsigned int flags         /* Internal save flags */
        )
 {
-       struct CitContext *CCC = CC;
        struct ctdlroom qrbuf;
        char roomname[ROOMNAMELEN];
        struct CtdlMessage *msg;
@@ -4076,7 +4043,7 @@ void CtdlWriteObject(char *req_room,                      /* Room to stuff it in */
                safestrncpy(roomname, req_room, sizeof(roomname));
        }
 
-       MSG_syslog(LOG_DEBUG, "Raw length is %ld\n", (long)raw_length);
+       syslog(LOG_DEBUG, "Raw length is %ld\n", (long)raw_length);
 
        if (is_binary) {
                encoded_message = NewStrBufPlain(NULL, (size_t) (((raw_length * 134) / 100) + 4096 ) );
@@ -4103,13 +4070,13 @@ void CtdlWriteObject(char *req_room,                    /* Room to stuff it in */
                StrBufAppendBufPlain(encoded_message, raw_message, raw_length, 0);
        }
 
-       MSGM_syslog(LOG_DEBUG, "Allocating\n");
+       syslog(LOG_DEBUG, "Allocating\n");
        msg = malloc(sizeof(struct CtdlMessage));
        memset(msg, 0, sizeof(struct CtdlMessage));
        msg->cm_magic = CTDLMESSAGE_MAGIC;
        msg->cm_anon_type = MES_NORMAL;
        msg->cm_format_type = 4;
-       CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
+       CM_SetField(msg, eAuthor, CC->user.fullname, strlen(CC->user.fullname));
        CM_SetField(msg, eOriginalRoom, req_room, strlen(req_room));
        CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
        CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
@@ -4127,7 +4094,7 @@ void CtdlWriteObject(char *req_room,                      /* Room to stuff it in */
         * other objects of this type that are currently in the room.
         */
        if (is_unique) {
-               MSG_syslog(LOG_DEBUG, "Deleted %d other msgs of this type\n",
+               syslog(LOG_DEBUG, "Deleted %d other msgs of this type\n",
                           CtdlDeleteMessages(roomname, NULL, 0, content_type)
                        );
        }
@@ -4141,15 +4108,11 @@ void CtdlWriteObject(char *req_room,                    /* Room to stuff it in */
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
-void SetMessageDebugEnabled(const int n)
-{
-       MessageDebugEnabled = n;
-}
+
 CTDL_MODULE_INIT(msgbase)
 {
        if (!threading) {
                FillMsgKeyLookupTable();
-               CtdlRegisterDebugFlagHook(HKEY("messages"), SetMessageDebugEnabled, &MessageDebugEnabled);
        }
 
         /* return our Subversion id for the Log */
index a38cd35db49d83216a367652595398f4d880418b..34d698442c08c6f3218ea80fe8d160eb0b31751c 100644 (file)
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2012 by the citadel.org team
+ * Copyright (c) 2000-2017 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License, version 3.
@@ -22,8 +22,6 @@
 /*-----------------------------------------------------------------------------*
  *                 Network maps: evaluate other nodes                          *
  *-----------------------------------------------------------------------------*/
-int NTTDebugEnabled = 0;
-int NTTDumpEnabled = 0;
 
 /*
  * network_talking_to()  --  concurrency checker
@@ -44,7 +42,7 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation)
                        if (nttlist == NULL) 
                                nttlist = NewHash(1, NULL);
                        Put(nttlist, nodename, len, NewStrBufPlain(nodename, len), HFreeStrBuf);
-                       if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: added <%s>\n", nodename);
+                       syslog(LOG_DEBUG, "nttlist: added <%s>\n", nodename);
                        break;
                case NTT_REMOVE:
                        if ((nttlist == NULL) ||
@@ -54,7 +52,7 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation)
                        if (GetHashPosFromKey (nttlist, nodename, len, Pos))
                                DeleteEntryFromHash(nttlist, Pos);
                        DeleteHashPos(&Pos);
-                       if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename);
+                       syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename);
 
                        break;
 
@@ -64,33 +62,10 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation)
                                break;
                        if (GetHash(nttlist, nodename, len, &vdata))
                                retval ++;
-                       if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: have [%d] <%s>\n", retval, nodename);
+                       syslog(LOG_DEBUG, "nttlist: have [%d] <%s>\n", retval, nodename);
                        break;
        }
 
-       if (NTTDumpEnabled)
-       {
-               HashPos *It;
-               StrBuf *NTTDump;
-               long len;
-               const char *Key;
-               void *v;
-               NTTDump = NewStrBuf ();
-
-               It = GetNewHashPos(nttlist, 0);
-               while (GetNextHashPos(nttlist, It, &len, &Key, &v))
-               {
-                       if (StrLength(NTTDump) > 0)
-                               StrBufAppendBufPlain(NTTDump, HKEY("|"), 0);
-                       StrBufAppendBuf(NTTDump, (StrBuf*) v, 0);
-               }
-               DeleteHashPos(&It);
-
-               syslog(LOG_DEBUG, "nttlist: Dump: [%d] <%s>\n", 
-                      GetCount(nttlist),
-                      ChrPtr(NTTDump));
-               FreeStrBuf(&NTTDump);
-       }
        end_critical_section(S_NTTLIST);
        return(retval);
 }
@@ -104,20 +79,6 @@ void cleanup_nttlist(void)
 
 
 
-/*
- * Module entry point
- */
-void SetNTTDebugEnabled(const int n)
-{
-       NTTDebugEnabled = n;
-}
-
-void SetNTTDumpEnabled(const int n)
-{
-       NTTDumpEnabled = n;
-}
-
-
 
 /*
  * Module entry point
@@ -126,9 +87,6 @@ CTDL_MODULE_INIT(nttlist)
 {
        if (!threading)
        {
-               CtdlRegisterDebugFlagHook(HKEY("networktalkingto"), SetNTTDebugEnabled, &NTTDebugEnabled);
-               CtdlRegisterDebugFlagHook(HKEY("dumpnetworktalkingto"), SetNTTDumpEnabled, &NTTDumpEnabled);
-
                CtdlRegisterCleanupHook(cleanup_nttlist);
        }
        return "nttlist";
index f4a963cf7bf9ad2c124449ad8e7b9103dbaffafe..ebb348c3f3097b38ed6911711f7300491cc741e0 100644 (file)
@@ -259,8 +259,8 @@ void LogPrintMessages(long err)
        StrBufAppendBufPlain(Message, HKEY("\n\n"), 0);
        StrBufAppendBufPlain(Message, CKEY(ErrGeneral[3]), 0);
 
-       MOD_syslog(LOG_EMERG, "%s", ChrPtr(Message));
-       MOD_syslog(LOG_EMERG, "%s", ErrSubject);
+       syslog(LOG_EMERG, "%s", ChrPtr(Message));
+       syslog(LOG_EMERG, "%s", ErrSubject);
        quickie_message("Citadel", NULL, NULL, AIDEROOM, ChrPtr(Message), FMT_FIXED, ErrSubject);
 
        FreeStrBuf(&Message);
@@ -386,7 +386,7 @@ void CtdlRegisterProtoHook(void (*handler) (char *), char *cmd, char *desc)
        p->desc = desc;
 
        Put(ProtoHookList, cmd, 4, p, NULL);
-       MOD_syslog(LOG_DEBUG, "Registered server command %s (%s)\n", cmd, desc);
+       syslog(LOG_DEBUG, "Registered server command %s (%s)\n", cmd, desc);
 }
 
 void CtdlDestroyProtoHooks(void)
@@ -407,7 +407,7 @@ void CtdlRegisterCleanupHook(void (*fcn_ptr) (void))
        newfcn->h_function_pointer = fcn_ptr;
        CleanupHookTable = newfcn;
 
-       MODM_syslog(LOG_DEBUG, "Registered a new cleanup function\n");
+       syslog(LOG_DEBUG, "Registered a new cleanup function\n");
 }
 
 
@@ -420,7 +420,7 @@ void CtdlUnregisterCleanupHook(void (*fcn_ptr) (void))
        {
                if (fcn_ptr == cur->h_function_pointer)
                {
-                       MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
+                       syslog(LOG_DEBUG, "Unregistered cleanup function\n");
                        p = cur->next;
 
                        free(cur);
@@ -447,7 +447,7 @@ void CtdlDestroyCleanupHooks(void)
        cur = CleanupHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
+               syslog(LOG_DEBUG, "Destroyed cleanup function\n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -466,7 +466,7 @@ void CtdlRegisterEVCleanupHook(void (*fcn_ptr) (void))
        newfcn->h_function_pointer = fcn_ptr;
        EVCleanupHookTable = newfcn;
 
-       MODM_syslog(LOG_DEBUG, "Registered a new cleanup function\n");
+       syslog(LOG_DEBUG, "Registered a new cleanup function\n");
 }
 
 
@@ -479,7 +479,7 @@ void CtdlUnregisterEVCleanupHook(void (*fcn_ptr) (void))
        {
                if (fcn_ptr == cur->h_function_pointer)
                {
-                       MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
+                       syslog(LOG_DEBUG, "Unregistered cleanup function\n");
                        p = cur->next;
 
                        free(cur);
@@ -506,7 +506,7 @@ void CtdlDestroyEVCleanupHooks(void)
        cur = EVCleanupHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
+               syslog(LOG_DEBUG, "Destroyed cleanup function\n");
                p = cur->next;
                cur->h_function_pointer();
                free(cur);
@@ -535,7 +535,7 @@ void CtdlRegisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType, int Prior
        newfcn->next = *pfcn;
        *pfcn = newfcn;
        
-       MOD_syslog(LOG_DEBUG, "Registered a new TDAP Veto function (type %d Priority %d)\n",
+       syslog(LOG_DEBUG, "Registered a new TDAP Veto function (type %d Priority %d)\n",
                   EventType, Priority);
 }
 
@@ -549,7 +549,7 @@ void CtdlUnregisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType)
                if ((fcn_ptr == cur->h_function_pointer) &&
                    (EventType == cur->eventtype))
                {
-                       MOD_syslog(LOG_DEBUG, "Unregistered TDAP Veto function (type %d)\n",
+                       syslog(LOG_DEBUG, "Unregistered TDAP Veto function (type %d)\n",
                                   EventType);
                        p = cur->next;
 
@@ -576,7 +576,7 @@ void CtdlDestroyTDAPVetoHooks(void)
        cur = TDAPVetoHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed TDAP Veto function\n");
+               syslog(LOG_DEBUG, "Destroyed TDAP Veto function\n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -605,7 +605,7 @@ void CtdlRegisterSessionHook(void (*fcn_ptr) (void), int EventType, int Priority
        newfcn->next = *pfcn;
        *pfcn = newfcn;
        
-       MOD_syslog(LOG_DEBUG, "Registered a new session function (type %d Priority %d)\n",
+       syslog(LOG_DEBUG, "Registered a new session function (type %d Priority %d)\n",
                   EventType, Priority);
 }
 
@@ -619,7 +619,7 @@ void CtdlUnregisterSessionHook(void (*fcn_ptr) (void), int EventType)
                if ((fcn_ptr == cur->h_function_pointer) &&
                    (EventType == cur->eventtype))
                {
-                       MOD_syslog(LOG_DEBUG, "Unregistered session function (type %d)\n",
+                       syslog(LOG_DEBUG, "Unregistered session function (type %d)\n",
                                   EventType);
                        p = cur->next;
 
@@ -646,7 +646,7 @@ void CtdlDestroySessionHooks(void)
        cur = SessionHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed session function\n");
+               syslog(LOG_DEBUG, "Destroyed session function\n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -667,7 +667,7 @@ void CtdlRegisterUserHook(void (*fcn_ptr) (ctdluser *), int EventType)
        newfcn->eventtype = EventType;
        UserHookTable = newfcn;
 
-       MOD_syslog(LOG_DEBUG, "Registered a new user function (type %d)\n",
+       syslog(LOG_DEBUG, "Registered a new user function (type %d)\n",
                   EventType);
 }
 
@@ -681,7 +681,7 @@ void CtdlUnregisterUserHook(void (*fcn_ptr) (struct ctdluser *), int EventType)
                if ((fcn_ptr == cur->h_function_pointer) &&
                    (EventType == cur->eventtype))
                {
-                       MOD_syslog(LOG_DEBUG, "Unregistered user function (type %d)\n",
+                       syslog(LOG_DEBUG, "Unregistered user function (type %d)\n",
                                   EventType);
                        p = cur->next;
 
@@ -708,7 +708,7 @@ void CtdlDestroyUserHooks(void)
        cur = UserHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed user function \n");
+               syslog(LOG_DEBUG, "Destroyed user function \n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -730,7 +730,7 @@ void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *),
        newfcn->eventtype = EventType;
        MessageHookTable = newfcn;
 
-       MOD_syslog(LOG_DEBUG, "Registered a new message function (type %d)\n",
+       syslog(LOG_DEBUG, "Registered a new message function (type %d)\n",
                   EventType);
 }
 
@@ -745,7 +745,7 @@ void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *)
                if ((handler == cur->h_function_pointer) &&
                    (EventType == cur->eventtype))
                {
-                       MOD_syslog(LOG_DEBUG, "Unregistered message function (type %d)\n",
+                       syslog(LOG_DEBUG, "Unregistered message function (type %d)\n",
                                   EventType);
                        p = cur->next;
                        free(cur);
@@ -771,7 +771,7 @@ void CtdlDestroyMessageHook(void)
        cur = MessageHookTable; 
        while (cur != NULL)
        {
-               MOD_syslog(LOG_DEBUG, "Destroyed message function (type %d)\n", cur->eventtype);
+               syslog(LOG_DEBUG, "Destroyed message function (type %d)\n", cur->eventtype);
                p = cur->next;
                free(cur);
                cur = p;
@@ -790,7 +790,7 @@ void CtdlRegisterRoomHook(int (*fcn_ptr)(struct ctdlroom *))
        newfcn->fcn_ptr = fcn_ptr;
        RoomHookTable = newfcn;
 
-       MODM_syslog(LOG_DEBUG, "Registered a new room function\n");
+       syslog(LOG_DEBUG, "Registered a new room function\n");
 }
 
 
@@ -802,7 +802,7 @@ void CtdlUnregisterRoomHook(int (*fcn_ptr)(struct ctdlroom *))
        while (cur != NULL)
        {
                if (fcn_ptr == cur->fcn_ptr) {
-                       MODM_syslog(LOG_DEBUG, "Unregistered room function\n");
+                       syslog(LOG_DEBUG, "Unregistered room function\n");
                        p = cur->next;
 
                        free(cur);
@@ -829,7 +829,7 @@ void CtdlDestroyRoomHooks(void)
        cur = RoomHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed room function\n");
+               syslog(LOG_DEBUG, "Destroyed room function\n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -847,7 +847,7 @@ void CtdlRegisterNetprocHook(int (*handler)(struct CtdlMessage *, char *) )
        newfcn->h_function_pointer = handler;
        NetprocHookTable = newfcn;
 
-       MODM_syslog(LOG_DEBUG, "Registered a new netproc function\n");
+       syslog(LOG_DEBUG, "Registered a new netproc function\n");
 }
 
 
@@ -861,7 +861,7 @@ void CtdlUnregisterNetprocHook(int (*handler)(struct CtdlMessage *, char *) )
        while (cur != NULL) {
                if (handler == cur->h_function_pointer)
                {
-                       MODM_syslog(LOG_DEBUG, "Unregistered netproc function\n");
+                       syslog(LOG_DEBUG, "Unregistered netproc function\n");
                        p = cur->next;
                        free(cur);
                        if (last != NULL) {
@@ -886,7 +886,7 @@ void CtdlDestroyNetprocHooks(void)
        cur = NetprocHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed netproc function\n");
+               syslog(LOG_DEBUG, "Destroyed netproc function\n");
                p = cur->next;
                free(cur);
                cur = p;
@@ -905,7 +905,7 @@ void CtdlRegisterDeleteHook(void (*handler)(char *, long) )
        newfcn->h_function_pointer = handler;
        DeleteHookTable = newfcn;
 
-       MODM_syslog(LOG_DEBUG, "Registered a new delete function\n");
+       syslog(LOG_DEBUG, "Registered a new delete function\n");
 }
 
 
@@ -918,7 +918,7 @@ void CtdlUnregisterDeleteHook(void (*handler)(char *, long) )
        while (cur != NULL) {
                if (handler == cur->h_function_pointer )
                {
-                       MODM_syslog(LOG_DEBUG, "Unregistered delete function\n");
+                       syslog(LOG_DEBUG, "Unregistered delete function\n");
                        p = cur->next;
                        free(cur);
 
@@ -942,7 +942,7 @@ void CtdlDestroyDeleteHooks(void)
        cur = DeleteHookTable;
        while (cur != NULL)
        {
-               MODM_syslog(LOG_DEBUG, "Destroyed delete function\n");
+               syslog(LOG_DEBUG, "Destroyed delete function\n");
                p = cur->next;
                free(cur);
                cur = p;                
@@ -964,7 +964,7 @@ void CtdlRegisterFixedOutputHook(char *content_type, void (*handler)(char *, int
        safestrncpy(newfcn->content_type, content_type, sizeof newfcn->content_type);
        FixedOutputTable = newfcn;
 
-       MOD_syslog(LOG_DEBUG, "Registered a new fixed output function for %s\n", newfcn->content_type);
+       syslog(LOG_DEBUG, "Registered a new fixed output function for %s\n", newfcn->content_type);
 }
 
 
@@ -977,7 +977,7 @@ void CtdlUnregisterFixedOutputHook(char *content_type)
        while (cur != NULL) {
                /* This will also remove duplicates if any */
                if (!strcasecmp(content_type, cur->content_type)) {
-                       MOD_syslog(LOG_DEBUG,
+                       syslog(LOG_DEBUG,
                                   "Unregistered fixed output function for %s\n",
                                   content_type);
 
@@ -1006,7 +1006,7 @@ void CtdlDestroyFixedOutputHooks(void)
        cur = FixedOutputTable; 
        while (cur != NULL)
        {
-               MOD_syslog(LOG_DEBUG, "Destroyed fixed output function for %s\n", cur->content_type);
+               syslog(LOG_DEBUG, "Destroyed fixed output function for %s\n", cur->content_type);
                p = cur->next;
                free(cur);
                cur = p;
@@ -1043,7 +1043,7 @@ void CtdlRegisterXmsgHook(int (*fcn_ptr) (char *, char *, char *, char *), int o
        newfcn->order = order;
        newfcn->h_function_pointer = fcn_ptr;
        XmsgHookTable = newfcn;
-       MOD_syslog(LOG_DEBUG, "Registered a new x-msg function (priority %d)\n", order);
+       syslog(LOG_DEBUG, "Registered a new x-msg function (priority %d)\n", order);
 }
 
 
@@ -1057,7 +1057,7 @@ void CtdlUnregisterXmsgHook(int (*fcn_ptr) (char *, char *, char *, char *), int
                /* This will also remove duplicates if any */
                if (fcn_ptr == cur->h_function_pointer &&
                    order == cur->order) {
-                       MOD_syslog(LOG_DEBUG, "Unregistered x-msg function "
+                       syslog(LOG_DEBUG, "Unregistered x-msg function "
                                   "(priority %d)\n", order);
                        p = cur->next;
                        free(cur);
@@ -1083,7 +1083,7 @@ void CtdlDestroyXmsgHooks(void)
        cur = XmsgHookTable;
        while (cur != NULL)
        {
-               MOD_syslog(LOG_DEBUG, "Destroyed x-msg function "
+               syslog(LOG_DEBUG, "Destroyed x-msg function "
                        "(priority %d)\n", cur->order);
                p = cur->next;
                        
@@ -1122,7 +1122,7 @@ void CtdlRegisterServiceHook(int tcp_port,
                snprintf(message, SIZ, "Unix domain socket '%s': ", sockpath);
        }
        else if (tcp_port <= 0) {       /* port -1 to disable */
-               MOD_syslog(LOG_INFO, "Service %s has been manually disabled, skipping\n", ServiceName);
+               syslog(LOG_INFO, "Service %s has been manually disabled, skipping\n", ServiceName);
                free (message);
                free(newfcn);
                return;
@@ -1139,12 +1139,12 @@ void CtdlRegisterServiceHook(int tcp_port,
        if (newfcn->msock > 0) {
                ServiceHookTable = newfcn;
                strcat(message, "registered.");
-               MOD_syslog(LOG_INFO, "%s\n", message);
+               syslog(LOG_INFO, "%s\n", message);
        }
        else {
                AddPortError(message, error);
                strcat(message, "FAILED.");
-               MOD_syslog(LOG_CRIT, "%s\n", message);
+               syslog(LOG_CRIT, "%s\n", message);
                free(newfcn);
        }
        free(message);
@@ -1172,13 +1172,13 @@ void CtdlUnregisterServiceHook(int tcp_port, char *sockpath,
                        if (cur->msock > 0)
                                close(cur->msock);
                        if (sockpath) {
-                               MOD_syslog(LOG_INFO, "Closed UNIX domain socket %s\n",
+                               syslog(LOG_INFO, "Closed UNIX domain socket %s\n",
                                           sockpath);
                                unlink(sockpath);
                        } else if (tcp_port) {
-                               MOD_syslog(LOG_INFO, "Closed TCP port %d\n", tcp_port);
+                               syslog(LOG_INFO, "Closed TCP port %d\n", tcp_port);
                        } else {
-                               MOD_syslog(LOG_INFO, "Unregistered service \"%s\"\n", cur->ServiceName);
+                               syslog(LOG_INFO, "Unregistered service \"%s\"\n", cur->ServiceName);
                        }
                        p = cur->next;
                        free(cur);
@@ -1209,12 +1209,12 @@ void CtdlShutdownServiceHooks(void)
                        close(cur->msock);
                        cur->msock = -1;
                        if (cur->sockpath != NULL){
-                               MOD_syslog(LOG_INFO, "[%s] Closed UNIX domain socket %s\n",
+                               syslog(LOG_INFO, "[%s] Closed UNIX domain socket %s\n",
                                           cur->ServiceName,
                                           cur->sockpath);
                                unlink(cur->sockpath);
                        } else {
-                               MOD_syslog(LOG_INFO, "[%s] closing service\n", 
+                               syslog(LOG_INFO, "[%s] closing service\n", 
                                           cur->ServiceName);
                        }
                }
@@ -1241,14 +1241,14 @@ void CtdlDestroyServiceHook(void)
                }
 
                if (cur->sockpath) {
-                       MOD_syslog(LOG_INFO, "%s UNIX domain socket %s\n",
+                       syslog(LOG_INFO, "%s UNIX domain socket %s\n",
                                   Text,
                                   cur->sockpath);
                        unlink(cur->sockpath);
                } else if (cur->tcp_port) {
-                       MOD_syslog(LOG_INFO, "%s TCP port %d\n", Text, cur->tcp_port);
+                       syslog(LOG_INFO, "%s TCP port %d\n", Text, cur->tcp_port);
                } else {
-                       MOD_syslog(LOG_INFO, "Destroyed service \"%s\"\n", cur->ServiceName);
+                       syslog(LOG_INFO, "Destroyed service \"%s\"\n", cur->ServiceName);
                }
                p = cur->next;
                free(cur);
@@ -1272,7 +1272,7 @@ void CtdlRegisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *), c
        newfcn->fcn_ptr = fcn_ptr;
        SearchFunctionHookTable = newfcn;
 
-       MOD_syslog(LOG_DEBUG, "Registered a new search function (%s)\n", name);
+       syslog(LOG_DEBUG, "Registered a new search function (%s)\n", name);
 }
 
 void CtdlUnregisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *), char *name)
@@ -1286,7 +1286,7 @@ void CtdlUnregisterSearchFuncHook(void (*fcn_ptr)(int *, long **, const char *),
                    (cur->fcn_ptr == fcn_ptr) &&
                    name && !strcmp(name, cur->name))
                {
-                       MOD_syslog(LOG_DEBUG, "Unregistered search function(%s)\n", name);
+                       syslog(LOG_DEBUG, "Unregistered search function(%s)\n", name);
                        p = cur->next;
                        free (cur);
                        if (last != NULL)
@@ -1373,10 +1373,10 @@ int PerformMessageHooks(struct CtdlMessage *msg, recptypes *recps, int EventType
 
        /* Other code may elect to protect this message from server-side
         * handlers; if this is the case, don't do anything.
-       MOD_syslog(LOG_DEBUG, "** Event type is %d, flags are %d\n", EventType, msg->cm_flags);
+       syslog(LOG_DEBUG, "** Event type is %d, flags are %d\n", EventType, msg->cm_flags);
         */
        if (msg->cm_flags & CM_SKIP_HOOKS) {
-               MODM_syslog(LOG_DEBUG, "Skipping hooks\n");
+               syslog(LOG_DEBUG, "Skipping hooks\n");
                return(0);
        }
 
@@ -1401,7 +1401,7 @@ int PerformRoomHooks(struct ctdlroom *target_room)
        RoomFunctionHook *fcn;
        int total_retval = 0;
 
-       MOD_syslog(LOG_DEBUG, "Performing room hooks for <%s>\n", target_room->QRname);
+       syslog(LOG_DEBUG, "Performing room hooks for <%s>\n", target_room->QRname);
 
        for (fcn = RoomHookTable; fcn != NULL; fcn = fcn->next) {
                total_retval = total_retval + (*fcn->fcn_ptr) (target_room);
index b27068ecba02851360b21e16ac93df0de5a63f1b..242adff86571a2a73dd140cc559dcb8a39e209ec 100644 (file)
@@ -161,10 +161,10 @@ int rename_user(char *oldname, char *newname) {
                else {          /* Sanity checks succeeded.  Now rename the user. */
                        if (usbuf.usernum == 0)
                        {
-                               CONM_syslog(LOG_DEBUG, "Can not rename user \"Citadel\".\n");
+                               syslog(LOG_DEBUG, "Can not rename user \"Citadel\".\n");
                                retcode = RENAMEUSER_NOT_FOUND;
                        } else {
-                               CON_syslog(LOG_DEBUG, "Renaming <%s> to <%s>\n", oldname, newname);
+                               syslog(LOG_DEBUG, "Renaming <%s> to <%s>\n", oldname, newname);
                                cdb_delete(CDB_USERS, oldnamekey, strlen(oldnamekey));
                                safestrncpy(usbuf.fullname, newname, sizeof usbuf.fullname);
                                CtdlPutUser(&usbuf);
@@ -412,11 +412,11 @@ int CtdlGetUserByNumber(struct ctdluser *usbuf, long number)
 
        cdbun = cdb_fetch(CDB_USERSBYNUMBER, &number, sizeof(long));
        if (cdbun == NULL) {
-               CON_syslog(LOG_INFO, "User %ld not found\n", number);
+               syslog(LOG_INFO, "User %ld not found\n", number);
                return(-1);
        }
 
-       CON_syslog(LOG_INFO, "User %ld maps to %s\n", number, cdbun->ptr);
+       syslog(LOG_INFO, "User %ld maps to %s\n", number, cdbun->ptr);
        r = CtdlGetUser(usbuf, cdbun->ptr);
        cdb_free(cdbun);
        return(r);
@@ -452,7 +452,7 @@ void rebuild_ubn_for_user(struct ctdluser *usbuf, void *data) {
        }
 
        while (u != NULL) {
-               CON_syslog(LOG_DEBUG, "Rebuilding usersbynumber index %10ld : %s\n",
+               syslog(LOG_DEBUG, "Rebuilding usersbynumber index %10ld : %s\n",
                        u->usernum, u->username);
                cdb_store(CDB_USERSBYNUMBER, &u->usernum, sizeof(long), u->username, strlen(u->username)+1);
 
@@ -513,7 +513,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
        int found_user;
        long len;
 
-       CON_syslog(LOG_DEBUG, "CtdlLoginExistingUser(%s, %s)\n", authname, trythisname);
+       syslog(LOG_DEBUG, "CtdlLoginExistingUser(%s, %s)\n", authname, trythisname);
 
        if ((CC->logged_in)) {
                return login_already_logged_in;
@@ -523,7 +523,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
        
        if (!strncasecmp(trythisname, "SYS_", 4))
        {
-               CON_syslog(LOG_DEBUG, "System user \"%s\" is not allowed to log in.\n", trythisname);
+               syslog(LOG_DEBUG, "System user \"%s\" is not allowed to log in.\n", trythisname);
                return login_not_found;
        }
 
@@ -554,21 +554,21 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
                struct passwd *tempPwdPtr;
                char pwdbuffer[256];
        
-               CON_syslog(LOG_DEBUG, "asking host about <%s>\n", username);
+               syslog(LOG_DEBUG, "asking host about <%s>\n", username);
 #ifdef HAVE_GETPWNAM_R
 #ifdef SOLARIS_GETPWUID
-               CON_syslog(LOG_DEBUG, "Calling getpwnam_r()\n");
+               syslog(LOG_DEBUG, "Calling getpwnam_r()\n");
                tempPwdPtr = getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer);
 #else // SOLARIS_GETPWUID
-               CONM_syslog(LOG_DEBUG, "Calling getpwnam_r()\n");
+               syslog(LOG_DEBUG, "Calling getpwnam_r()\n");
                getpwnam_r(username, &pd, pwdbuffer, sizeof pwdbuffer, &tempPwdPtr);
 #endif // SOLARIS_GETPWUID
 #else // HAVE_GETPWNAM_R
-               CON_syslog(LOG_DEBUG, "SHOULD NEVER GET HERE!!!\n");
+               syslog(LOG_DEBUG, "SHOULD NEVER GET HERE!!!\n");
                tempPwdPtr = NULL;
 #endif // HAVE_GETPWNAM_R
                if (tempPwdPtr == NULL) {
-                       CON_syslog(LOG_DEBUG, "no such user <%s>\n", username);
+                       syslog(LOG_DEBUG, "no such user <%s>\n", username);
                        return login_not_found;
                }
        
@@ -576,7 +576,7 @@ int CtdlLoginExistingUser(char *authname, const char *trythisname)
                 * If not found, make one attempt to create it.
                 */
                found_user = getuserbyuid(&CC->user, pd.pw_uid);
-               CON_syslog(LOG_DEBUG, "found it: uid=%ld, gecos=%s here: %d\n",
+               syslog(LOG_DEBUG, "found it: uid=%ld, gecos=%s here: %d\n",
                        (long)pd.pw_uid, pd.pw_gecos, found_user);
                if (found_user != 0) {
                        len = cutuserkey(username);
@@ -661,7 +661,7 @@ void do_login(void)
        struct CitContext *CCC = CC;
 
        CCC->logged_in = 1;
-       CON_syslog(LOG_NOTICE, "<%s> logged in\n", CCC->curr_user);
+       syslog(LOG_NOTICE, "<%s> logged in\n", CCC->curr_user);
 
        CtdlGetUserLock(&CCC->user, CCC->curr_user);
        ++(CCC->user.timescalled);
@@ -726,7 +726,7 @@ void CtdlUserLogout(void)
 {
        CitContext *CCC = MyContext();
 
-       CON_syslog(LOG_DEBUG, "CtdlUserLogout() logging out <%s> from session %d",
+       syslog(LOG_DEBUG, "CtdlUserLogout() logging out <%s> from session %d",
                   CCC->curr_user, CCC->cs_pid
        );
 
@@ -774,39 +774,39 @@ static int validpw(uid_t uid, const char *pass)
        int rv = 0;
 
        if (IsEmptyStr(pass)) {
-               CON_syslog(LOG_DEBUG, "Refusing to chkpwd for uid=%d with empty password.\n", uid);
+               syslog(LOG_DEBUG, "Refusing to chkpwd for uid=%d with empty password.\n", uid);
                return 0;
        }
 
-       CON_syslog(LOG_DEBUG, "Validating password for uid=%d using chkpwd...\n", uid);
+       syslog(LOG_DEBUG, "Validating password for uid=%d using chkpwd...\n", uid);
 
        begin_critical_section(S_CHKPWD);
        rv = write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
        if (rv == -1) {
-               CON_syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
                end_critical_section(S_CHKPWD);
                return 0;
        }
        rv = write(chkpwd_write_pipe[1], pass, 256);
        if (rv == -1) {
-               CON_syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
                end_critical_section(S_CHKPWD);
                return 0;
        }
        rv = read(chkpwd_read_pipe[0], buf, 4);
        if (rv == -1) {
-               CON_syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Communicatino with chkpwd broken: %s\n", strerror(errno));
                end_critical_section(S_CHKPWD);
                return 0;
        }
        end_critical_section(S_CHKPWD);
 
        if (!strncmp(buf, "PASS", 4)) {
-               CONM_syslog(LOG_DEBUG, "...pass\n");
+               syslog(LOG_DEBUG, "...pass\n");
                return(1);
        }
 
-       CONM_syslog(LOG_DEBUG, "...fail\n");
+       syslog(LOG_DEBUG, "...fail\n");
        return 0;
 }
 
@@ -818,7 +818,7 @@ void start_chkpwd_daemon(void) {
        struct stat filestats;
        int i;
 
-       CONM_syslog(LOG_DEBUG, "Starting chkpwd daemon for host authentication mode\n");
+       syslog(LOG_DEBUG, "Starting chkpwd daemon for host authentication mode\n");
 
        if ((stat(file_chkpwd, &filestats)==-1) ||
            (filestats.st_size==0)){
@@ -826,29 +826,29 @@ void start_chkpwd_daemon(void) {
                abort();
        }
        if (pipe(chkpwd_write_pipe) != 0) {
-               CON_syslog(LOG_EMERG, "Unable to create pipe for chkpwd daemon: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Unable to create pipe for chkpwd daemon: %s\n", strerror(errno));
                abort();
        }
        if (pipe(chkpwd_read_pipe) != 0) {
-               CON_syslog(LOG_EMERG, "Unable to create pipe for chkpwd daemon: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Unable to create pipe for chkpwd daemon: %s\n", strerror(errno));
                abort();
        }
 
        chkpwd_pid = fork();
        if (chkpwd_pid < 0) {
-               CON_syslog(LOG_EMERG, "Unable to fork chkpwd daemon: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Unable to fork chkpwd daemon: %s\n", strerror(errno));
                abort();
        }
        if (chkpwd_pid == 0) {
-               CONM_syslog(LOG_DEBUG, "Now calling dup2() write\n");
+               syslog(LOG_DEBUG, "Now calling dup2() write\n");
                dup2(chkpwd_write_pipe[0], 0);
-               CONM_syslog(LOG_DEBUG, "Now calling dup2() write\n");
+               syslog(LOG_DEBUG, "Now calling dup2() write\n");
                dup2(chkpwd_read_pipe[1], 1);
-               CONM_syslog(LOG_DEBUG, "Now closing stuff\n");
+               syslog(LOG_DEBUG, "Now closing stuff\n");
                for (i=2; i<256; ++i) close(i);
-               CON_syslog(LOG_DEBUG, "Now calling execl(%s)\n", file_chkpwd);
+               syslog(LOG_DEBUG, "Now calling execl(%s)\n", file_chkpwd);
                execl(file_chkpwd, file_chkpwd, NULL);
-               CON_syslog(LOG_EMERG, "Unable to exec chkpwd daemon: %s\n", strerror(errno));
+               syslog(LOG_EMERG, "Unable to exec chkpwd daemon: %s\n", strerror(errno));
                abort();
                exit(errno);
        }
@@ -861,19 +861,19 @@ int CtdlTryPassword(const char *password, long len)
        CitContext *CCC = CC;
 
        if ((CCC->logged_in)) {
-               CONM_syslog(LOG_WARNING, "CtdlTryPassword: already logged in\n");
+               syslog(LOG_WARNING, "CtdlTryPassword: already logged in\n");
                return pass_already_logged_in;
        }
        if (!strcmp(CCC->curr_user, NLI)) {
-               CONM_syslog(LOG_WARNING, "CtdlTryPassword: no user selected\n");
+               syslog(LOG_WARNING, "CtdlTryPassword: no user selected\n");
                return pass_no_user;
        }
        if (CtdlGetUser(&CCC->user, CCC->curr_user)) {
-               CONM_syslog(LOG_ERR, "CtdlTryPassword: internal error\n");
+               syslog(LOG_ERR, "CtdlTryPassword: internal error\n");
                return pass_internal_error;
        }
        if (password == NULL) {
-               CONM_syslog(LOG_INFO, "CtdlTryPassword: NULL password string supplied\n");
+               syslog(LOG_INFO, "CtdlTryPassword: NULL password string supplied\n");
                return pass_wrong_password;
        }
 
@@ -946,7 +946,7 @@ int CtdlTryPassword(const char *password, long len)
                do_login();
                return pass_ok;
        } else {
-               CON_syslog(LOG_WARNING, "Bad password specified for <%s> Service <%s> Port <%ld> Remote <%s / %s>\n",
+               syslog(LOG_WARNING, "Bad password specified for <%s> Service <%s> Port <%ld> Remote <%s / %s>\n",
                           CCC->curr_user,
                           CCC->ServiceName,
                           CCC->tcp_port,
@@ -978,7 +978,7 @@ int purge_user(char pname[])
                return (ERROR + NO_SUCH_USER);
 
        if (CtdlGetUser(&usbuf, pname) != 0) {
-               CON_syslog(LOG_ERR, "Cannot purge user <%s> - not found\n", pname);
+               syslog(LOG_ERR, "Cannot purge user <%s> - not found\n", pname);
                return (ERROR + NO_SUCH_USER);
        }
        /* Don't delete a user who is currently logged in.  Instead, just
@@ -986,12 +986,12 @@ int purge_user(char pname[])
         * during the next purge.
         */
        if (CtdlIsUserLoggedInByNum(usbuf.usernum)) {
-               CON_syslog(LOG_WARNING, "User <%s> is logged in; not deleting.\n", pname);
+               syslog(LOG_WARNING, "User <%s> is logged in; not deleting.\n", pname);
                usbuf.axlevel = AxDeleted;
                CtdlPutUser(&usbuf);
                return (1);
        }
-       CON_syslog(LOG_NOTICE, "Deleting user <%s>\n", pname);
+       syslog(LOG_NOTICE, "Deleting user <%s>\n", pname);
 
 /*
  * FIXME:
@@ -1155,7 +1155,7 @@ int create_user(const char *newusername, long len, int become_user)
                CC->cs_addr
        );
        CtdlAideMessage(buf, "User Creation Notice");
-       CON_syslog(LOG_NOTICE, "New user <%s> created\n", username);
+       syslog(LOG_NOTICE, "New user <%s> created\n", username);
        return (0);
 }
 
@@ -1169,7 +1169,7 @@ void CtdlSetPassword(char *new_pw)
        CtdlGetUserLock(&CC->user, CC->curr_user);
        safestrncpy(CC->user.password, new_pw, sizeof(CC->user.password));
        CtdlPutUserLock(&CC->user);
-       CON_syslog(LOG_INFO, "Password changed for user <%s>\n", CC->curr_user);
+       syslog(LOG_INFO, "Password changed for user <%s>\n", CC->curr_user);
        PerformSessionHooks(EVT_SETPASS);
 }