citadel.git
9 months agomsgbase.c: change to new API
Art Cancro [Thu, 17 Aug 2023 21:11:39 +0000 (12:11 -0900)]
msgbase.c: change to new API

9 months agomsgbase.c: upgrade CtdlSetSeen() to the new CtdlGetMsgList() API
Art Cancro [Wed, 16 Aug 2023 18:14:58 +0000 (09:14 -0900)]
msgbase.c: upgrade CtdlSetSeen() to the new CtdlGetMsgList() API

9 months agoserv_expire: move to new msglists call
Art Cancro [Wed, 16 Aug 2023 03:45:24 +0000 (18:45 -0900)]
serv_expire: move to new msglists call

9 months agoDRY fetch of msglists.
Art Cancro [Wed, 16 Aug 2023 03:14:24 +0000 (18:14 -0900)]
DRY fetch of msglists.

A lot of the calls to cdb_fetch(CDB_MSGLISTS...) follow the same design pattern
and many of them are in need of rework to handle how they free their memory.  So
I created a new function CtdlGetMsgList() to do it in a consistent way.  Three
callers have been migrated to the new syntax.

9 months agoserv_fulltext.c: copy the data returned by cdb_fetch() instead of taking ownership
Art Cancro [Wed, 16 Aug 2023 02:18:31 +0000 (17:18 -0900)]
serv_fulltext.c: copy the data returned by cdb_fetch() instead of taking ownership

We have to do this everywhere.  Berkeley DB can be configured to hand off ownership of memory to
the caller, but LMDB cannot.

9 months agoMore renaming of symbols that are local to the berkeley_db module.
Art Cancro [Fri, 11 Aug 2023 20:14:09 +0000 (11:14 -0900)]
More renaming of symbols that are local to the berkeley_db module.

dbp[] is now bdb_table[]
dbenv is now bdb_env

9 months agoMoved cdb_chmod_data() out of the backend API
Art Cancro [Fri, 11 Aug 2023 15:46:34 +0000 (06:46 -0900)]
Moved cdb_chmod_data() out of the backend API

This function only does file and directory level operations on
the data/ directory and files in it.  These operations will be
common across all backends.

9 months agoRenamed some more functions and variables that are specific to the bdb_ module.
Art Cancro [Fri, 11 Aug 2023 15:21:58 +0000 (06:21 -0900)]
Renamed some more functions and variables that are specific to the bdb_ module.

9 months agocomments cleanup
Art Cancro [Fri, 11 Aug 2023 13:21:45 +0000 (04:21 -0900)]
comments cleanup

9 months agoThis works much better. TSD maintained in-module instead of globally.
Art Cancro [Fri, 11 Aug 2023 13:13:23 +0000 (04:13 -0900)]
This works much better.  TSD maintained in-module instead of globally.

9 months agoRevert "Prepared for upcoming change to cdb_next_item() API."
Art Cancro [Fri, 11 Aug 2023 12:42:46 +0000 (03:42 -0900)]
Revert "Prepared for upcoming change to cdb_next_item() API."

This reverts commit d805c8202867ff3cc4049e5df6a3e871c4fdc5be.

9 months agoRevert "Changed the API for cdb_rewind() / cdb_next_item() to make the caller hold...
Art Cancro [Fri, 11 Aug 2023 12:42:20 +0000 (03:42 -0900)]
Revert "Changed the API for cdb_rewind() / cdb_next_item() to make the caller hold the cursor"

This reverts commit 733c6e8f2a624fb641cc50a9d253b3a914c25bba.

9 months agoChanged the API for cdb_rewind() / cdb_next_item() to make the caller hold the cursor
Art Cancro [Thu, 10 Aug 2023 17:07:07 +0000 (08:07 -0900)]
Changed the API for cdb_rewind() / cdb_next_item() to make the caller hold the cursor

9 months agoPrepared for upcoming change to cdb_next_item() API.
Art Cancro [Thu, 10 Aug 2023 14:49:50 +0000 (05:49 -0900)]
Prepared for upcoming change to cdb_next_item() API.

