diff --git a/src/syncterm/Manual.txt b/src/syncterm/Manual.txt index 99d31273a086139e8d82554219d751e31bd1b05b..364d38b7cbe2991df767f7ba9d04efee9560e084 100644 --- a/src/syncterm/Manual.txt +++ b/src/syncterm/Manual.txt @@ -544,6 +544,11 @@ System Password:: An additional password that can be sent after the first kbd:[Alt+L] using successive kbd:[Alt+L]s. +Binmode Broken:: +Telnet binary mode is broken on the remote system, do not enable it when +connecting. This option is to work around a bug in CTRL-C checking in +older Synchronet versions. + Screen Mode:: Selects the format of the window when connected. A mode specifies the number of columns, the number of rows, diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c index 722e4139d4bf922ced240f88a8bb535eecafd579..22927580bbfbb20386e6521021aaf04237dec4b1 100644 --- a/src/syncterm/bbslist.c +++ b/src/syncterm/bbslist.c @@ -820,6 +820,7 @@ read_item(str_list_t listfile, struct bbslist *entry, char *bbsname, int id, int if (entry->stop_bits < 1 || entry->stop_bits > 2) entry->stop_bits = 1; entry->parity = iniGetEnum(section, NULL, "Parity", parity_enum, SYNCTERM_PARITY_NONE); + entry->telnet_no_binary = iniGetBool(section, NULL, "TelnetBrokenTextmode", false); /* Log Stuff */ iniGetSString(section, NULL, "LogFile", "", entry->logfile, sizeof(entry->logfile)); @@ -1160,6 +1161,7 @@ enum { BBSLIST_FIELD_STOP_BITS, BBSLIST_FIELD_DATA_BITS, BBSLIST_FIELD_PARITY, + BBSLIST_FIELD_TELNET_NO_BINARY, }; void @@ -1248,6 +1250,10 @@ build_edit_list(struct bbslist *item, char opt[][69], int *optmap, char **opts, optmap[i] = BBSLIST_FIELD_SFTP_PUBLIC_KEY; sprintf(opt[i++], "SFTP Public Key %s", item->sftp_public_key ? "Yes" : "No"); } + if (item->conn_type == CONN_TYPE_TELNET || item->conn_type == CONN_TYPE_TELNETS) { + optmap[i] = BBSLIST_FIELD_TELNET_NO_BINARY; + sprintf(opt[i++], "Binmode Broken %s", item->telnet_no_binary ? "Yes" : "No"); + } optmap[i] = BBSLIST_FIELD_SCREEN_MODE; sprintf(opt[i++], "Screen Mode %s", screen_modes[item->screen_mode]); optmap[i] = BBSLIST_FIELD_FONT; @@ -1383,6 +1389,11 @@ build_edit_help(struct bbslist *item, int isdefault, char *helpbuf, size_t hbsz) " Open an SFTP channel and transfer the public key to\n" " .ssh/authorized_keys\n\n", hbsz - hblen); } + if (item->conn_type == CONN_TYPE_TELNET || item->conn_type == CONN_TYPE_TELNETS) { + hblen += strlcat(helpbuf + hblen, "~ Binmode Broken ~\n" + " Telnet binary mode is broken on the remote system, do not\n" + " enable it when connecting\n\n", hbsz - hblen); + } hblen += strlcat(helpbuf + hblen, "~ Screen Mode ~\n" " Display mode to use\n\n", hbsz - hblen); hblen += strlcat(helpbuf + hblen, "~ Font ~\n" @@ -1945,6 +1956,12 @@ edit_list(struct bbslist **list, struct bbslist *item, char *listpath, int isdef changed = 1; iniSetBool(&inifile, itemname, "SFTPPublicKey", item->sftp_public_key, &ini_style); break; + case BBSLIST_FIELD_TELNET_NO_BINARY: + item->telnet_no_binary = !item->telnet_no_binary; + changed = 1; + iniSetBool(&inifile, itemname, "TelnetBrokenTextmode", item->telnet_no_binary, &ini_style); + break; + } if (uifc.changes) changed = 1; @@ -2003,6 +2020,7 @@ add_bbs(char *listpath, struct bbslist *bbs, bool new_entry) iniSetString(&inifile, bbs->name, "Comment", bbs->comment, &ini_style); iniSetBool(&inifile, bbs->name, "ForceLCF", bbs->force_lcf, &ini_style); iniSetBool(&inifile, bbs->name, "YellowIsYellow", bbs->yellow_is_yellow, &ini_style); + iniSetBool(&inifile, bbs->name, "TelnetBrokenTextmode", bbs->telnet_no_binary, &ini_style); if (bbs->has_fingerprint) { char fp[41]; fp[0] = 0; diff --git a/src/syncterm/bbslist.h b/src/syncterm/bbslist.h index 4ddb61de1276be183daa3c4261c7137f3e633b7f..252ffdeae0867fa354edda404121e3526b007d76 100644 --- a/src/syncterm/bbslist.h +++ b/src/syncterm/bbslist.h @@ -152,6 +152,7 @@ struct bbslist { bool has_fingerprint; uint8_t ssh_fingerprint[20]; bool sftp_public_key; + bool telnet_no_binary; // No way to get a uint8_t from an ini file. short unsigned int stop_bits; short unsigned int data_bits; diff --git a/src/syncterm/conn_telnet.c b/src/syncterm/conn_telnet.c index 680146ca949e5e08d476fa28f4e14f15b6f57a37..ba6e7e102f47fd840c3c391ac268519e845f70e7 100644 --- a/src/syncterm/conn_telnet.c +++ b/src/syncterm/conn_telnet.c @@ -154,9 +154,11 @@ telnet_connect(struct bbslist *bbs) // Suppress Go Aheads (both directions) request_telnet_opt(TELNET_WILL, TELNET_SUP_GA); request_telnet_opt(TELNET_DO, TELNET_SUP_GA); - // Enable binary mode (both directions) - request_telnet_opt(TELNET_WILL, TELNET_BINARY_TX); - request_telnet_opt(TELNET_DO, TELNET_BINARY_TX); + if (!bbs->telnet_no_binary) { + // Enable binary mode (both directions) + request_telnet_opt(TELNET_WILL, TELNET_BINARY_TX); + request_telnet_opt(TELNET_DO, TELNET_BINARY_TX); + } // Request that the server echos request_telnet_opt(TELNET_DO, TELNET_ECHO);