Commit 7735f0b5 authored by rswindell's avatar rswindell
Browse files

Added support for [BBS] "NO_DOS" Option flag to disable DOS program support

for that instance of SBBS (e.g. when running SBBS-Win32 on Windows-x64).
parent 848cd8de
......@@ -108,6 +108,8 @@ void __fastcall TTelnetCfgDlg::FormShow(TObject *Sender)
=!(MainForm->bbs_startup.options&BBS_OPT_NO_HOST_LOOKUP);
IdentityCheckBox->Checked
=MainForm->bbs_startup.options&BBS_OPT_GET_IDENT;
DosSupportCheckBox->Checked
=!(MainForm->bbs_startup.options&BBS_OPT_NO_DOS);
RLoginEnabledCheckBox->Checked
=MainForm->bbs_startup.options&BBS_OPT_ALLOW_RLOGIN;
......@@ -218,6 +220,10 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender)
MainForm->bbs_startup.options&=~BBS_OPT_NO_JAVASCRIPT;
else
MainForm->bbs_startup.options|=BBS_OPT_NO_JAVASCRIPT;
if(DosSupportCheckBox->Checked==true)
MainForm->bbs_startup.options&=~BBS_OPT_NO_DOS;
else
MainForm->bbs_startup.options|=BBS_OPT_NO_DOS;
if(AutoLogonCheckBox->Checked==true)
MainForm->bbs_startup.options|=BBS_OPT_AUTO_LOGON;
......
......@@ -3,46 +3,46 @@ object TelnetCfgDlg: TTelnetCfgDlg
Top = 354
BorderStyle = bsDialog
Caption = 'Terminal Server Configuration'
ClientHeight = 288
ClientWidth = 352
ClientHeight = 234
ClientWidth = 286
Color = clBtnFace
ParentFont = True
OldCreateOrder = True
Position = poScreenCenter
OnShow = FormShow
PixelsPerInch = 120
TextHeight = 16
PixelsPerInch = 96
TextHeight = 13
object PageControl: TPageControl
Left = 4
Top = 4
Width = 342
Height = 229
ActivePage = SoundTabSheet
TabIndex = 4
Left = 3
Top = 3
Width = 278
Height = 186
ActivePage = GeneralTabSheet
TabIndex = 0
TabOrder = 0
object GeneralTabSheet: TTabSheet
Caption = 'General'
object FirstNodeLabel: TLabel
Left = 9
Top = 12
Width = 96
Height = 25
Left = 7
Top = 10
Width = 78
Height = 20
AutoSize = False
Caption = 'First Node'
end
object LastNodeLabel: TLabel
Left = 9
Top = 44
Width = 91
Height = 25
Left = 7
Top = 36
Width = 74
Height = 20
AutoSize = False
Caption = 'Last Node'
end
object AutoStartCheckBox: TCheckBox
Left = 182
Top = 12
Width = 144
Height = 24
Left = 148
Top = 10
Width = 117
Height = 19
Hint = 'Automatically start Terminal server'
Caption = 'Auto Startup'
ParentShowHint = False
......@@ -50,20 +50,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 4
end
object FirstNodeEdit: TEdit
Left = 105
Top = 12
Width = 48
Height = 24
Left = 85
Top = 10
Width = 39
Height = 21
Hint = 'First node number available for Terminal logins'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object XtrnMinCheckBox: TCheckBox
Left = 182
Top = 44
Width = 144
Height = 25
Left = 148
Top = 36
Width = 117
Height = 20
Hint = 'External programs run in a minimized window'
Caption = 'Minimize Externals'
ParentShowHint = False
......@@ -71,20 +71,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 5
end
object LastNodeEdit: TEdit
Left = 105
Top = 44
Width = 48
Height = 24
Left = 85
Top = 36
Width = 39
Height = 21
Hint = 'Last node number available for Terminal logins'
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object HostnameCheckBox: TCheckBox
Left = 9
Top = 108
Width = 144
Height = 24
Left = 7
Top = 88
Width = 117
Height = 19
Hint = 'Automatically lookup client'#39's hostname via DNS'
Caption = 'Hostname Lookup'
ParentShowHint = False
......@@ -92,10 +92,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object QWKEventsCheckBox: TCheckBox
Left = 182
Top = 108
Width = 144
Height = 25
Left = 148
Top = 88
Width = 117
Height = 20
Hint = 'Handle QWK Message Packet Events in This Instance'
Caption = 'QWK Msg Events'
ParentShowHint = False
......@@ -103,10 +103,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 7
end
object JavaScriptCheckBox: TCheckBox
Left = 182
Top = 140
Width = 144
Height = 25
Left = 148
Top = 114
Width = 117
Height = 20
Hint = 'Enable JavaScript Support'
Caption = 'JavaScript Support'
ParentShowHint = False
......@@ -114,10 +114,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 8
end
object IdentityCheckBox: TCheckBox
Left = 9
Top = 140
Width = 144
Height = 24
Left = 7
Top = 114
Width = 117
Height = 19
Hint = 'Automatically lookup client'#39's identity via IDENT protocol'
Caption = 'Identity Lookup'
ParentShowHint = False
......@@ -125,41 +125,52 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 3
end
object EventsCheckBox: TCheckBox
Left = 182
Top = 76
Width = 144
Height = 25
Left = 148
Top = 62
Width = 117
Height = 20
Hint = 'Enable the events thread'
Caption = 'Events Enabled'
ParentShowHint = False
ShowHint = True
TabOrder = 6
end
object DosSupportCheckBox: TCheckBox
Left = 7
Top = 62
Width = 130
Height = 19
Hint = 'Attempt to execute DOS progarms (requires 32-bit OS)'
Caption = 'DOS Program Support'
ParentShowHint = False
ShowHint = True
TabOrder = 9
end
end
object TelnetTabSheet: TTabSheet
Caption = 'Telnet'
ImageIndex = 1
object InterfaceLabel: TLabel
Left = 9
Top = 44
Width = 96
Height = 26
Left = 7
Top = 36
Width = 78
Height = 21
AutoSize = False
Caption = 'Interface (IP)'
end
object TelnetPortLabel: TLabel
Left = 9
Top = 12
Width = 96
Height = 26
Left = 7
Top = 10
Width = 78
Height = 21
AutoSize = False
Caption = 'Listening Port'
end
object CmdLogCheckBox: TCheckBox
Left = 9
Top = 108
Width = 208
Height = 26
Left = 7
Top = 88
Width = 169
Height = 21
Hint = 'Log (debug) all transmitted and received Telnet commands'
Caption = 'Log Telnet Commands'
ParentShowHint = False
......@@ -167,9 +178,9 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 3
end
object TelnetInterfaceEdit: TEdit
Left = 105
Top = 44
Width = 192
Left = 85
Top = 36
Width = 156
Height = 24
Hint =
'Enter your Network adapter'#39's static IP address here or blank for' +
......@@ -179,9 +190,9 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 1
end
object TelnetPortEdit: TEdit
Left = 105
Top = 12
Width = 48
Left = 85
Top = 10
Width = 39
Height = 24
Hint = 'TCP port for incoming connections (default=23)'
ParentShowHint = False
......@@ -189,10 +200,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 0
end
object TelnetGaCheckBox: TCheckBox
Left = 9
Top = 76
Width = 208
Height = 26
Left = 7
Top = 62
Width = 169
Height = 21
Hint =
'Send periodic Telnet GA commands to help detect dropped connecti' +
'ons'
......@@ -202,10 +213,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object AutoLogonCheckBox: TCheckBox
Left = 9
Top = 140
Width = 144
Height = 24
Left = 7
Top = 114
Width = 117
Height = 19
Hint = 'Allow V-exempt users to auto-logon based on their IP address'
Caption = 'AutoLogon via IP'
ParentShowHint = False
......@@ -217,25 +228,25 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'RLogin'
ImageIndex = 3
object RLoginPortLabel: TLabel
Left = 9
Top = 12
Width = 96
Height = 26
Left = 7
Top = 10
Width = 78
Height = 21
AutoSize = False
Caption = 'Listening Port'
end
object RLoginInterfaceLabel: TLabel
Left = 9
Top = 44
Width = 96
Height = 26
Left = 7
Top = 36
Width = 78
Height = 21
AutoSize = False
Caption = 'Interface (IP)'
end
object RLoginPortEdit: TEdit
Left = 105
Top = 12
Width = 48
Left = 85
Top = 10
Width = 39
Height = 24
Hint = 'TCP port for incoming connections (default=513)'
ParentShowHint = False
......@@ -243,9 +254,9 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 0
end
object RLoginInterfaceEdit: TEdit
Left = 105
Top = 44
Width = 192
Left = 85
Top = 36
Width = 156
Height = 24
Hint =
'Enter your Network adapter'#39's static IP address here or blank for' +
......@@ -255,10 +266,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 2
end
object RLoginEnabledCheckBox: TCheckBox
Left = 226
Top = 12
Width = 90
Height = 21
Left = 184
Top = 10
Width = 73
Height = 17
Hint = 'Enable the RLogin port'
Caption = 'Enabled'
ParentShowHint = False
......@@ -267,15 +278,17 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = RLoginEnabledCheckBoxClick
end
object RLoginIPallowButton: TButton
Left = 194
Top = 76
Width = 103
Height = 26
Hint = 'IP addresses of trusted hosts to allow unauthenticed RLogins from'
Left = 158
Top = 62
Width = 83
Height = 21
Hint =
'IP addresses of trusted hosts to allow unauthenticed RLogins fro' +
'm'
Caption = 'Allowed IPs'
ParentShowHint = False
ShowHint = True
TabOrder = 4
TabOrder = 3
OnClick = RLoginIPallowButtonClick
end
end
......@@ -283,25 +296,25 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'SSH'
ImageIndex = 4
object SshPortLabel: TLabel
Left = 9
Top = 12
Width = 96
Height = 26
Left = 7
Top = 10
Width = 78
Height = 21
AutoSize = False
Caption = 'Listening Port'
end
object SshInterfaceLabel: TLabel
Left = 9
Top = 44
Width = 96
Height = 26
Left = 7
Top = 36
Width = 78
Height = 21
AutoSize = False
Caption = 'Interface (IP)'
end
object SshPortEdit: TEdit
Left = 105
Top = 12
Width = 48
Left = 85
Top = 10
Width = 39
Height = 24
Hint = 'TCP port for incoming connections (default=22)'
ParentShowHint = False
......@@ -309,10 +322,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
TabOrder = 0
end
object SshEnabledCheckBox: TCheckBox
Left = 226
Top = 12
Width = 90
Height = 21
Left = 184
Top = 10
Width = 73
Height = 17
Hint = 'Enable the Secure Shell (SSH) port'
Caption = 'Enabled'
ParentShowHint = False
......@@ -321,9 +334,9 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = SshEnabledCheckBoxClick
end
object SshInterfaceEdit: TEdit
Left = 105
Top = 44
Width = 192
Left = 85
Top = 36
Width = 156
Height = 24
Hint =
'Enter your Network adapter'#39's static IP address here or blank for' +
......@@ -337,55 +350,55 @@ object TelnetCfgDlg: TTelnetCfgDlg
Caption = 'Sound'
ImageIndex = 2
object AnswerSoundLabel: TLabel
Left = 9
Top = 12
Width = 80
Height = 25
Left = 7
Top = 10
Width = 65
Height = 20
AutoSize = False
Caption = 'Connect'
end
object HnagupSoundLabel: TLabel
Left = 9
Top = 44
Width = 80
Height = 25
Left = 7
Top = 36
Width = 65
Height = 20
AutoSize = False
Caption = 'Disconnect'
end
object AnswerSoundEdit: TEdit
Left = 89
Top = 12
Width = 208
Height = 24
Left = 72
Top = 10
Width = 169
Height = 21
Hint = 'Sound file to play when accepting an incoming connection'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object AnswerSoundButton: TButton
Left = 304
Top = 12
Width = 25
Height = 26
Left = 247
Top = 10
Width = 20
Height = 21
Caption = '...'
TabOrder = 1
OnClick = AnswerSoundButtonClick
end
object HangupSoundEdit: TEdit
Left = 89
Top = 44
Width = 208
Height = 24
Left = 72
Top = 36
Width = 169
Height = 21
Hint = 'Sound file to play when disconnecting'
ParentShowHint = False
ShowHint = True
TabOrder = 2
end
object HangupSoundButton: TButton
Left = 304
Top = 44
Width = 25
Height = 26
Left = 247
Top = 36
Width = 20
Height = 21
Caption = '...'
TabOrder = 3
OnClick = HangupSoundButtonClick
......@@ -393,10 +406,10 @@ object TelnetCfgDlg: TTelnetCfgDlg
end
end
object OKBtn: TButton
Left = 25
Top = 247
Width = 93
Height = 31
Left = 20
Top = 201
Width = 76
Height = 25
Caption = 'OK'
Default = True
ModalResult = 1
......@@ -404,20 +417,20 @@ object TelnetCfgDlg: TTelnetCfgDlg
OnClick = OKBtnClick
end
object CancelBtn: TButton
Left = 128
Top = 247
Width = 92
Height = 31
Left = 104
Top = 201
Width = 75
Height = 25
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 2
end
object ApplyBtn: TButton
Left = 233
Top = 247
Width = 93
Height = 31
Left = 189
Top = 201
Width = 76
Height = 25
Cancel = True
Caption = 'Apply'
TabOrder = 3
......
......@@ -98,6 +98,7 @@ __published:
TCheckBox *SshEnabledCheckBox;
TLabel *SshInterfaceLabel;
TEdit *SshInterfaceEdit;
TCheckBox *DosSupportCheckBox;
void __fastcall FormShow(TObject *Sender);
void __fastcall OKBtnClick(TObject *Sender);
void __fastcall AnswerSoundButtonClick(TObject *Sender);
......
......@@ -174,6 +174,7 @@ static struct init_field {
#define BBS_OPT_NO_SPY_SOCKETS (1<<10) /* Don't create spy sockets */
#define BBS_OPT_NO_HOST_LOOKUP (1<<11)
#define BBS_OPT_ALLOW_SSH (1<<12) /* Allow logins via BSD SSH */
#define BBS_OPT_NO_DOS (1<<13) /* Don't attempt to run 16-bit DOS programs */
#define BBS_OPT_NO_RECYCLE (1<<27) /* Disable recycling of server */
#define BBS_OPT_GET_IDENT (1<<28) /* Get Identity (RFC 1413) */
#define BBS_OPT_NO_JAVASCRIPT (1<<29) /* JavaScript disabled */
......@@ -197,6 +198,7 @@ static ini_bitdesc_t bbs_options[] = {
{ BBS_OPT_NO_HOST_LOOKUP ,"NO_HOST_LOOKUP" },
{ BBS_OPT_NO_SPY_SOCKETS ,"NO_SPY_SOCKETS" },
{ BBS_OPT_ALLOW_SSH ,"ALLOW_SSH" },
{ BBS_OPT_NO_DOS ,"NO_DOS" },
{ BBS_OPT_NO_RECYCLE ,"NO_RECYCLE" },
{ BBS_OPT_GET_IDENT ,"GET_IDENT" },
{ BBS_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" },
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2014 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -416,6 +416,11 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
native = native_executable(&cfg, cmdline, mode);
if(!native && (startup->options&BBS_OPT_NO_DOS)) {
bprintf("Sorry, DOS programs are not supported on this node.\r\n");
return -1;
}
if(mode&EX_SH || strcspn(cmdline,"<>|")!=strlen(cmdline))
sprintf(comspec_str,"%s /C ", comspec);
else
......@@ -1364,6 +1369,10 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
errormsg(WHERE,ERR_WRITE,"environment",0);
} else {
if(startup->options&BBS_OPT_NO_DOS) {
bprintf("Sorry, DOS programs are not supported on this node.\r\n");
return -1;
}
#if defined(__FreeBSD__)
/* ToDo: This seems to work for every door except Iron Ox
ToDo: Iron Ox is unique in that it runs perfectly from
......