From 50d8adbcac551e6615c1e4c33dbf55e6a055cd1d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 16 May 2024 04:05:24 +0000 Subject: [PATCH 01/16] fix dlen --- citadel/utils/ctdlload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/citadel/utils/ctdlload.c b/citadel/utils/ctdlload.c index cc25ef28a..e69aa0873 100644 --- a/citadel/utils/ctdlload.c +++ b/citadel/utils/ctdlload.c @@ -118,6 +118,7 @@ int import_user(char *line, struct cdbkeyval *kv) { char userkey[USERNAME_SIZE]; char *token; struct ctdluser *u; + int dlen = 0; u = malloc(sizeof(struct ctdluser)); if (!u) { @@ -163,7 +164,6 @@ int import_user(char *line, struct cdbkeyval *kv) { u->msgnum_pic = atol(token); break; case 12: - int dlen; dlen = CtdlDecodeBase64(token, token, strlen(token)); // Decode in place if (dlen >= sizeof(u->emailaddrs)) { dlen = sizeof(u->emailaddrs) - 1; -- 2.39.2 From 675cd45d1e052f075aab6941e58f198dc5f44e0a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 May 2024 15:15:44 +0000 Subject: [PATCH 02/16] put list-unsubscribe address in angle brackets --- citadel/dumploadtest.sh | 9 ++++---- .../autocompletion/serv_autocompletion.c | 5 +--- citadel/server/modules/bio/serv_bio.c | 4 +--- .../modules/listdeliver/serv_listdeliver.c | 23 +++++++++---------- citadel/server/modules/smtp/serv_smtpclient.c | 4 +--- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/citadel/dumploadtest.sh b/citadel/dumploadtest.sh index 7179f3991..50488ff80 100755 --- a/citadel/dumploadtest.sh +++ b/citadel/dumploadtest.sh @@ -1,6 +1,5 @@ #!/bin/bash - # This script dumps the database, deletes the database, loads the database, dumps it again... # ...and then compares the two dumps to see if we have full fidelity between them. # @@ -13,16 +12,18 @@ ps ax | grep citserver | grep -v grep >/dev/null 2>/dev/null && { exit 1 } +echo +echo + ./ctdldump -y >dump.dat first=$(md5sum dump.dat | awk ' { print $1 } ' ) +echo MD5 of initial dump: ${first} + rm -fv data/* ./ctdlload -y dump.dat second=$(md5sum dump.dat | awk ' { print $1 } ' ) -echo -echo -echo MD5 of initial dump: ${first} echo MD5 of sequent dump: ${second} echo if [ ${first} == ${second} ] ; then diff --git a/citadel/server/modules/autocompletion/serv_autocompletion.c b/citadel/server/modules/autocompletion/serv_autocompletion.c index 413bf472b..822e01aac 100644 --- a/citadel/server/modules/autocompletion/serv_autocompletion.c +++ b/citadel/server/modules/autocompletion/serv_autocompletion.c @@ -1,9 +1,6 @@ // Autocompletion of email recipients, etc. -// // Copyright (c) 1987-2023 by the citadel.org team -// -// This program is open source software. Use, duplication, or disclosure -// is subject to the terms of the GNU General Public License version 3. +// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License version 3. #include "../../ctdl_module.h" #include "serv_autocompletion.h" diff --git a/citadel/server/modules/bio/serv_bio.c b/citadel/server/modules/bio/serv_bio.c index 8be817ae6..6ff861551 100644 --- a/citadel/server/modules/bio/serv_bio.c +++ b/citadel/server/modules/bio/serv_bio.c @@ -3,9 +3,7 @@ // // Copyright (c) 1987-2022 by the citadel.org team // -// This program is open source software. Use, duplication, or disclosure -// is subject to the terms of the GNU General Public License, version 3. -// The program is distributed without any warranty, expressed or implied. +// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License, version 3. #include #include diff --git a/citadel/server/modules/listdeliver/serv_listdeliver.c b/citadel/server/modules/listdeliver/serv_listdeliver.c index fd1356079..a6cb74ad4 100644 --- a/citadel/server/modules/listdeliver/serv_listdeliver.c +++ b/citadel/server/modules/listdeliver/serv_listdeliver.c @@ -1,14 +1,6 @@ // This module delivers messages to mailing lists. -// -// Copyright (c) 2002-2024 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. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// Copyright (c) 2002-2024 by the citadel.org team (Art Cancro et al.) +// This program is open source software. Use, duplication, or disclosure are subject to the GNU General Public License v3. #include "../../sysdep.h" #include @@ -40,7 +32,6 @@ int doing_listdeliver = 0; - // data passed back and forth between listdeliver_do_msg() and listdeliver_sweep_room() struct lddata { long msgnum; // number of most recent message processed @@ -48,7 +39,6 @@ struct lddata { }; - void listdeliver_do_msg(long msgnum, void *userdata) { struct lddata *ld = (struct lddata *) userdata; if (!ld) return; @@ -63,6 +53,8 @@ void listdeliver_do_msg(long msgnum, void *userdata) { struct CtdlMessage *TheMessage = CtdlFetchMessage(msgnum, 1); if (!TheMessage) return; + // FIXME add the list unsubscribe instructions directly to the message text. Do it right here. + // If the subject line does not contain the name of the room, add it now. if (!bmstrcasestr(TheMessage->cm_fields[eMsgSubject], CC->room.QRname)) { snprintf(buf, sizeof buf, "[%s] %s", CC->room.QRname, TheMessage->cm_fields[eMsgSubject]); @@ -78,6 +70,13 @@ void listdeliver_do_msg(long msgnum, void *userdata) { CM_SetField(TheMessage, erFc822Addr, buf); CM_SetField(TheMessage, eReplyTo, buf); + // To: likewise needs to have something in it, definitely not the name of an actual mailing list member. + // Let's use the address and name of the room. + strcat(buf, " ("); + strcat(buf, CC->room.QRname); + strcat(buf, " )"); + CM_SetField(TheMessage, eRecipient, buf); + // With that out of the way, let's figure out who this message needs to be sent to. char *recipients = malloc(strlen(ld->netconf)); if (recipients) { diff --git a/citadel/server/modules/smtp/serv_smtpclient.c b/citadel/server/modules/smtp/serv_smtpclient.c index 03f54b108..6eedc56d0 100644 --- a/citadel/server/modules/smtp/serv_smtpclient.c +++ b/citadel/server/modules/smtp/serv_smtpclient.c @@ -224,15 +224,13 @@ int smtp_attempt_delivery(long msgid, char *recp, char *envelope_from, char *sou char unsubscribe_url[SIZ]; snprintf(base_url, sizeof base_url, "https://%s/listsub", CtdlGetConfigStr("c_fqdn")); generate_one_click_url(unsubscribe_url, base_url, "unsubscribe", source_room, recp); - cprintf("List-Unsubscribe: %s\r\n", unsubscribe_url); + cprintf("List-Unsubscribe: <%s>\r\n", unsubscribe_url); // RFC 2369 cprintf("List-Unsubscribe-Post: List-Unsubscribe=One-Click\r\n"); // RFC 8058 - } CtdlOutputMsg(msgid, MT_RFC822, HEADERS_ALL, 0, 1, NULL, 0, NULL, &fromaddr, NULL); s.TheMessage = CC->redirect_buffer; CC->redirect_buffer = NULL; - syslog(LOG_DEBUG, "fromaddr=<%s>",fromaddr); // If we have a DKIM key, try to sign the message. char *dkim_private_key = CtdlGetConfigStr("dkim_private_key"); -- 2.39.2 From 9376c4d48e7dfd6827211e3291bf57ea88e81884 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 May 2024 15:23:54 +0000 Subject: [PATCH 03/16] dumploadtest.sh now requires YES_DELETE_MY_DATABASE to be set. Before this commit, it had an exit statement that the operator had to remove to run the program. Now it just bombs out telling the operator that they have to set YES_DELETE_MY_DATABASE if they really want to do this. --- citadel/dumploadtest.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/citadel/dumploadtest.sh b/citadel/dumploadtest.sh index 50488ff80..912595df3 100755 --- a/citadel/dumploadtest.sh +++ b/citadel/dumploadtest.sh @@ -5,10 +5,21 @@ # # Did you read that correctly? Yes, it will DELETE your database. So don't run this. -exit 0 # In fact, here's an exit statement you must delete before you can even run it. + +if [ "${YES_DELETE_MY_DATABASE}" != '' ] ; then + echo Ah, I see you have set YES_DELETE_MY_DATABASE to a non-empty value. + echo The dump and load test will now proceed. +else + echo 'This script dumps the database, deletes the database, loads the database, dumps it again...' + echo '...and then compares the two dumps to see if we have full fidelity between them.' + echo 'Did you read that correctly? Yes, it will DELETE your database.' + echo 'If this is really what you want, set the environment variable YES_DELETE_MY_DATABASE' + echo 'to a non-empty value, and run it again.' + exit 0 +fi ps ax | grep citserver | grep -v grep >/dev/null 2>/dev/null && { - echo dont do this while the server is running + echo Do not do this while the server is running. exit 1 } -- 2.39.2 From 7b03e7177ca1afbb25477cdaf4781b2117a4ea75 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 May 2024 15:32:29 +0000 Subject: [PATCH 04/16] ctdlload: don't count "end|" as a bad row --- citadel/dumploadtest.sh | 7 +++---- citadel/utils/ctdlload.c | 9 +++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/citadel/dumploadtest.sh b/citadel/dumploadtest.sh index 912595df3..835986ec7 100755 --- a/citadel/dumploadtest.sh +++ b/citadel/dumploadtest.sh @@ -23,18 +23,17 @@ ps ax | grep citserver | grep -v grep >/dev/null 2>/dev/null && { exit 1 } -echo -echo - ./ctdldump -y >dump.dat first=$(md5sum dump.dat | awk ' { print $1 } ' ) -echo MD5 of initial dump: ${first} rm -fv data/* ./ctdlload -y dump.dat second=$(md5sum dump.dat | awk ' { print $1 } ' ) +echo +echo +echo MD5 of initial dump: ${first} echo MD5 of sequent dump: ${second} echo if [ ${first} == ${second} ] ; then diff --git a/citadel/utils/ctdlload.c b/citadel/utils/ctdlload.c index e69aa0873..aed19b472 100644 --- a/citadel/utils/ctdlload.c +++ b/citadel/utils/ctdlload.c @@ -696,6 +696,7 @@ void ingest_one(char *line, struct cdbkeyval *kv) { ++good_rows; } else { + fprintf(stderr, "bad row: <%s>\n", line); ++bad_rows; } @@ -736,6 +737,10 @@ void ingest(void) { } if (line_len > 0) { + if (!strncasecmp(line, HKEY("end|"))) { + fprintf(stderr, "\n"); + end_found = 1; + } if ( (begin_found) && (!end_found) ) { ingest_one(line, &kv); } @@ -743,10 +748,6 @@ void ingest(void) { begin_found = 1; fprintf(stderr, " good rows / bad rows:\n"); } - if (!strncasecmp(line, HKEY("end|"))) { - fprintf(stderr, "\n"); - end_found = 1; - } } } while (ch >= 0); -- 2.39.2 From 7f9ff763d19b6acdbb3df6166e4e36388971aaf8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 21 May 2024 15:38:26 +0000 Subject: [PATCH 05/16] I thought Richard Stallman was a douchebag before it was cool. --- citadel/server/modules/expire/expire_policy.c | 54 ++++++------------- citadel/server/modules/expire/serv_expire.c | 5 +- 2 files changed, 18 insertions(+), 41 deletions(-) diff --git a/citadel/server/modules/expire/expire_policy.c b/citadel/server/modules/expire/expire_policy.c index 32db98ad2..ce302a6b3 100644 --- a/citadel/server/modules/expire/expire_policy.c +++ b/citadel/server/modules/expire/expire_policy.c @@ -1,15 +1,6 @@ -/* - * Functions which manage expire policy for rooms - * Copyright (c) 1987-2015 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Functions which manage expire policy for rooms +// Copyright (c) 1987-2024 by citadel.org (Art Cancro et al.) +// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License, version 3. #include "../../sysdep.h" #include @@ -17,7 +8,6 @@ #include #include #include - #include #include #include @@ -33,21 +23,18 @@ #include "../../ctdl_module.h" #include "../../user_ops.h" -/* - * Retrieve the applicable expire policy for a specific room - */ +// Retrieve the applicable expire policy for a specific room void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) { struct floor *fl; - /* If the room has its own policy, return it */ + // If the room has its own policy, return it if (qrbuf->QRep.expire_mode != 0) { memcpy(epbuf, &qrbuf->QRep, sizeof(struct ExpirePolicy)); return; } - /* (non-mailbox rooms) - * If the floor has its own policy, return it - */ + // (non-mailbox rooms) + // If the floor has its own policy, return it if ( (qrbuf->QRflags & QR_MAILBOX) == 0) { fl = CtdlGetCachedFloor(qrbuf->QRfloor); if (fl->f_ep.expire_mode != 0) { @@ -56,9 +43,8 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) { } } - /* (Mailbox rooms) - * If there is a default policy for mailbox rooms, return it - */ + // (Mailbox rooms) + // If there is a default policy for mailbox rooms, return it if (qrbuf->QRflags & QR_MAILBOX) { if (CtdlGetConfigInt("c_mbxep_mode") != 0) { epbuf->expire_mode = CtdlGetConfigInt("c_mbxep_mode"); @@ -67,15 +53,13 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) { } } - /* Otherwise, fall back on the system default */ + // Otherwise, fall back on the system default epbuf->expire_mode = CtdlGetConfigInt("c_ep_mode"); epbuf->expire_value = CtdlGetConfigInt("c_ep_value"); } -/* - * Get Policy EXpire - */ +// Get Policy EXpire void cmd_gpex(char *argbuf) { struct ExpirePolicy exp; struct floor *fl; @@ -107,9 +91,7 @@ void cmd_gpex(char *argbuf) { } -/* - * Set Policy EXpire - */ +// Set Policy EXpire void cmd_spex(char *argbuf) { struct ExpirePolicy exp; struct floor flbuf; @@ -125,8 +107,7 @@ void cmd_spex(char *argbuf) { return; } - if ((!strcasecmp(which, strof(roompolicy))) || (!strcasecmp(which, "room"))) - { + if ((!strcasecmp(which, strof(roompolicy))) || (!strcasecmp(which, "room"))) { if (!is_room_aide()) { cprintf("%d Higher access required.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; @@ -148,8 +129,7 @@ void cmd_spex(char *argbuf) { return; } - if ((!strcasecmp(which, strof(floorpolicy))) || (!strcasecmp(which, "floor"))) - { + if ((!strcasecmp(which, strof(floorpolicy))) || (!strcasecmp(which, "floor"))) { lgetfloor(&flbuf, CC->room.QRfloor); memcpy(&flbuf.f_ep, &exp, sizeof(struct ExpirePolicy)); lputfloor(&flbuf, CC->room.QRfloor); @@ -157,16 +137,14 @@ void cmd_spex(char *argbuf) { return; } - else if ((!strcasecmp(which, strof(mailboxespolicy))) || (!strcasecmp(which, "mailboxes"))) - { + else if ((!strcasecmp(which, strof(mailboxespolicy))) || (!strcasecmp(which, "mailboxes"))) { CtdlSetConfigInt("c_mbxep_mode", exp.expire_mode); CtdlSetConfigInt("c_mbxep_value", exp.expire_value); cprintf("%d Default expire policy for mailboxes set.\n", CIT_OK); return; } - else if ((!strcasecmp(which, strof(sitepolicy))) || (!strcasecmp(which, "site"))) - { + else if ((!strcasecmp(which, strof(sitepolicy))) || (!strcasecmp(which, "site"))) { if (exp.expire_mode == EXPIRE_NEXTLEVEL) { cprintf("%d Invalid policy (no higher level)\n", ERROR + ILLEGAL_VALUE); return; diff --git a/citadel/server/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c index fe4b60b4a..63b8fc191 100644 --- a/citadel/server/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -2,10 +2,9 @@ // // You might also see this module affectionately referred to as TDAP (The Dreaded Auto-Purger). // -// Copyright (c) 1988-2023 by citadel.org (Art Cancro, Wilifried Goesgens, and others) +// Copyright (c) 1988-2024 by citadel.org (Art Cancro et al.) // -// This program is open source software. Use, duplication, or disclosure -// is subject to the terms of the GNU General Public License, version 3. +// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License, version 3. #include "../../sysdep.h" -- 2.39.2 From f636019b302bc70eec15cd4d0b95453ddc1edced Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 22 May 2024 03:24:53 +0000 Subject: [PATCH 06/16] Remove preprocessor tests for OpenSSL. It's a requirement. --- citadel/configure | 1 - citadel/server/context.c | 3 - citadel/server/context.h | 2 - citadel/server/modules/crypto/serv_crypto.c | 6 -- citadel/server/modules/crypto/serv_crypto.h | 3 - .../server/modules/ctdlproto/serv_ctdlproto.c | 80 ++++++++----------- citadel/server/modules/imap/serv_imap.c | 8 -- citadel/server/modules/nntp/serv_nntp.c | 6 -- citadel/server/modules/pop3/serv_pop3.c | 26 +++--- citadel/server/modules/smtp/serv_smtp.c | 12 +-- citadel/server/modules/xmpp/serv_xmpp.c | 7 -- citadel/server/modules/xmpp/xmpp_queue.c | 30 +++---- citadel/server/serv_extensions.c | 2 - citadel/server/server.h | 2 - citadel/server/sysdep.c | 24 ++---- 15 files changed, 59 insertions(+), 153 deletions(-) diff --git a/citadel/configure b/citadel/configure index ad136e3ac..381a2544c 100755 --- a/citadel/configure +++ b/citadel/configure @@ -74,7 +74,6 @@ int main(int argc, char **argv) { } ! $CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile >/dev/null 2>&1 && { - CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } || { echo Citadel Server requires OpenSSL which is not present. diff --git a/citadel/server/context.c b/citadel/server/context.c index 6415ce12a..81709b5b5 100644 --- a/citadel/server/context.c +++ b/citadel/server/context.c @@ -318,10 +318,7 @@ CitContext *CloneContext(CitContext *CloneMe) { me->MigrateBuf = NULL; me->sMigrateBuf = NULL; me->redirect_buffer = NULL; -#ifdef HAVE_OPENSSL me->ssl = NULL; -#endif - me->download_fp = NULL; me->upload_fp = NULL; me->ma = NULL; diff --git a/citadel/server/context.h b/citadel/server/context.h index d28dff7a7..1b207b645 100644 --- a/citadel/server/context.h +++ b/citadel/server/context.h @@ -56,10 +56,8 @@ struct CitContext { // Redirect this session's output to a memory buffer? StrBuf *redirect_buffer; // the buffer StrBuf *StatusMessage; -#ifdef HAVE_OPENSSL SSL *ssl; int redirect_ssl; -#endif char curr_user[USERNAME_SIZE]; // name of current user int logged_in; // logged in? diff --git a/citadel/server/modules/crypto/serv_crypto.c b/citadel/server/modules/crypto/serv_crypto.c index 5d41fa27c..541479af1 100644 --- a/citadel/server/modules/crypto/serv_crypto.c +++ b/citadel/server/modules/crypto/serv_crypto.c @@ -7,11 +7,9 @@ #include #include "../../sysdep.h" -#ifdef HAVE_OPENSSL #include #include #include -#endif #include @@ -32,8 +30,6 @@ #include "../../config.h" #include "../../ctdl_module.h" -#ifdef HAVE_OPENSSL - SSL_CTX *ssl_ctx = NULL; // This SSL context is used for all sessions. char *ssl_cipher_list = CIT_CIPHERS; @@ -609,5 +605,3 @@ void endtls(void) { CC->ssl = NULL; CC->redirect_ssl = 0; } - -#endif // HAVE_OPENSSL diff --git a/citadel/server/modules/crypto/serv_crypto.h b/citadel/server/modules/crypto/serv_crypto.h index b5ee85d53..4ef8033d5 100644 --- a/citadel/server/modules/crypto/serv_crypto.h +++ b/citadel/server/modules/crypto/serv_crypto.h @@ -7,7 +7,6 @@ // Which ciphers will be offered; see https://www.openssl.org/docs/manmaster/man1/ciphers.html #define CIT_CIPHERS "ALL:RC4+RSA:+SSLv2:+TLSv1:!MD5:@STRENGTH" -#ifdef HAVE_OPENSSL #define OPENSSL_NO_KRB5 /* work around redhat b0rken ssl headers */ void init_ssl(void); void client_write_ssl (const char *buf, int nbytes); @@ -19,5 +18,3 @@ void cmd_gtls(char *params); void endtls(void); void CtdlStartTLS(char *ok_response, char *nosup_response, char *error_response); extern SSL_CTX *ssl_ctx; - -#endif diff --git a/citadel/server/modules/ctdlproto/serv_ctdlproto.c b/citadel/server/modules/ctdlproto/serv_ctdlproto.c index ae267b596..d5e7ffe61 100644 --- a/citadel/server/modules/ctdlproto/serv_ctdlproto.c +++ b/citadel/server/modules/ctdlproto/serv_ctdlproto.c @@ -1,72 +1,56 @@ -/* - * Citadel protocol main dispatcher - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// Citadel protocol main dispatcher +// Copyright (c) 1987-2024 by the citadel.org team +// This program is open source software. Use, duplication, or disclosure are subject to the GNU General Public License v3. #include #include - #include "../../citserver.h" #include "../../ctdl_module.h" #include "../../config.h" -/* - * This loop recognizes all server commands. - */ + +// This loop recognizes all server commands. void do_command_loop(void) { - struct CitContext *CCC = CC; char cmdbuf[SIZ]; - time(&CCC->lastcmd); - memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */ + time(&CC->lastcmd); + memset(cmdbuf, 0, sizeof cmdbuf); // Clear it, just in case if (client_getln(cmdbuf, sizeof cmdbuf) < 1) { syslog(LOG_INFO, "Citadel client disconnected: ending session."); - CCC->kill_me = KILLME_CLIENT_DISCONNECTED; + CC->kill_me = KILLME_CLIENT_DISCONNECTED; return; } - /* Log the server command, but don't show passwords... */ - if ( (strncasecmp(cmdbuf, "PASS", 4)) && (strncasecmp(cmdbuf, "SETP", 4)) ) { - syslog(LOG_DEBUG, "[%s(%ld)] %s", - CCC->curr_user, CCC->user.usernum, cmdbuf - ); + // Log the server command, but don't show passwords... + if ( (strncasecmp(cmdbuf, "PASS", 4)) + && (strncasecmp(cmdbuf, "SETP", 4)) + ) { + syslog(LOG_DEBUG, "[%s(%ld)] %s", CC->curr_user, CC->user.usernum, cmdbuf); } else { - syslog(LOG_DEBUG, "[%s(%ld)]