From 2de475b2488cd7bd1e23f0c3e7653388d31bd118 Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Debian Linux)" <rob@synchro.net> Date: Mon, 20 Jan 2025 23:16:46 -0800 Subject: [PATCH] Add per-service option: NO_USER_PROT If enabled, this option prevents logins to this service from changing the protocol (aka modem) field for a user logging-in. This is a work around for Deon who has some message areas set to require "PROT NOT IMAP" for access requirements and when his IMAP client connects and logs-in, that changes the protocol field in his user account (to "IMAP") which means that user account cannot see/read those message areas (until the protocol field is changed by another login to another server/service) and thus won't receive echomail notifications for message received for them in those areas. --- src/sbbs3/services.c | 3 ++- src/sbbs3/services.h | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c index a7ba59cbe4..ba58e0921b 100644 --- a/src/sbbs3/services.c +++ b/src/sbbs3/services.c @@ -486,7 +486,8 @@ js_login(JSContext *cx, uintN argc, jsval *arglist) if (client->client != NULL) { SAFECOPY(client->user.ipaddr, client->client->addr); SAFECOPY(client->user.comp, client->client->host); - SAFECOPY(client->user.modem, client->service->protocol); + if (!(client->service->options & SERVICE_OPT_NO_USER_PROT)) + SAFECOPY(client->user.modem, client->service->protocol); } if (inc_logons) { diff --git a/src/sbbs3/services.h b/src/sbbs3/services.h index b077198477..6d1de6faf4 100644 --- a/src/sbbs3/services.h +++ b/src/sbbs3/services.h @@ -52,6 +52,7 @@ static struct init_field services_init_fields[] = { #define SERVICE_OPT_NATIVE (1 << 3) /* non-JavaScript service */ #define SERVICE_OPT_FULL_ACCEPT (1 << 4) /* Accept/close connections when server is full */ #define SERVICE_OPT_TLS (1 << 5) /* Use TLS */ +#define SERVICE_OPT_NO_USER_PROT (1 << 6) /* Don't change the user's protcool field */ /* services_startup_t.options bits that require re-init/recycle when changed */ #define SERVICE_INIT_OPTS (0) @@ -59,18 +60,19 @@ static struct init_field services_init_fields[] = { #if defined(STARTUP_INI_BITDESC_TABLES) || defined(SERVICES_INI_BITDESC_TABLE) static ini_bitdesc_t service_options[] = { - { BBS_OPT_NO_HOST_LOOKUP, "NO_HOST_LOOKUP" }, - { BBS_OPT_GET_IDENT, "GET_IDENT" }, + { BBS_OPT_NO_HOST_LOOKUP, "NO_HOST_LOOKUP" }, + { BBS_OPT_GET_IDENT, "GET_IDENT" }, { BBS_OPT_NO_RECYCLE, "NO_RECYCLE" }, - { BBS_OPT_MUTE, "MUTE" }, - { SERVICE_OPT_UDP, "UDP" }, + { BBS_OPT_MUTE, "MUTE" }, + { SERVICE_OPT_UDP, "UDP" }, { SERVICE_OPT_STATIC, "STATIC" }, - { SERVICE_OPT_STATIC_LOOP, "LOOP" }, + { SERVICE_OPT_STATIC_LOOP, "LOOP" }, { SERVICE_OPT_NATIVE, "NATIVE" }, - { SERVICE_OPT_FULL_ACCEPT, "FULL_ACCEPT" }, - { SERVICE_OPT_TLS, "TLS" }, + { SERVICE_OPT_FULL_ACCEPT, "FULL_ACCEPT" }, + { SERVICE_OPT_TLS, "TLS" }, + { SERVICE_OPT_NO_USER_PROT, "NO_USER_PROT" }, /* terminator */ - { 0, NULL } + { 0, NULL } }; #endif -- GitLab