cdb_next_item() is always preceded by a call to cdb_rewind() before the
iteration loop.  We're going to remove the cursor from thread-specific
data, and replace it with a void pointer that the caller is responsible
for passing back.  This will make the backend drivers easier to build.

9 months agoimap_acl.c: update to C99 style comments
Art Cancro [Thu, 10 Aug 2023 14:46:49 +0000 (05:46 -0900)]
imap_acl.c: update to C99 style comments

9 months agoberkeley_db.c: remove includes that are no longer needed
Art Cancro [Wed, 9 Aug 2023 15:57:51 +0000 (11:57 -0400)]
berkeley_db.c: remove includes that are no longer needed

9 months agodocument private/public functions in berkeley_db.c
Art Cancro [Wed, 9 Aug 2023 15:52:45 +0000 (11:52 -0400)]
document private/public functions in berkeley_db.c

9 months agoberkeley_db.c: prefixed all module-local functions with bdb_ to avoid namespace colli...
Art Cancro [Wed, 9 Aug 2023 15:47:02 +0000 (11:47 -0400)]
berkeley_db.c: prefixed all module-local functions with bdb_ to avoid namespace collisions

9 months agoMoved cdb_ prototypes from berkeley_db.c to database.c where they belong
Art Cancro [Wed, 9 Aug 2023 15:41:23 +0000 (11:41 -0400)]
Moved cdb_ prototypes from berkeley_db.c to database.c where they belong

9 months agoBuilding better abstractions for the backend interface
Art Cancro [Wed, 9 Aug 2023 14:20:44 +0000 (10:20 -0400)]
Building better abstractions for the backend interface

9 months agoserver/database_bdb.c is now server/backends/berkeley_db/berkeley_db.c
Art Cancro [Wed, 9 Aug 2023 14:06:47 +0000 (10:06 -0400)]
server/database_bdb.c is now server/backends/berkeley_db/berkeley_db.c

9 months agocdb_init_backends() just calls bdb_init_backend() for now
Art Cancro [Tue, 8 Aug 2023 22:03:40 +0000 (18:03 -0400)]
cdb_init_backends() just calls bdb_init_backend() for now

9 months agoSilenced a compiler warning by bringing in the correct include files.
Art Cancro [Tue, 8 Aug 2023 21:57:39 +0000 (17:57 -0400)]
Silenced a compiler warning by bringing in the correct include files.

9 months agoMostly finished the abstractions, now just need to silence some compiler warnings...
Art Cancro [Tue, 8 Aug 2023 21:55:10 +0000 (17:55 -0400)]
Mostly finished the abstractions, now just need to silence some compiler warnings that came up

9 months agosaving my work before I do the rest of the functions en masse
Art Cancro [Tue, 8 Aug 2023 21:47:13 +0000 (17:47 -0400)]
saving my work before I do the rest of the functions en masse

9 months agoTried it with a function that requires a parameter
Art Cancro [Tue, 8 Aug 2023 21:42:35 +0000 (17:42 -0400)]
Tried it with a function that requires a parameter

9 months agoBegin turning cdb_ functions into pointers assigned to bdb_ functions
Art Cancro [Tue, 8 Aug 2023 21:40:50 +0000 (17:40 -0400)]
Begin turning cdb_ functions into pointers assigned to bdb_ functions

9 months agomade the prototypes prettier
Art Cancro [Tue, 8 Aug 2023 19:34:25 +0000 (15:34 -0400)]
made the prototypes prettier

9 months agoctdl_module_init_database() is now ctdl_module_init_database_bdb()
Art Cancro [Tue, 8 Aug 2023 18:00:25 +0000 (14:00 -0400)]
ctdl_module_init_database() is now ctdl_module_init_database_bdb()

9 months agoopen_databases() and close_databases() are now cdb_open_databases() and cdb_close_dat...
Art Cancro [Tue, 8 Aug 2023 17:25:16 +0000 (13:25 -0400)]
open_databases() and close_databases() are now cdb_open_databases() and cdb_close_databases()

