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) {
}
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);
}
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;
}
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);
}
}
{
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.
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.
*/
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);
}
free(con->cached_msglist);
}
- CONM_syslog(LOG_DEBUG, "Done with RemoveContext()");
+ syslog(LOG_DEBUG, "Done with RemoveContext()");
}
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));
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));
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);
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;
* 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;
*/
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) {
/*
* 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.
{
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) {
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,
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,
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);
}
}
{
if (cdbut) cdb_free(cdbut);
- SEENM_syslog(LOG_DEBUG, "not Found");
+ syslog(LOG_DEBUG, "not Found");
if (cType == eCheckUpdate)
return 0;
}
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;
}
/*
- * 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.
{
/* 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);
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;
}
become_session(Ctx);
SetEVState(IO, eDBTerm);
- EVM_syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
+ syslog(LOG_DEBUG, "DBEVENT Terminating.\n");
StopDBWatchers(IO);
assert(IO->DBTerminate);
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);
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);
{
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);
}
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;
}
{
/* 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);
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;
}
void DestructCAres(AsyncIO *IO);
void StopClientWatchers(AsyncIO *IO, int CloseFD)
{
- EVM_syslog(LOG_DEBUG, "EVENT StopClientWatchers");
+ syslog(LOG_DEBUG, "EVENT StopClientWatchers");
DestructCAres(IO);
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);
SetEVState(IO, eExit);
become_session(Ctx);
- EVM_syslog(LOG_DEBUG, "EVENT Terminating \n");
+ syslog(LOG_DEBUG, "EVENT Terminating \n");
StopClientWatchers(IO, 1);
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,
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);
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);
}
else
{
- EVM_syslog(LOG_DEBUG, "connect() succeeded\n");
+ syslog(LOG_DEBUG, "connect() succeeded\n");
set_start_callback(loop, IO, 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,
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))
IPPROTO_TCP);
if (IO->SendBuf.fd < 0) {
- EV_syslog(LOG_ERR,
+ syslog(LOG_ERR,
"EVENT: socket() failed: %s\n",
strerror(errno));
}
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));
}
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,
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,
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));
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);
{
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));
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);
* 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.
*/
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];
}
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 */
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;
}
}
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);
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);
}
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();
}
char *qp_encode_email_addrs(char *source)
{
- struct CitContext *CCC = CC;
char *user, *node, *name;
const char headerStr[] = "=?UTF-8?Q?";
char *Encoded;
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);
* 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;
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));
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])) {
}
key[keylen++] = 0;
- MSG_syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
+ syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
}
*/
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;
*/
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;
}
/*
- * 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.
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
);
}
/*
* 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.
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) {
}
}
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
*/
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;
}
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;
}
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);
}
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);
}
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;
}
}
}
- 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
*/
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;
}
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);
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;
}
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
*/
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;
}
}
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;
}
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);
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;
}
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);
}
}
-
/*
* close the upload file
*/
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;
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);
}
}
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;
}
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;
}
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
*/
cprintf("%d %ld\n", CIT_OK, (long)statbuf.st_size);
}
+
/*
* cmd_nuop() - open a network spool file for uploading
*/
}
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();
}
+
/*
* help_subst() - support routine for help file viewer
*/
}
}
+
void do_help_subst(char *buffer)
{
char buf2[16];
{
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");
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");
}
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);
/*
*/
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;
}
*/
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")
);
*/
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;
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;
}
{
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;
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)) ) {
}
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;
}
{
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;
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);
}
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;
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;
}
}
{
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] != '@')) {
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);
}
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;
}
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);
}
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 ;)
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);
* 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;
*/
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;
}
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;
}
(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;
}
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;
}
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;
}
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 */
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);
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
*/
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));
}
}
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);
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);
}
{
MailQEntry *Q = qv;
/*
- SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
+ syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
cit_backtrace();
*/
FreeStrBuf(&Q->Recipient);
void FreeQueItem(OneQueItem **Item)
{
/*
- SMTPC_syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
+ syslog(LOG_DEBUG, "---------------%s--------------", __FUNCTION__);
cit_backtrace();
*/
DeleteHash(&(*Item)->MailQEntries);
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...
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;
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);
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;
}
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;
}
/* 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));
}
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,
{
StrBufExtract_NextToken(One, All, &Pos, '|');
if (!ParseURL(Url, One, DefaultMXPort)) {
- SMTPC_syslog(LOG_DEBUG,
+ syslog(LOG_DEBUG,
"Failed to parse: %s\n",
ChrPtr(One));
}
}
}
if (!ParseURL(Url, One, DefaultMXPort)) {
- SMTPC_syslog(LOG_DEBUG,
+ syslog(LOG_DEBUG,
"Failed to parse: %s\n",
ChrPtr(One));
}
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;
}
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... */
(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);
* 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);
{
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);
}
(((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,
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),
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),
const char* Key;
void *VData;
- SMTPC_syslog(LOG_WARNING,
+ syslog(LOG_WARNING,
"unable to find QItem with ID[%ld]",
MyQItem->MessageID);
while (GetNextHashPos(ActiveQItems,
&Key,
&VData))
{
- SMTPC_syslog(LOG_WARNING,
+ syslog(LOG_WARNING,
"have: ID[%ld]",
((OneQueItem *)VData)->MessageID);
}
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,
&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);
}
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"
* 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.
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_"));
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);
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,
}
FreeStrBuf(&boundary);
CM_Free(bmsg);
- SMTPCM_syslog(LOG_DEBUG, "Done processing bounces\n");
+ syslog(LOG_DEBUG, "Done processing bounces");
}
/*
* 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.
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).
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;
* 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);
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;
/* 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,
#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();
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) {
ForEachMsgCallback CallBack,
void *userdata)
{
- struct CitContext *CCC = CC;
int a, i, j;
visit vbuf;
struct cdbdata *cdbfr;
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);
}
/* 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. */
|| ((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;
/*
* 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);
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];
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;
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;
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;
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);
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);
}
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;
*/
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));
*/
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';
}
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;
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;
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;
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);
* 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;
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;
// 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;
}
char *cbid,
void *cbuserdata)
{
- struct CitContext *CCC = CC;
int i;
char buf[128];
int add_newline = 0;
/* 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)
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");
* (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 */
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]) {
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 : "<>")
);
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) {
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');
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';
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;
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);
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);
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);
/* 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
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 */
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);
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;
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);
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);
}
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;
}
}
- 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);
}
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];
/* 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 */
}
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) {
*
*/
long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply) {
- struct CitContext *CCC = CC;
long retval;
struct ser_ret smr;
int is_bigmsg = 0;
ERROR + INTERNAL_ERROR);
}
else {
- MSGM_syslog(LOG_ERR, "CtdlSaveMessage() unable to serialize message");
+ syslog(LOG_ERR, "CtdlSaveMessage() unable to serialize message");
}
return (-1L);
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) {
(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);
}
}
void CtdlSerializeMessage(struct ser_ret *ret, /* return values */
struct CtdlMessage *msg) /* unserialized msg */
{
- struct CitContext *CCC = CC;
size_t wlen;
int i;
* 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;
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;
}
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);
}
* 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, "");
}
}
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
/* 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);
}
}
/* 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");
}
}
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);
* 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;
* 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);
}
}
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]);
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);
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);
}
}
}
/* 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);
}
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);
long ioid,
time_t NOW)
{
- struct CitContext *CCC = CC;
int i;
u_char rawdigest[MD5_DIGEST_LEN];
struct MD5Context md5context;
{
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. */
long reflen
)
{
- struct CitContext *CCC = CC;
/* Don't confuse the poor folks if it's not routed mail. * /
char dest_node[256] = "";*/
long blen;
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));
}
}
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) {
char *content_type /* or "" for any. regular expressions expected. */
)
{
- struct CitContext *CCC = CC;
struct ctdlroom qrbuf;
struct cdbdata *cdbfr;
long *msglist = NULL;
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 */
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);
}
*/
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);
}
*/
/* 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);
}
*/
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) {
/* 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);
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));
}
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) {
{
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));
}
*/
int TDAP_ProcessAdjRefCountQueue(void)
{
- struct CitContext *CCC = CC;
char file_arcq_temp[PATH_MAX];
int r;
FILE *fp;
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);
}
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);
}
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);
*/
void TDAP_AdjRefCount(long msgnum, int incr)
{
- struct CitContext *CCC = CC;
struct MetaData smi;
long delnum;
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
);
* (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);
unsigned int flags /* Internal save flags */
)
{
- struct CitContext *CCC = CC;
struct ctdlroom qrbuf;
char roomname[ROOMNAMELEN];
struct CtdlMessage *msg;
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 ) );
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")));
* 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)
);
}
/*****************************************************************************/
/* 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 */
* 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.
/*-----------------------------------------------------------------------------*
* Network maps: evaluate other nodes *
*-----------------------------------------------------------------------------*/
-int NTTDebugEnabled = 0;
-int NTTDumpEnabled = 0;
/*
* network_talking_to() -- concurrency checker
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) ||
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;
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);
}
-/*
- * Module entry point
- */
-void SetNTTDebugEnabled(const int n)
-{
- NTTDebugEnabled = n;
-}
-
-void SetNTTDumpEnabled(const int n)
-{
- NTTDumpEnabled = n;
-}
-
-
/*
* Module entry point
{
if (!threading)
{
- CtdlRegisterDebugFlagHook(HKEY("networktalkingto"), SetNTTDebugEnabled, &NTTDebugEnabled);
- CtdlRegisterDebugFlagHook(HKEY("dumpnetworktalkingto"), SetNTTDumpEnabled, &NTTDumpEnabled);
-
CtdlRegisterCleanupHook(cleanup_nttlist);
}
return "nttlist";
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);
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)
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");
}
{
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);
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;
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");
}
{
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);
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);
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);
}
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;
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;
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);
}
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;
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;
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);
}
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;
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;
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);
}
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);
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;
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");
}
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);
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;
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");
}
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) {
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;
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");
}
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);
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;
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);
}
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);
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;
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);
}
/* 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);
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;
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;
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);
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);
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);
}
}
}
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);
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)
(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)
/* 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);
}
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);
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);
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);
}
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);
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;
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;
}
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;
}
* 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);
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);
{
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
);
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;
}
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)){
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);
}
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;
}
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,
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
* 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:
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);
}
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);
}