Skip to content
Snippets Groups Projects
Commit 85cfcdf3 authored by deuce's avatar deuce
Browse files

Add SecureOnly option to global tickit.ini config

This will only import tic files from the secure inbound.  This is intended to
be used with IgnorePassword to limit the attack surface.
parent a972cf5f
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,18 @@ function TickITCfg() { ...@@ -23,6 +23,18 @@ function TickITCfg() {
var sects; var sects;
var i; var i;
function get_bool(val) {
if (val === undefined)
return false;
switch(val.toUpperCase()) {
case 'YES':
case 'TRUE':
case 'ON':
return true;
}
return false;
}
function lcprops(obj) function lcprops(obj)
{ {
var i; var i;
...@@ -49,6 +61,8 @@ function TickITCfg() { ...@@ -49,6 +61,8 @@ function TickITCfg() {
lcprops(this.acfg[sects[i].toLowerCase()]); lcprops(this.acfg[sects[i].toLowerCase()]);
} }
tcfg.close(); tcfg.close();
this.gcfg.ignorepassword = get_bool(this.ignorepassword);
this.gcfg.secureonly = get_bool(this.secureonly);
} }
TickITCfg.prototype.cset = '0123456789abcdefghijklmnopqrstuvwxyz-_'; TickITCfg.prototype.cset = '0123456789abcdefghijklmnopqrstuvwxyz-_';
TickITCfg.prototype.basefn_to_num = function(num) TickITCfg.prototype.basefn_to_num = function(num)
......
...@@ -504,10 +504,7 @@ function parse_ticfile(fname) ...@@ -504,10 +504,7 @@ function parse_ticfile(fname)
} }
} }
if (tickit.gcfg.ignorepassword === undefined || if (!tickit.gcfg.ignorepassword) {
tickit.gcfg.ignorepassword.toLowerCase() == 'no' ||
tickit.gcfg.ignorepassword.toLowerCase() == 'off' ||
tickit.gcfg.ignorepassword.toLowerCase() == 'false')
if (!sbbsecho.match_pw(tic.from, tic.pw)) if (!sbbsecho.match_pw(tic.from, tic.pw))
return false; return false;
} }
...@@ -549,6 +546,10 @@ function main() { ...@@ -549,6 +546,10 @@ function main() {
var processed = 0; var processed = 0;
for (i=0; i<sbbsecho.inb.length; i++) { for (i=0; i<sbbsecho.inb.length; i++) {
if (tickit.gcfg.secureonly) {
if (sbbsecho.inb[i] != sbbsecho.secure_inbound)
continue;
}
if (system.platform === 'Win32') if (system.platform === 'Win32')
ticfiles = directory(sbbsecho.inb[i]+'/*.tic'); ticfiles = directory(sbbsecho.inb[i]+'/*.tic');
else else
......
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