size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
strings = backtrace_symbols(stack_frames, size);
for (i = 0; i < size; i++) {
- if (strings != NULL)
- syslog(LOG_ALERT, "%s %s\n", p, strings[i]);
- else
- syslog(LOG_ALERT, "%s %p\n", p, stack_frames[i]);
+ if (strings != NULL) {
+ syslog(LOG_DEBUG, "citserver: %s %s", p, strings[i]);
+ }
+ else {
+ syslog(LOG_DEBUG, "citserver: %s %p", p, stack_frames[i]);
+ }
}
free(strings);
#endif
StrBufAppendPrintf(Buf, "%p : ", stack_frames[i]);
}
free(strings);
- syslog(LOG_ALERT, "%s %s\n", IOSTR, ChrPtr(Buf));
+ syslog(LOG_DEBUG, "citserver: %s %s", IOSTR, ChrPtr(Buf));
FreeStrBuf(&Buf);
}
#endif
}
+
/*
* print the actual stack frame.
*/
size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
strings = backtrace_symbols(stack_frames, size);
for (i = 0; i < size; i++) {
- if (strings != NULL)
- syslog(LOG_ALERT, "%s\n", strings[i]);
- else
- syslog(LOG_ALERT, "%p\n", stack_frames[i]);
+ if (strings != NULL) {
+ syslog(LOG_DEBUG, "%s", strings[i]);
+ }
+ else {
+ syslog(LOG_DEBUG, "%p", stack_frames[i]);
+ }
}
free(strings);
#endif
char encoding[16];
char istr[1024];
iconv_t ic = (iconv_t)(-1) ;
- char *ibuf; /**< Buffer of characters to be converted */
- char *obuf; /**< Buffer for converted characters */
- size_t ibuflen; /**< Length of input buffer */
- size_t obuflen; /**< Length of output buffer */
- char *isav; /**< Saved pointer to input buffer */
- char *osav; /**< Saved pointer to output buffer */
+ char *ibuf; // Buffer of characters to be converted
+ char *obuf; // Buffer for converted characters
+ size_t ibuflen; // Length of input buffer
+ size_t obuflen; // Length of output buffer
+ char *isav; // Saved pointer to input buffer
+ char *osav; // Saved pointer to output buffer
int passes = 0;
int i, len, delta;
int illegal_non_rfc2047_encoding = 0;
for (i=0; i<len; ++i) {
if ((buf[i] < 32) || (buf[i] > 126)) {
illegal_non_rfc2047_encoding = 1;
- i = len; ///< take a shortcut, it won't be more than one.
+ i = len; // take a shortcut, it won't be more than one.
}
}
if (illegal_non_rfc2047_encoding) {
ibuf = malloc(1024);
isav = ibuf;
- if (!strcasecmp(encoding, "B")) { /**< base64 */
+ if (!strcasecmp(encoding, "B")) { // base64
ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
}
- else if (!strcasecmp(encoding, "Q")) { /**< quoted-printable */
+ else if (!strcasecmp(encoding, "Q")) { // quoted-printable
size_t len;
unsigned long pos;
ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
}
else {
- strcpy(ibuf, istr); /**< unknown encoding */
+ strcpy(ibuf, istr); // unknown encoding
ibuflen = strlen(istr);
}
#endif
-
struct trynamebuf {
char buffer1[SIZ];
char buffer2[SIZ];
}
-
/*
* Determine whether a given Internet address belongs to the current user
*/
}
-
-
-
/*
* This function is self explanatory.
* (What can I say, I'm in a weird mood today...)
/*
* Aliasing for network mail.
- * (Error messages have been commented out, because this is a server.)
*/
int alias(char *name)
{ /* process alias and routing info for mail */
}
-
/*
* Validate recipients, count delivery types and errors, and handle aliasing
* FIXME check for dupes!!!!!
EncodedMaxLen = nColons * (sizeof(headerStr) + 3) + SourceLen * 3;
Encoded = (char*) malloc (EncodedMaxLen);
- for (i = 0; i < nColons; i++)
+ for (i = 0; i < nColons; i++) {
source[AddrPtr[i]++] = '\0';
+ }
/* TODO: if libidn, this might get larger*/
user = malloc(SourceLen + 1);
node = malloc(SourceLen + 1);
}
-
/*
* Split an RFC822-style address into userid, host, and full name
*
}
-
/*
* convert_field() is a helper function for convert_internet_message().
* Given start/end positions for an rfc822 field, it converts it to a Citadel
}
-
struct CtdlMessage *convert_internet_message_buf(StrBuf **rfc822)
{
struct CtdlMessage *msg;
}
-
/*
* Look for a particular header field in an RFC822 message text. If the
* requested field is found, it is unfolded (if necessary) and returned to
}
-
/*****************************************************************************
* DIRECTORY MANAGEMENT FUNCTIONS *
*****************************************************************************/
if ((enc_len > 1) && (enc[enc_len-2] == 13)) enc[enc_len-2] = 0;
if ((enc_len > 0) && (enc[enc_len-1] == 10)) enc[enc_len-1] = 0;
enc[enc_len] = 0;
- syslog(LOG_DEBUG, "Writing key '%s' (length=%d)", keyname, enc_len);
+ syslog(LOG_DEBUG, "netconfig: writing key '%s' (length=%d)", keyname, enc_len);
CtdlSetConfigStr(keyname, enc);
free(enc);
}
"An unknown Citadel server called \"%s\" attempted to connect from %s [%s].\n",
node, CCC->cs_host, CCC->cs_addr
);
- syslog(LOG_WARNING, "%s", err_buf);
+ syslog(LOG_WARNING, "netconfig: %s", err_buf);
cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
CtdlAideMessage(err_buf, "IGNet Networking");
DeleteHash(&working_ignetcfg);
"A Citadel server at %s [%s] failed to authenticate as network node \"%s\".\n",
CCC->cs_host, CCC->cs_addr, node
);
- syslog(LOG_WARNING, "%s", err_buf);
+ syslog(LOG_WARNING, "netconfig: %s", err_buf);
cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
CtdlAideMessage(err_buf, "IGNet Networking");
}
if (CtdlNetworkTalkingTo(node, nodelen, NTT_CHECK)) {
- syslog(LOG_WARNING, "Duplicate session for network node <%s>", node);
+ syslog(LOG_WARNING, "netconfig: duplicate session for network node <%s>", node);
cprintf("%d Already talking to %s right now\n", ERROR + RESOURCE_BUSY, node);
DeleteHash(&working_ignetcfg);
FreeStrBuf(&NodeStr);
}
nodelen = safestrncpy(CCC->net_node, node, sizeof CCC->net_node);
CtdlNetworkTalkingTo(CCC->net_node, nodelen, NTT_ADD);
- syslog(LOG_NOTICE, "Network node <%s> logged in from %s [%s]",
+ syslog(LOG_INFO, "netconfig: network node <%s> logged in from %s [%s]",
CCC->net_node, CCC->cs_host, CCC->cs_addr
);
cprintf("%d authenticated as network node '%s'\n", CIT_OK, CCC->net_node);
* First try the neighbor nodes
*/
if (GetCount(IgnetCfg) == 0) {
- syslog(LOG_INFO, "IgnetCfg is empty!");
+ syslog(LOG_INFO, "netconfig: IgnetCfg is empty!");
if (nexthop != NULL) {
*nexthop = NULL;
}
/*
* If we get to this point, the supplied node name is bogus.
*/
- syslog(LOG_ERR, "Invalid node name <%s>", ChrPtr(node));
+ syslog(LOG_ERR, "netconfig: invalid node name <%s>", ChrPtr(node));
return(-1);
}
dh = opendir(ctdl_netcfg_dir);
if (!dh) return;
- syslog(LOG_INFO, "Legacy netconfig files exist - converting them!");
+ syslog(LOG_INFO, "netconfig: legacy netconfig files exist - converting them!");
while (dit = readdir(dh), dit != NULL) { // yes, we use the non-reentrant version; we're not in threaded mode yet
roomnum = atol(dit->d_name);
uid_t ctdluid = 0;
const char *CitadelServiceUDS="citadel-UDS";
const char *CitadelServiceTCP="citadel-TCP";
-
-
-
void go_threading(void);
-
/*
* Create or remove a lock file, so we only have one Citadel Server running at a time.
*/
static char lockfilename[SIZ];
static FILE *fp;
-
if (yo) {
syslog(LOG_DEBUG, "main: creating lockfile");
snprintf(lockfilename, sizeof lockfilename, "%s/citadel.lock", ctdl_run_dir);
}
-
-
-
-
/*
* Here's where it all begins.
*/
}
/* Tell 'em who's in da house */
- syslog(LOG_NOTICE, " ");
- syslog(LOG_NOTICE, " ");
- syslog(LOG_NOTICE, "*** Citadel server engine ***\n");
- syslog(LOG_NOTICE, "Version %d (build %s) ***", REV_LEVEL, svn_revision());
- syslog(LOG_NOTICE, "Copyright (C) 1987-2017 by the Citadel development team.");
- syslog(LOG_NOTICE, "This program is distributed under the terms of the GNU "
- "General Public License.");
- syslog(LOG_NOTICE, " ");
- syslog(LOG_DEBUG, "Called as: %s", argv[0]);
+ syslog(LOG_INFO, " ");
+ syslog(LOG_INFO, " ");
+ syslog(LOG_INFO, "*** Citadel server engine ***\n");
+ syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, svn_revision());
+ syslog(LOG_INFO, "Copyright (C) 1987-2017 by the Citadel development team.");
+ syslog(LOG_INFO, "This program is distributed under the terms of the GNU General Public License.");
+ syslog(LOG_INFO, " ");
syslog(LOG_INFO, "%s", libcitadel_version_string());
#ifdef HAVE_RUN_DIR