Skip to content
Snippets Groups Projects
Commit 2de475b2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

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.
parent 37fa3cc9
Branches
Tags
No related merge requests found
Pipeline #7936 passed
......@@ -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) {
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment