1
0
mirror of https://github.com/simh/simh.git synced 2026-02-14 11:55:51 +00:00

TMXR: Add Access Control List (ACL) support for incoming network connections

This commit is contained in:
Mark Pizzolato
2022-02-04 07:59:08 -08:00
parent 10e561767f
commit 35503f4765
4 changed files with 226 additions and 81 deletions

View File

@@ -1898,8 +1898,16 @@ static t_stat sim_set_rem_telnet (int32 flag, CONST char *cptr)
t_stat r;
if (flag) {
r = sim_parse_addr (cptr, NULL, 0, NULL, NULL, 0, NULL, NULL);
char gbuf[CBUFSIZE];
char *cp;
strlcpy (gbuf, cptr, sizeof (gbuf));
if ((cp = strchr (gbuf, ';')))
*cp = '\0';
r = sim_parse_addr (gbuf, NULL, 0, NULL, NULL, 0, NULL, NULL);
if (r == SCPE_OK) {
if (cp != NULL)
*cp = ';';
if (sim_rem_con_tmxr.master) /* already open? */
sim_set_rem_telnet (0, NULL); /* close first */
if (sim_rem_con_tmxr.lines == 0) /* if no connection limit set */
@@ -2473,6 +2481,8 @@ while (*cptr != 0) { /* do all mods */
return r;
}
else {
if (cvptr) /* if we removed a = sign */
*(--cvptr) = '='; /* restore it */
if (sim_con_tmxr.master) /* already open? */
sim_set_notelnet (0, NULL); /* close first */
r = tmxr_attach (&sim_con_tmxr, &sim_con_unit, gbuf);/* open master socket */