9 months agousetable.c: moved CheckIfAlreadySeen() out of database.c
Art Cancro [Tue, 8 Aug 2023 17:17:27 +0000 (13:17 -0400)]
usetable.c: moved CheckIfAlreadySeen() out of database.c

9 months agoAlso remove cdb_allocate_tsd(), cdb_free_tsd(), cdb_cull_logs()
Art Cancro [Tue, 8 Aug 2023 14:04:54 +0000 (10:04 -0400)]
Also remove cdb_allocate_tsd(), cdb_free_tsd(), cdb_cull_logs()

It is important to get this right because it's going to become a driver interface for databases

9 months agoRemoved checkpoint_thread() prototype from database.h , this is not a real function...
Art Cancro [Tue, 8 Aug 2023 13:59:04 +0000 (09:59 -0400)]
Removed checkpoint_thread() prototype from database.h , this is not a real function anymore

9 months agodatabase.h: assert that it is an internal API that should remain consistent across...
Art Cancro [Mon, 7 Aug 2023 15:26:28 +0000 (06:26 -0900)]
database.h: assert that it is an internal API that should remain consistent across multiple back ends.

9 months agoRenamed database.c to database_bdb.c
Art Cancro [Mon, 7 Aug 2023 15:24:03 +0000 (06:24 -0900)]
Renamed database.c to database_bdb.c

9 months agoserv_nntp.c: change everything to C99 comment style
Art Cancro [Mon, 7 Aug 2023 15:18:38 +0000 (06:18 -0900)]
serv_nntp.c: change everything to C99 comment style

9 months agoMarked code that will require some rework for LMDB.
Art Cancro [Mon, 7 Aug 2023 14:55:11 +0000 (05:55 -0900)]
Marked code that will require some rework for LMDB.

When BDB returns data, the caller owns the memory and is required to
free it, which we usually do.  I marked the places where we take ownership
of memory pointers and then set the BDB ptr to NULL.  If we switch to
LMDB, those pointers remain valid forever, so we cannot simply free them
later.

9 months agopoint out sessions that are timed out but non-idle
Art Cancro [Fri, 4 Aug 2023 15:18:06 +0000 (11:18 -0400)]
point out sessions that are timed out but non-idle

9 months agoverify that 'begin' and 'end' lines were found
Art Cancro [Wed, 2 Aug 2023 17:50:12 +0000 (13:50 -0400)]
verify that 'begin' and 'end' lines were found

9 months agobegan work on enumerating attachments in the mail view
Art Cancro [Wed, 2 Aug 2023 03:54:25 +0000 (18:54 -0900)]
began work on enumerating attachments in the mail view

9 months agoEnumerate attachments in JSON message output
Art Cancro [Wed, 2 Aug 2023 02:40:55 +0000 (17:40 -0900)]
Enumerate attachments in JSON message output

9 months agoMerge branch 'ConstStr_Access_Checks' into 'master'
Art Cancro [Wed, 2 Aug 2023 00:44:02 +0000 (00:44 +0000)]
Merge branch 'ConstStr_Access_Checks' into 'master'

IMAP memory issues with use of ConstStr

See merge request citadel/citadel!5

9 months agoRelease version 988 generated by do-release.sh v988
Art Cancro [Tue, 1 Aug 2023 02:32:40 +0000 (17:32 -0900)]
Release version 988 generated by do-release.sh

9 months agoctdldump/ctdlload: -h now specifies the top-level Citadel directory, just like all...
Art Cancro [Tue, 1 Aug 2023 02:32:29 +0000 (17:32 -0900)]
ctdldump/ctdlload: -h now specifies the top-level Citadel directory, just like all the other programs, and defaults to the compiled-in Citadel directory, just like all the other programs

9 months agoMore reliable search for guesstimezone.sh
Art Cancro [Wed, 26 Jul 2023 17:05:47 +0000 (08:05 -0900)]
More reliable search for guesstimezone.sh

9 months agoRelease version 987 generated by do-release.sh v987
Art Cancro [Tue, 25 Jul 2023 23:08:30 +0000 (14:08 -0900)]
Release version 987 generated by do-release.sh

