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

Add configurable SFTP session inactivity timer (default: 5 minutes)

Allow SFTP support to be enabled/configured in SCFG->Servers and
SBBSCTRL->Terminal->Configure.

SFTP session inactivity applies to 'H' exempt users too (intentionally).
parent d16e0c84
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -447,6 +447,7 @@ bool sbbs_t::answer()
snprintf(str, sizeof(str), "(%04u) %-25s %s Logon"
,useron.number, useron.alias, client.protocol);
logline("++", str);
max_socket_inactivity = startup->max_sftp_inactivity;
}
else {
lprintf(LOG_NOTICE, "%04d Trying to create new user over sftp, disconnecting.", client_socket);
......@@ -778,6 +779,7 @@ bool sbbs_t::answer()
if(useron.pass[0])
loginSuccess(startup->login_attempt_list, &client_addr);
max_socket_inactivity = startup->max_session_inactivity;
if(!term_output_disabled)
max_socket_inactivity = startup->max_session_inactivity;
return(true);
}
......@@ -63,6 +63,7 @@ void __fastcall TTelnetCfgDlg::FormShow(TObject *Sender)
SshInterfaceEdit->Text=AnsiString(str);
}
SshConnTimeoutEdit->Text = duration_to_str(MainForm->bbs_startup.ssh_connect_timeout, str, sizeof str);
SFTPMaxInactivityEdit->Text = duration_to_str(MainForm->bbs_startup.max_sftp_inactivity, str, sizeof str);
TelnetPortEdit->Text=AnsiString((int)MainForm->bbs_startup.telnet_port);
RLoginPortEdit->Text=AnsiString((int)MainForm->bbs_startup.rlogin_port);
......@@ -89,6 +90,8 @@ void __fastcall TTelnetCfgDlg::FormShow(TObject *Sender)
=MainForm->bbs_startup.options&BBS_OPT_ALLOW_RLOGIN;
SshEnabledCheckBox->Checked
=MainForm->bbs_startup.options&BBS_OPT_ALLOW_SSH;
SFTPEnabledCheckBox->Checked
=MainForm->bbs_startup.options&BBS_OPT_ALLOW_SFTP;
QWKEventsCheckBox->Checked
=!(MainForm->bbs_startup.options&BBS_OPT_NO_QWK_EVENTS);
......@@ -114,6 +117,7 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
iniFreeStringList(MainForm->bbs_startup.ssh_interfaces);
MainForm->bbs_startup.ssh_interfaces = strListSplitCopy(NULL, SshInterfaceEdit->Text.c_str(), ",");
MainForm->bbs_startup.ssh_connect_timeout = parse_duration(SshConnTimeoutEdit->Text.c_str());
MainForm->bbs_startup.max_sftp_inactivity = parse_duration(SFTPMaxInactivityEdit->Text.c_str());
MainForm->bbs_startup.telnet_port=TelnetPortEdit->Text.ToIntDef(23);
MainForm->bbs_startup.rlogin_port=RLoginPortEdit->Text.ToIntDef(513);
......@@ -168,6 +172,11 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
else
MainForm->bbs_startup.options&=~BBS_OPT_ALLOW_SSH;
if(SFTPEnabledCheckBox->Checked==true)
MainForm->bbs_startup.options|=BBS_OPT_ALLOW_SFTP;
else
MainForm->bbs_startup.options&=~BBS_OPT_ALLOW_SFTP;
MainForm->EventsLogFile = EventsLogFileCheckBox->Checked;
MainForm->SaveIniSettings(Sender);
}
......
......@@ -3,8 +3,8 @@ object TelnetCfgDlg: TTelnetCfgDlg
Top = 475
BorderStyle = bsDialog
Caption = 'Terminal Server Configuration'
ClientHeight = 234
ClientWidth = 286
ClientHeight = 270
ClientWidth = 330
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
......@@ -15,46 +15,46 @@ object TelnetCfgDlg: TTelnetCfgDlg
Position = poScreenCenter
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
TextHeight = 15
object PageControl: TPageControl
Left = 3
Top = 3
Width = 278
Height = 186
ActivePage = GeneralTabSheet
TabIndex = 0
Width = 321
Height = 215
ActivePage = SshTabSheet
TabIndex = 3
TabOrder = 0
object GeneralTabSheet: TTabSheet
Caption = 'General'
object FirstNodeLabel: TLabel
Left = 7
Top = 10
Width = 78
Height = 20
Left = 8
Top = 12
Width = 90
Height = 23
AutoSize = False
Caption = 'First Node'
end
object LastNodeLabel: TLabel
Left = 7
Top = 36
Width = 74
Height = 20
Left = 8
Top = 42
Width = 85
Height = 23
AutoSize = False
Caption = 'Last Node'
end
object MaxConConLabel: TLabel
Left = 7
Top = 62
Width = 74
Height = 20
Left = 8
Top = 72
Width = 85
Height = 23
AutoSize = False
Caption = 'Max Con-Conn'
end
object AutoStartCheckBox: TCheckBox
Left = 148
Top = 10
Width = 117
Height = 19
Left = 171
Top = 12
Width = 135
Height = 21
Hint = 'Automatically start Terminal server'
Caption = 'Auto Startup'
ParentShowHint = False
......@@ -62,20 +62,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 4
end
object FirstNodeEdit: TEdit
Left = 85
Top = 10
Width = 39
Height = 21
Left = 98
Top = 12
Width = 45
Height = 23
Hint = 'First node number available for Terminal logins'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object XtrnMinCheckBox: TCheckBox
Left = 148
Top = 36
Width = 117
Height = 20
Left = 171
Top = 42
Width = 135
Height = 23
Hint = 'External programs run in a minimized window'
Caption = 'Minimize Externals'
ParentShowHint = False
......@@ -83,20 +83,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 5
end
object LastNodeEdit: TEdit
Left = 85
Top = 36
Width = 39
Height = 21
Left = 98
Top = 42
Width = 45
Height = 23
Hint = 'Last node number available for Terminal logins'
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object HostnameCheckBox: TCheckBox
Left = 7
Top = 114
Width = 117
Height = 23
Left = 8
Top = 132
Width = 135
Height = 26
Hint = 'Automatically lookup client'#39's hostname via DNS'
Caption = 'Hostname Lookup'
ParentShowHint = False
......@@ -104,10 +104,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 3
end
object QWKEventsCheckBox: TCheckBox
Left = 148
Top = 114
Width = 117
Height = 20
Left = 171
Top = 132
Width = 135
Height = 23
Hint = 'Handle QWK Message Packet Events in This Instance'
Caption = 'QWK Msg Events'
ParentShowHint = False
......@@ -115,10 +115,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 7
end
object EventsCheckBox: TCheckBox
Left = 148
Top = 62
Width = 117
Height = 20
Left = 171
Top = 72
Width = 135
Height = 23
Hint = 'Enable the events thread'
Caption = 'Events Enabled'
ParentShowHint = False
......@@ -126,10 +126,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 6
end
object DosSupportCheckBox: TCheckBox
Left = 7
Top = 88
Width = 130
Height = 20
Left = 8
Top = 102
Width = 150
Height = 23
Hint = 'Attempt to execute 16-bit DOS progarms (requires NTVDM)'
Caption = 'DOS Program Support'
ParentShowHint = False
......@@ -137,10 +137,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 8
end
object MaxConConEdit: TEdit
Left = 85
Top = 62
Width = 39
Height = 21
Left = 98
Top = 72
Width = 45
Height = 23
Hint =
'Maximum unauthenticated Concurrent Connections from same IP (0=u' +
'nlimited)'
......@@ -149,10 +149,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object EventsLogFileCheckBox: TCheckBox
Left = 148
Top = 88
Width = 117
Height = 20
Left = 171
Top = 102
Width = 135
Height = 23
Hint = 'Save event log messages to disk file in your DATA directory'
Caption = 'Log Events to Disk'
ParentShowHint = False
......@@ -164,26 +164,26 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'Telnet'
ImageIndex = 1
object InterfaceLabel: TLabel
Left = 7
Top = 36
Width = 78
Height = 21
Left = 8
Top = 42
Width = 90
Height = 24
AutoSize = False
Caption = 'Interfaces (IPs)'
end
object TelnetPortLabel: TLabel
Left = 7
Top = 10
Width = 78
Height = 21
Left = 8
Top = 12
Width = 90
Height = 24
AutoSize = False
Caption = 'Listening Port'
end
object CmdLogCheckBox: TCheckBox
Left = 7
Top = 88
Width = 169
Height = 21
Left = 8
Top = 102
Width = 195
Height = 24
Hint = 'Log (debug) all transmitted and received Telnet commands'
Caption = 'Log Telnet Commands'
ParentShowHint = False
......@@ -191,10 +191,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 3
end
object TelnetInterfaceEdit: TEdit
Left = 85
Top = 36
Width = 156
Height = 21
Left = 98
Top = 42
Width = 180
Height = 23
Hint =
'Comma-separated list of IP addresses to accept incoming connecti' +
'ons'
......@@ -203,20 +203,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 1
end
object TelnetPortEdit: TEdit
Left = 85
Top = 10
Width = 39
Height = 21
Left = 98
Top = 12
Width = 45
Height = 23
Hint = 'TCP port for incoming connections (default=23)'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object TelnetGaCheckBox: TCheckBox
Left = 7
Top = 62
Width = 169
Height = 21
Left = 8
Top = 72
Width = 195
Height = 24
Hint =
'Send periodic Telnet GA commands to help detect dropped connecti' +
'ons'
......@@ -226,10 +226,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object AutoLogonCheckBox: TCheckBox
Left = 7
Top = 114
Width = 117
Height = 19
Left = 8
Top = 132
Width = 135
Height = 21
Hint = 'Allow V-exempt users to auto-logon based on their IP address'
Caption = 'AutoLogon via IP'
ParentShowHint = False
......@@ -241,36 +241,36 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'RLogin'
ImageIndex = 3
object RLoginPortLabel: TLabel
Left = 7
Top = 10
Width = 78
Height = 21
Left = 8
Top = 12
Width = 90
Height = 24
AutoSize = False
Caption = 'Listening Port'
end
object RLoginInterfaceLabel: TLabel
Left = 7
Top = 36
Width = 78
Height = 21
Left = 8
Top = 42
Width = 90
Height = 24
AutoSize = False
Caption = 'Interfaces (IPs)'
end
object RLoginPortEdit: TEdit
Left = 85
Top = 10
Width = 39
Height = 21
Left = 98
Top = 12
Width = 45
Height = 23
Hint = 'TCP port for incoming connections (default=513)'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object RLoginInterfaceEdit: TEdit
Left = 85
Top = 36
Width = 156
Height = 21
Left = 98
Top = 42
Width = 180
Height = 23
Hint =
'Comma-separated list of IP addresses to accept incoming connecti' +
'ons'
......@@ -279,10 +279,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object RLoginEnabledCheckBox: TCheckBox
Left = 184
Top = 10
Width = 73
Height = 17
Left = 212
Top = 12
Width = 85
Height = 19
Hint = 'Enable the RLogin port'
Caption = 'Enabled'
ParentShowHint = False
......@@ -291,10 +291,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = RLoginEnabledCheckBoxClick
end
object RLoginIPallowButton: TButton
Left = 8
Top = 62
Width = 233
Height = 21
Left = 9
Top = 72
Width = 269
Height = 24
Hint =
'IP addresses of trusted hosts to allow unauthenticed RLogins fro' +
'm'
......@@ -309,44 +309,52 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'SSH'
ImageIndex = 4
object SshPortLabel: TLabel
Left = 7
Top = 10
Width = 78
Height = 21
Left = 8
Top = 12
Width = 90
Height = 24
AutoSize = False
Caption = 'Listening Port'
end
object SshInterfaceLabel: TLabel
Left = 7
Top = 36
Width = 78
Height = 21
Left = 8
Top = 42
Width = 90
Height = 24
AutoSize = False
Caption = 'Interfaces (IPs)'
end
object SshConnectTimeoutLabel: TLabel
Left = 7
Top = 62
Width = 78
Height = 21
Left = 8
Top = 72
Width = 90
Height = 24
AutoSize = False
Caption = 'Conn Timeout'
end
object SFTPMaxInactivityLabel: TLabel
Left = 8
Top = 136
Width = 90
Height = 24
AutoSize = False
Caption = 'Max Inactivity'
end
object SshPortEdit: TEdit
Left = 85
Top = 10
Width = 39
Height = 21
Left = 98
Top = 12
Width = 45
Height = 23
Hint = 'TCP port for incoming connections (default=22)'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object SshEnabledCheckBox: TCheckBox
Left = 184
Top = 10
Width = 73
Height = 17
Left = 212
Top = 12
Width = 85
Height = 19
Hint = 'Enable the Secure Shell (SSH) port'
Caption = 'Enabled'
ParentShowHint = False
......@@ -355,10 +363,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = SshEnabledCheckBoxClick
end
object SshInterfaceEdit: TEdit
Left = 85
Top = 36
Width = 156
Height = 21
Left = 98
Top = 42
Width = 180
Height = 23
Hint =
'Comma-separated list of IP addresses to accept incoming connecti' +
'ons'
......@@ -367,24 +375,45 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object SshConnTimeoutEdit: TEdit
Left = 85
Top = 62
Width = 39
Height = 21
Hint = 'SSH Connection Timeout (in seconds)'
Left = 98
Top = 72
Width = 45
Height = 23
Hint = 'SSH Connection Timeout'
ParentShowHint = False
ShowHint = True
TabOrder = 3
end
object SFTPEnabledCheckBox: TCheckBox
Left = 8
Top = 102
Width = 195
Height = 24
Hint = 'Enable SSH File Transfer (SFTP) support'
Caption = 'File Transfer (SFTP) Support'
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
object SFTPMaxInactivityEdit: TEdit
Left = 98
Top = 136
Width = 45
Height = 23
Hint = 'Maximum SFTP Session Inactivity'
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
end
object SoundTabSheet: TTabSheet
Caption = 'Sound'
ImageIndex = 2
object ConfigureSoundButton: TButton
Left = 8
Top = 8
Width = 257
Height = 25
Left = 9
Top = 9
Width = 297
Height = 29
Caption = 'Configure Common Server Event Sounds'
TabOrder = 0
OnClick = ConfigureSoundButtonClick
......@@ -392,10 +421,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
end
end
object OKBtn: TButton
Left = 20
Top = 201
Width = 76
Height = 25
Left = 23
Top = 232
Width = 88
Height = 29
Caption = 'OK'
Default = True
ModalResult = 1
......@@ -403,20 +432,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = OKBtnClick
end
object CancelBtn: TButton
Left = 104
Top = 201
Width = 75
Height = 25
Left = 120
Top = 232
Width = 87
Height = 29
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 2
end
object ApplyBtn: TButton
Left = 189
Top = 201
Width = 76
Height = 25
Left = 218
Top = 232
Width = 88
Height = 29
Cancel = True
Caption = 'Apply'
TabOrder = 3
......
......@@ -97,6 +97,9 @@ __published:
TEdit *SshConnTimeoutEdit;
TButton *ConfigureSoundButton;
TCheckBox *EventsLogFileCheckBox;
TCheckBox *SFTPEnabledCheckBox;
TLabel *SFTPMaxInactivityLabel;
TEdit *SFTPMaxInactivityEdit;
void __fastcall FormShow(TObject *Sender);
void __fastcall OKBtnClick(TObject *Sender);
void __fastcall RLoginEnabledCheckBoxClick(TObject *Sender);
......
......@@ -43,6 +43,7 @@ static const char* strMaxInactivity="MaxInactivity";
static const char* strMaxLoginInactivity="MaxLoginInactivity";
static const char* strMaxNewUserInactivity="MaxNewUserInactivity";
static const char* strMaxSessionInactivity="MaxSessionInactivity";
static const char* strMaxSFTPInactivity="MaxSFTPInactivity";
static const char* strMaxConConn="MaxConcurrentConnections";
static const char* strHostName="HostName";
static const char* strLogLevel="LogLevel";
......@@ -516,6 +517,7 @@ void sbbs_read_ini(
bbs->max_login_inactivity = (uint16_t)iniGetDuration(list, section, strMaxLoginInactivity, 10 * 60);
bbs->max_newuser_inactivity = (uint16_t)iniGetDuration(list, section, strMaxNewUserInactivity, 60 * 60);
bbs->max_session_inactivity = (uint16_t)iniGetDuration(list, section, strMaxSessionInactivity, 0);
bbs->max_sftp_inactivity = (uint16_t)iniGetDuration(list, section, strMaxSFTPInactivity, FTP_DEFAULT_MAX_INACTIVITY);
SAFECOPY(bbs->web_file_vpath_prefix, iniGetString(list, "web", strFileVPathPrefix, nulstr, value));
}
......@@ -943,6 +945,8 @@ bool sbbs_write_ini(
break;
if(!iniSetDuration(lp, section, strMaxSessionInactivity, bbs->max_session_inactivity, &style))
break;
if(!iniSetDuration(lp, section, strMaxSFTPInactivity, bbs->max_sftp_inactivity, &style))
break;
if(bbs->sem_chk_freq==global->sem_chk_freq)
iniRemoveValue(lp,section,strSemFileCheckFrequency);
......
......@@ -352,6 +352,8 @@ static void telnet_srvr_cfg(bbs_startup_t* startup)
startup->options ^= BBS_OPT_NO_TELNET;
break;
case 1:
if(startup->options & BBS_OPT_NO_TELNET)
break;
strListCombine(startup->telnet_interfaces, str, sizeof(str), ", ");
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "Telnet Network Interfaces (IPv4/6)", str, sizeof(str)-1, K_EDIT) >= 0) {
strListFree(&startup->telnet_interfaces);
......@@ -360,14 +362,20 @@ static void telnet_srvr_cfg(bbs_startup_t* startup)
}
break;
case 2:
if(startup->options & BBS_OPT_NO_TELNET)
break;
SAFEPRINTF(str, "%u", startup->telnet_port);
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "Telnet TCP Port", str, 5, K_NUMBER|K_EDIT) > 0)
startup->telnet_port = atoi(str);
break;
case 3:
if(startup->options & BBS_OPT_NO_TELNET)
break;
startup->options ^= BBS_OPT_DEBUG_TELNET;
break;
case 4:
if(startup->options & BBS_OPT_NO_TELNET)
break;
startup->options ^= BBS_OPT_NO_TELNET_GA;
break;
default:
......@@ -391,7 +399,13 @@ static void ssh_srvr_cfg(bbs_startup_t* startup)
snprintf(opt[i++], MAX_OPLN, "%-30s%u", "Port", startup->ssh_port);
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Connect Timeout"
,startup->options & BBS_OPT_ALLOW_SSH ? vduration(startup->ssh_connect_timeout) : "N/A");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Error Level", iniLogLevelStringList()[startup->ssh_error_level]);
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Error Level"
,startup->options & BBS_OPT_ALLOW_SSH ? iniLogLevelStringList()[startup->ssh_error_level] : "N/A");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "File Transfer (SFTP) Support"
,startup->options & BBS_OPT_ALLOW_SSH ? (startup->options & BBS_OPT_ALLOW_SFTP ? "Yes" : "No") : "N/A");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Max SFTP Inactivity"
,(startup->options & BBS_OPT_ALLOW_SSH) && (startup->options & BBS_OPT_ALLOW_SFTP) ? vduration(startup->max_sftp_inactivity) : "N/A");
opt[i][0] = '\0';
switch(uifc.list(WIN_ACT|WIN_ESC|WIN_RHT|WIN_SAV, 0, 0, 0, &cur, &bar
......@@ -400,6 +414,8 @@ static void ssh_srvr_cfg(bbs_startup_t* startup)
startup->options ^= BBS_OPT_ALLOW_SSH;
break;
case 1:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
strListCombine(startup->ssh_interfaces, str, sizeof(str), ", ");
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "SSH Network Interfaces (IPv4/6)", str, sizeof(str)-1, K_EDIT) >= 0) {
strListFree(&startup->ssh_interfaces);
......@@ -408,18 +424,38 @@ static void ssh_srvr_cfg(bbs_startup_t* startup)
}
break;
case 2:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
SAFEPRINTF(str, "%u", startup->ssh_port);
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "SSH TCP Port", str, 5, K_NUMBER|K_EDIT) > 0)
startup->ssh_port = atoi(str);
break;
case 3:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
SAFECOPY(str, duration(startup->ssh_connect_timeout, false));
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "SSH Connect Timeout", str, 6, K_EDIT) > 0)
startup->ssh_connect_timeout = (uint16_t)parse_duration(str);
break;
case 4:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
uifc.list(WIN_MID|WIN_SAV, 0, 0, 0, &startup->ssh_error_level, 0, "SSH Error Log Level", iniLogLevelStringList());
break;
case 5:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
startup->options ^= BBS_OPT_ALLOW_SFTP;
break;
case 6:
if(!(startup->options & BBS_OPT_ALLOW_SSH))
break;
if(!(startup->options & BBS_OPT_ALLOW_SFTP))
break;
SAFECOPY(str, duration(startup->max_sftp_inactivity, false));
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "Maximum Socket Inactivity during SFTP Session", str, 10, K_EDIT) > 0)
startup->max_sftp_inactivity = (uint16_t)parse_duration(str);
break;
default:
return;
}
......@@ -447,6 +483,8 @@ static void rlogin_srvr_cfg(bbs_startup_t* startup)
startup->options ^= BBS_OPT_ALLOW_RLOGIN;
break;
case 1:
if(!(startup->options & BBS_OPT_ALLOW_RLOGIN))
break;
strListCombine(startup->rlogin_interfaces, str, sizeof(str), ", ");
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "RLogin Network Interfaces (IPv4/6)", str, sizeof(str)-1, K_EDIT) >= 0) {
strListFree(&startup->rlogin_interfaces);
......@@ -455,6 +493,8 @@ static void rlogin_srvr_cfg(bbs_startup_t* startup)
}
break;
case 2:
if(!(startup->options & BBS_OPT_ALLOW_RLOGIN))
break;
SAFEPRINTF(str, "%u", startup->rlogin_port);
if(uifc.input(WIN_MID|WIN_SAV, 0, 0, "RLogin TCP Port", str, 5, K_NUMBER|K_EDIT) > 0)
startup->rlogin_port = atoi(str);
......@@ -469,7 +509,6 @@ static void termsrvr_cfg(void)
{
static int cur, bar;
char str[256];
char tmp[256];
bool enabled = false;
bbs_startup_t startup = {0};
......
......@@ -160,6 +160,7 @@ typedef struct {
uint16_t max_login_inactivity; // seconds
uint16_t max_newuser_inactivity; // seconds
uint16_t max_session_inactivity; // seconds
uint16_t max_sftp_inactivity; // seconds
/* JavaScript operating parameters */
js_startup_t js;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment