- Nov 18, 2024
-
-
Rob Swindell authored
and might return before setting it to anything else.
-
Deucе authored
-
Rob Swindell authored
For some reason, MSVC was initializing the time_t (second element of the struct) to -1, not the int fd (the first element), which was initialized to 0. Weird.
-
Rob Swindell authored
The auto-remove param was only needed for fmutex(), which immediately closes (and thus don't want auto-removal), so create an internal function that's used by both fmutex() and fmutex_open().
-
Rob Swindell authored
This is needed for *nix where normal (i.e. not Samba-mount) file behavior requires that we manually unlink() the file, but not until just before closing it. So we have to keep track of the file name and the 'auto_remove' desire of the caller. This is not necessary when the file is on a Linux-smbfs, but we need to work as expected on normal/local *nix file systems too. This solves atomic lock file removal for *nix, but does not gaurantee lock file cleanup upon ungraceful process termination (e.g. crash). At least in this particular case, Windows beats UNIX.
-
Rob Swindell authored
This reverts commit e55183c0. fmutex_open()'s auto-remove feature doesn't work on normal/local Linux file systems: unlink() of a file immediately removes its directory entry allowing subsequent opens of the same file name, defeating the lock. I had tested fmutex_open() on a Samba mount (from Linux) and it worked as I wanted (like the Windows version does). Still searching for a good solution: if a process terminates, gracefully or not, I'd like the file to be removed at that time and until then, other processes or threads can't create or open the same lock file (using O_EXCL and file locking to insure this).
-
- Nov 17, 2024
-
-
Rob Swindell authored
Oh, so much copy/paste eliminated!
-
Deucе authored
-
Deucе authored
This appears to be the best we can do when Windows+M (minimize all) is pressed. We don't seem to be notified that we should minimize, only that a different application is being activated. This also makes Alt-TAB behave a bit more like expected.
-
Rob Swindell authored
-
Rob Swindell authored
This condition caused aborting BBS operations via Ctrl-C to fail when connecting from a traditional Telnet client using binary transmission mode (e.g. telnet -8) or SyncTERM v1.2rc6. The check of rio_abortable was probably enough to disable this function during file transfers (e.g. we've had no issues with SSH file transfers that might include byte 0x03 received from the client), but I added the check for SS_FILEXFER system status check too, perhaps unnecessary.
-
Rob Swindell authored
-
Rob Swindell authored
On *nix, you need the command shell to do wildcard expansion of filenames
-
Rob Swindell authored
-
Rob Swindell authored
-
Rob Swindell authored
-
Rob Swindell authored
Add the errno value to help root-cause. We really should be using safe_strerror() everywhere.
-
- Nov 16, 2024
-
-
Rob Swindell authored
-
Rob Swindell authored
This appears to be the only way to 100% provide mutual exclusivity between Windows and Linux client sharing a Samba file system. Also, make fmutex_close() take a pointer to the file descriptor so that we can better manage the resource (i.e. don't close a descriptor that's already been closed and possibly valid in another thread).
-
Rob Swindell authored
... which simplifies the fmutex_close() function and signature.
-
Rob Swindell authored
By default, the duration is infinite, but some sysops may not want this file to be ever-grower but rather periodically pruned by the new trashman utility. Sysop that don't use spambait.cfg won't benefit from this change.
-
Rob Swindell authored
-
Rob Swindell authored
Also, don't get hostname unless we're surely going to write to the file.
-
Rob Swindell authored
-
Rob Swindell authored
The 'atomic_remove' argument isn't used in non-Windows builds since we can remove() before close() on non-Windows OSes already.
-
Rob Swindell authored
-
Rob Swindell authored
-
Rob Swindell authored
-
Rob Swindell authored
O_EXCL doesn't appear to be working very reliably over Samba, so let's add file locking to the equation.
-
- Nov 15, 2024
-
-
Rob Swindell authored
glob() results might be out of date by the time we look at each file, just skip missing QWK pack semaphore files silently. This should resolve the ".now already gone" messages too. Hopefully. Removed some extraneous quotes around logged event command-lines.
-
Rob Swindell authored
Also when detecting a blocked event_thread, log the event_code that is/was running last.
-
Rob Swindell authored
This removes unnecessary some cruft and complexity, most especially from the event_thread(). Using sbbs_t::fremove() instead of remove(). This probably resolves some Coverity issues where we weren't checking the return value.
-
Rob Swindell authored
ENOENT = "No such file or directory" Passing 'true' for the optional 'log_all_errors' parameter overrides this (logs all errors, including ENOENT).
-
Rob Swindell authored
Add log message when spawning background timed event
-
Rob Swindell authored
Only log messages about QWK mutex files existing when > 60 seconds old
-
Rob Swindell authored
First, fix the logged username bug in the "Lock exists" log message. Next, double check that the trigger file (sem file or REP file) still exists after acquiring the file mutex. Use a temp varible (fname) to make the code easier to read.
-
Rob Swindell authored
Vertrauen's FTP server gets abused by QWKnet logins sometimes and handling the race conditions around QWK packet creation attempts is silly - there's no legit reason why a QWKnet account needs to be logged-in multiple times concurrently to the hub's FTP server, so reject the subsequent logins even when they're on different hosts (as is the case with Vertrauen). As part of this change: - fmutex() now takes an new time_t* argument to (optionally) store the time of the mutex file for helping logging (locked since when?). - time_as_hhmm() created to format a string as either HH:MM or HH:MM[a|p] (depending on system configuration for 12 or 24 hour time formatting). - renamed the old hhmmtostr ()to tm_as_hhmm() (since it takes a struct tm arg) and have it return a non-padded string (useful in more situations without requiring truncation) when the sysop prefers 24-hour time.
-
Rob Swindell authored
-
- Nov 14, 2024
-
-
Rob Swindell authored
Pretty remedial option parsing here, the order is significant
-
Deucе authored
-