9 months agoctdldump/ctdlload: more testing
Art Cancro [Tue, 25 Jul 2023 23:08:20 +0000 (14:08 -0900)]
ctdldump/ctdlload: more testing

9 months agoctdlload: finished remaining record types; need to test
Art Cancro [Tue, 25 Jul 2023 19:10:17 +0000 (10:10 -0900)]
ctdlload: finished remaining record types; need to test

9 months agoskip the database open for the unused table to keep it from erroring out
Art Cancro [Tue, 25 Jul 2023 15:34:07 +0000 (06:34 -0900)]
skip the database open for the unused table to keep it from erroring out

9 months agoctdlload: euidindex
Art Cancro [Tue, 25 Jul 2023 15:28:32 +0000 (06:28 -0900)]
ctdlload: euidindex

9 months agoctdlload: usersbynumber
Art Cancro [Tue, 25 Jul 2023 15:17:47 +0000 (06:17 -0900)]
ctdlload: usersbynumber

9 months agoadd some //FIXME tags where needed
Art Cancro [Tue, 25 Jul 2023 14:53:23 +0000 (05:53 -0900)]
add some //FIXME tags where needed

9 months agoimport fulltext index records
Art Cancro [Mon, 24 Jul 2023 19:15:58 +0000 (10:15 -0900)]
import fulltext index records

9 months agostub functions for new import routines
Art Cancro [Mon, 24 Jul 2023 17:56:43 +0000 (08:56 -0900)]
stub functions for new import routines

9 months agoExport euidindex records
Art Cancro [Mon, 24 Jul 2023 15:31:23 +0000 (06:31 -0900)]
Export euidindex records

9 months agoexport fulltext records
Art Cancro [Mon, 24 Jul 2023 15:25:57 +0000 (06:25 -0900)]
export fulltext records

9 months agoBoth banners now use the same color scheme
Art Cancro [Mon, 24 Jul 2023 15:16:49 +0000 (06:16 -0900)]
Both banners now use the same color scheme

9 months agoGo back to exporting dir and usersbynumber records.
Art Cancro [Mon, 24 Jul 2023 15:13:18 +0000 (06:13 -0900)]
Go back to exporting dir and usersbynumber records.

We will also be exporting fulltext, euidindex, etc records.
Re-generating them on the target server after import is just way too time consuming.

9 months agoWhen exporting visit records, if there is corrupt (non-printable) data in seen/answer...
Art Cancro [Mon, 24 Jul 2023 15:09:18 +0000 (06:09 -0900)]
When exporting visit records, if there is corrupt (non-printable) data in seen/answered arrays, cut that out before exporting

9 months agoRelease version 986 generated by do-release.sh v986
Art Cancro [Sat, 22 Jul 2023 20:42:45 +0000 (11:42 -0900)]
Release version 986 generated by do-release.sh

9 months agoFixed bad import in thing
Art Cancro [Sat, 22 Jul 2023 20:42:35 +0000 (11:42 -0900)]
Fixed bad import in thing

9 months agoRelease version 985 generated by do-release.sh v985
Art Cancro [Sat, 22 Jul 2023 16:24:12 +0000 (07:24 -0900)]
Release version 985 generated by do-release.sh

9 months agoAggressively sync
Art Cancro [Sat, 22 Jul 2023 16:24:05 +0000 (07:24 -0900)]
Aggressively sync

9 months agoBe more aggressive about closing the databases during a segfault
Art Cancro [Sat, 22 Jul 2023 16:09:49 +0000 (07:09 -0900)]
Be more aggressive about closing the databases during a segfault

9 months agoTry to close the databases if we segfault
Art Cancro [Sat, 22 Jul 2023 15:53:46 +0000 (06:53 -0900)]
Try to close the databases if we segfault

9 months agoRelease version 984 generated by do-release.sh v984
Art Cancro [Sat, 22 Jul 2023 14:50:11 +0000 (05:50 -0900)]
Release version 984 generated by do-release.sh

