Art Cancro [Sun, 4 Jun 2023 03:41:01 +0000 (18:41 -0900)]
Remediated an unrecoverable problem in CDB_USETABLE.
Due to a missing null terminator, records were being stored with
excessive lengths, resulting in records whose keys did not match.
Unfortunately this means we have to zero out the table during an upgrade
to Citadel Server 975. No user data will be lost, but incoming data
such as RSS feeds and POP3 retrievals may produce some unwanted
duplicates.
The new implementation not only remediates this problem, but also works
using a hash of the item rather than the item itself. This produces
records that are only 12 bytes long.
Fixed imap_append() from clearing all flags on messages and avoid purge_user() from purging the wrong Visit records.
imap_misc.c: imap_append() was trying to append the flags after the room had been restored to the original room, so all flags in the room were being cleared. Moved imap_do_append_flags() before the room was changed back.
user_ops.c: purge_user() was assuming that the first part of the key for Visit records was the user number. Actually is the room number so was removing records where the room and user numbers matched. A solution is to go through all the Visit records and delete, but not worth it. Auto-Purge will clean up the records later. Future: When expanded IMAP flagging is added, we will move the user number to the top of the key and reactivate the existing method.
ctdl3264_prep.sh: Build fix to support ‘tail’ command version differences for + option. CentOS/Rocky Linux needs -n option added for command not to error. Now tests command and sets the proper option to work.
Art Cancro [Thu, 4 May 2023 22:14:10 +0000 (18:14 -0400)]
tools.c: bugfixes to trim functions (Phil Slack)
libcitadel/lib/tools.c
stripout()
Strips too many characters. Causes incorrect From address on inbound and probably other places.
stripout(“Foobar<foobar@foobar.com>”) = Fooba. Should be Foobar
Mangles multiple boundaries. Should strip using outer boundaries.
stripout(“ABC()(DEF)()GHI”) = ABC()(DEFGHI. Should return ABCGHI.
stripallbut()
Handle outer boundaries like stripout()
stripallbut(“ABC()(DEF)()GHI”) returns unchanged. Should return )(DEF)(
Code does a stderr flush. Not sure why, but left it in.
string_trimlen()
Removed function. Not used anywhere in the code and less efficient than string_trim()
Art Cancro [Thu, 4 May 2023 22:11:24 +0000 (18:11 -0400)]
sysdep.c: cprintf() truncation fix (Phil Slack)
Original code (sysdep.c) assumed a return code of -1 from vsnprintf()
was a truncation. Actually, it is an output error and the code still
tried to output it. A return of the buffer size or larger means it was
truncated. Changed the processing to handle return values properly.
Art Cancro [Tue, 2 May 2023 02:42:14 +0000 (22:42 -0400)]
Apply patches sent by Harlow Solutions -- for WebCit
Fix missing parenthesis in Edit Bio and Wiki empty page
Fix multiple pages and code to start/end <div> sections properly.
In the Summary page, add line breaks to the “About this server” widget to make it more readable.
In contact view (msg_display) fix missing address label title (invalid variable used) and use variables for other labels instead of hard coding.
When displaying Contact address, remove blank lines if P.O. Box or street fields are blank.
subst.c: Expand ITEM format X to allow appending text after a non-blank ITEM value. Used to add line breaks only on non-blank lines, etc.
download.c and static.c: Fix invalid reference to blank gif because the output function added the request line from original image to the link which is invalid.