https://gitlab.synchro.net/main/sbbs/-/commit/90cb86e47ebabb08441ee1b8
Modified Files:
src/sbbs3/dupefind.vcxproj getmail.c getmail.h src/sbbs3/gtkchat/objects.mk src/sbbs3/makeuser.vcxproj newuser.cpp objects.mk src/sbbs3/scfg/objects.mk scfg.vcxproj src/sbbs3/upgrade_to_v319.vcxproj upgrade_to_v320.vcxproj userdat.c
Log Message:
Delete a recycled user record's leftover mail in newuserdat()
A new user can be created in a deleted user's record slot: newuserdat()
scans the user index for a record whose user is flagged DELETED and has
aged past sys_deldays, and reuses that number. It purges the previous occupant's leftovers -- data/file/NNNN.in and .out, data/file/NNNN.*, data/user/NNNN.*, data/msgs/NNNN.* and the legacy .ixb pointers -- but
not their mail.
Mail is matched to a user by number alone: loadmail() keeps a message
when idx.to == usernumber, and for the mail base idx.to is just the
recipient's user number, the recipient name in the header never being consulted. So any mail left in the base belongs to whoever holds the
record now: the new user reads the previous user's mail, and mail the
previous user sent is re-attributed to the new one.
del_user() deliberately leaves the mail alone, since undel_user() can
restore the account and purging on delete would make that lossy, so the
purge belongs at record-reuse time. Only sbbs_t::newuser() did it, via delallmail(), which left every other way of creating a user exposed -- system.new_user() (and so the web signup in web/root/newuser.ssjs), exec/makeuser.js, and the makeuser utility.
Purge in newuserdat() instead, alongside the cleanup it already does, so
that all of them are covered; the delallmail() call in newuser.cpp is now redundant. delallmail() is an sbbs_t method while newuserdat() is plain C reached by utilities that don't link the BBS core, so the purge is a new
C function, delusermail(), in getmail.c. That adds a getmail.o dependency
to the link units built with userdat.o.
Fixes #1186
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net