9 months agoctdldump/ctdlload: fixed on Raspberry Pi, reintroduced to build
Art Cancro [Sat, 22 Jul 2023 14:48:44 +0000 (10:48 -0400)]
ctdldump/ctdlload: fixed on Raspberry Pi, reintroduced to build

9 months agoadd prototype for b64unalphabet() to silence warning
Art Cancro [Sat, 22 Jul 2023 14:18:36 +0000 (10:18 -0400)]
add prototype for b64unalphabet() to silence warning

9 months agoMerge branch 'Memory_Leak_SmtpClient' into 'master'
Art Cancro [Fri, 21 Jul 2023 22:10:57 +0000 (22:10 +0000)]
Merge branch 'Memory_Leak_SmtpClient' into 'master'

Memory leak in SMTP Client string trim

See merge request citadel/citadel!4

9 months agoRelease version 983 generated by do-release.sh v983
Art Cancro [Fri, 21 Jul 2023 21:30:18 +0000 (12:30 -0900)]
Release version 983 generated by do-release.sh

9 months agoRelease version 982 generated by do-release.sh v982
Art Cancro [Fri, 21 Jul 2023 21:27:11 +0000 (12:27 -0900)]
Release version 982 generated by do-release.sh

9 months agoRelease version 981 generated by do-release.sh v981
Art Cancro [Fri, 21 Jul 2023 21:21:27 +0000 (12:21 -0900)]
Release version 981 generated by do-release.sh

9 months agoIMAP memory issues with use of ConstStr
Harlow Solutions [Thu, 20 Jul 2023 18:40:56 +0000 (14:40 -0400)]
IMAP memory issues with use of ConstStr

Had a coredump in IMAP Search parsing.  Not sure of root cause, but parameter string parsing
  of IMAP Search coredumped on ConstStr pointer content access.

When ConstStr are created, pointer is null and length is zero.  Some code accesses the pointer
  contents without checking length first.  Not sure how parameter parsing passed a zero length
parameter, but added length checks before accessing throughout IMAP code to be safe.

While adding checks, found a typo in checking string for end of string in imap_list().
  Was using address of character instead of looking for null termination.  Corrected.

9 months agoMemory leak in SMTP Client string trim
Harlow Solutions [Tue, 18 Jul 2023 20:05:04 +0000 (16:05 -0400)]
Memory leak in SMTP Client string trim

serv_smtpclient.c: Removed unused variable 't' from trim_response() which was malloc'ing memory

10 months agoRemoved serv_migrate.c and ctdlmigrate. They are replaced by ctdldump and ctdlload.
Art Cancro [Tue, 18 Jul 2023 03:42:29 +0000 (18:42 -0900)]
Removed serv_migrate.c and ctdlmigrate.  They are replaced by ctdldump and ctdlload.

10 months agoremove extra msgs
Art Cancro [Tue, 18 Jul 2023 03:17:50 +0000 (18:17 -0900)]
remove extra msgs

10 months agoctdldump/ctdlload is functionally complete.
Art Cancro [Tue, 18 Jul 2023 03:12:20 +0000 (18:12 -0900)]
ctdldump/ctdlload is functionally complete.

10 months agohappy happy: convert_msgtext() also works for convert_bigmsgs()
Art Cancro [Tue, 18 Jul 2023 02:55:27 +0000 (17:55 -0900)]
happy happy: convert_msgtext() also works for convert_bigmsgs()

10 months agoctdlload: import use table records
Art Cancro [Tue, 18 Jul 2023 02:50:17 +0000 (17:50 -0900)]
ctdlload: import use table records

10 months agocitserver: regenerate secondary indices if the regenerate_secondary_indices config...
Art Cancro [Mon, 17 Jul 2023 21:25:20 +0000 (12:25 -0900)]
citserver: regenerate secondary indices if the regenerate_secondary_indices config key is set to nonzero

10 months agoctdldump/ctdlload: removed tables that can be re-generated by the server.
Art Cancro [Mon, 17 Jul 2023 21:11:18 +0000 (12:11 -0900)]
ctdldump/ctdlload: removed tables that can be re-generated by the server.

Added a new config key to the server that forces it to do that the next time it is run.

10 months agoBeautiful startup banners in vivid color
Art Cancro [Mon, 17 Jul 2023 20:10:55 +0000 (11:10 -0900)]
Beautiful startup banners in vivid color

10 months agoctdlload: import visits
Art Cancro [Mon, 17 Jul 2023 19:44:25 +0000 (10:44 -0900)]
ctdlload: import visits

10 months agoimport msglists
Art Cancro [Mon, 17 Jul 2023 03:24:11 +0000 (18:24 -0900)]
import msglists

10 months agoctdlload: import floor table
Art Cancro [Mon, 17 Jul 2023 03:11:05 +0000 (18:11 -0900)]
ctdlload: import floor table

10 months agoctdlload: import room records
Art Cancro [Mon, 17 Jul 2023 03:01:53 +0000 (18:01 -0900)]
ctdlload: import room records

10 months agoReplaced all the pointer arithmetic in getuser/putuser with readable.
Art Cancro [Sat, 15 Jul 2023 00:26:50 +0000 (15:26 -0900)]
Replaced all the pointer arithmetic in getuser/putuser with readable.

10 months agoPretty statistics
Art Cancro [Fri, 14 Jul 2023 23:58:27 +0000 (14:58 -0900)]
Pretty statistics

10 months agoNow I have a machine gun that can write ctdluser records. Ho-ho-ho.
Art Cancro [Fri, 14 Jul 2023 20:22:19 +0000 (11:22 -0900)]
Now I have a machine gun that can write ctdluser records.  Ho-ho-ho.

10 months agoMoved makeuserkey() into its own file because we need it in ctdlload
Art Cancro [Fri, 14 Jul 2023 03:23:55 +0000 (18:23 -0900)]
Moved makeuserkey() into its own file because we need it in ctdlload

10 months agoctdlload: load message metadata
Art Cancro [Fri, 14 Jul 2023 03:18:02 +0000 (18:18 -0900)]
ctdlload: load message metadata

10 months agoctdlload: load msgtext
Art Cancro [Fri, 14 Jul 2023 03:09:31 +0000 (18:09 -0900)]
ctdlload: load msgtext

10 months agoctdlload: skeleton code for table ingestion
Art Cancro [Thu, 13 Jul 2023 15:34:07 +0000 (06:34 -0900)]
ctdlload: skeleton code for table ingestion

10 months ago./ctdldump -y -h./data | ./ctdlload -y -h./newdata
Art Cancro [Thu, 13 Jul 2023 15:12:31 +0000 (06:12 -0900)]
./ctdldump -y -h./data | ./ctdlload -y -h./newdata

10 months ago./ctdldump -y -h./data | ./ctdlload -y -h./newdata
Art Cancro [Wed, 12 Jul 2023 20:27:58 +0000 (11:27 -0900)]
./ctdldump -y -h./data | ./ctdlload -y -h./newdata

10 months agoctdlload: wrote the code to ingest dump lines
Art Cancro [Wed, 12 Jul 2023 20:25:05 +0000 (11:25 -0900)]
ctdlload: wrote the code to ingest dump lines

10 months agoCleaned up config dump so there are no nulls in the dump
Art Cancro [Wed, 12 Jul 2023 02:32:37 +0000 (17:32 -0900)]
Cleaned up config dump so there are no nulls in the dump

10 months agoctdldump: convert binary to base64 instead of hex
Art Cancro [Wed, 12 Jul 2023 02:29:58 +0000 (17:29 -0900)]
ctdldump: convert binary to base64 instead of hex

10 months agoctdldump: dump config records. This is now functionally complete.
Art Cancro [Wed, 12 Jul 2023 02:22:14 +0000 (17:22 -0900)]
ctdldump: dump config records.  This is now functionally complete.

10 months agoctdldump: export usersbynumber (secondary index)
Art Cancro [Wed, 12 Jul 2023 02:04:26 +0000 (17:04 -0900)]
ctdldump: export usersbynumber (secondary index)