Commit 5a970f9b authored by rswindell's avatar rswindell
Browse files

Converted hard-coded trashcan filenames to lowercase (for Unix compatibility).

parent ea128905
......@@ -1212,7 +1212,7 @@ int sbbs_t::exec(csi_t *csi)
return(0); }
switch(*(csi->ip++)) {
case USER_STRING_ALIAS:
if(!isalpha(csi->str[0]) || trashcan(csi->str,"NAME"))
if(!isalpha(csi->str[0]) || trashcan(csi->str,"name"))
break;
i=matchuser(&cfg,csi->str);
if(i && i!=useron.number)
......@@ -1223,7 +1223,7 @@ int sbbs_t::exec(csi_t *csi)
csi->logic=LOGIC_TRUE;
break;
case USER_STRING_REALNAME:
if(trashcan(csi->str,"NAME"))
if(trashcan(csi->str,"name"))
break;
if(cfg.uq&UQ_DUPREAL
&& userdatdupe(useron.number,U_NAME,LEN_NAME
......@@ -1235,7 +1235,7 @@ int sbbs_t::exec(csi_t *csi)
csi->logic=LOGIC_TRUE;
break;
case USER_STRING_HANDLE:
if(trashcan(csi->str,"NAME"))
if(trashcan(csi->str,"name"))
break;
if(cfg.uq&UQ_DUPHAND
&& userdatdupe(useron.number,U_HANDLE,LEN_HANDLE
......@@ -1291,7 +1291,7 @@ int sbbs_t::exec(csi_t *csi)
csi->logic=LOGIC_TRUE;
break;
case USER_STRING_PHONE:
if(trashcan(csi->str,"PHONE"))
if(trashcan(csi->str,"phone"))
break;
sprintf(useron.phone,"%.*s",LEN_PHONE,csi->str);
putuserrec(&cfg,useron.number,U_PHONE,LEN_PHONE
......
......@@ -1265,16 +1265,16 @@ static void ctrl_thread(void* arg)
lprintf("%04d Host name: %s", sock, host_name);
if(trashcan(&scfg,host_ip,"IP")) {
lprintf("!Client blocked in IP.CAN: ", host_ip);
if(trashcan(&scfg,host_ip,"ip")) {
lprintf("!Client blocked in ip.can: ", host_ip);
sockprintf(sock,"550 Access denied.");
close_socket(&sock,__LINE__);
thread_down();
return;
}
if(trashcan(&scfg,host_name,"HOST")) {
lprintf("!Client blocked in HOST.CAN: %s", host_name);
if(trashcan(&scfg,host_name,"host")) {
lprintf("!Client blocked in host.can: %s", host_name);
sockprintf(sock,"550 Access denied.");
close_socket(&sock,__LINE__);
thread_down();
......@@ -2670,7 +2670,7 @@ static void ctrl_thread(void* arg)
continue;
}
if(strcspn(p,ILLEGAL_FILENAME_CHARS)!=strlen(p)
|| trashcan(&scfg,p,"FILE")) {
|| trashcan(&scfg,p,"file")) {
lprintf("%04d !%s illegal filename attempt: %s"
,sock,user.alias,p);
sockprintf(sock,"553 Illegal filename attempt");
......
......@@ -295,7 +295,7 @@ bool sbbs_t::logon()
bputs(text[EnterYourCompany]);
getstr(useron.name,LEN_NAME,K_UPRLWR|(cfg.uq&UQ_NOEXASC));
if(cfg.uq&UQ_ALIASES && cfg.uq&UQ_REALNAME) {
if(trashcan(useron.name,"NAME") || !useron.name[0]
if(trashcan(useron.name,"name") || !useron.name[0]
|| !strchr(useron.name,SP)
|| strchr(useron.name,0xff)
|| (cfg.uq&UQ_DUPREAL
......@@ -316,7 +316,7 @@ bool sbbs_t::logon()
|| (cfg.uq&UQ_DUPHAND
&& userdatdupe(useron.number,U_HANDLE,LEN_HANDLE
,useron.handle,0))
|| trashcan(useron.handle,"NAME"))
|| trashcan(useron.handle,"name"))
bputs(text[YouCantUseThatName]);
else
break; } }
......@@ -347,7 +347,7 @@ bool sbbs_t::logon()
if(getstr(useron.phone,LEN_PHONE
,K_UPPER|(cfg.uq&UQ_NOEXASC))<5)
continue; }
if(!trashcan(useron.phone,"PHONE"))
if(!trashcan(useron.phone,"phone"))
break; } }
if(!(sys_status&SS_RLOGIN)
&& /* cfg.uq&UQ_EMAIL && */ !useron.netmail[0]) {
......
......@@ -546,8 +546,8 @@ static void pop3_thread(void* arg)
if(startup->options&MAIL_OPT_DEBUG_POP3)
lprintf("%04d POP3 client name: %s", socket, host_name);
if(trashcan(&scfg,host_ip,"IP")) {
lprintf("%04d !POP3 client blocked in IP.CAN: %s"
if(trashcan(&scfg,host_ip,"ip")) {
lprintf("%04d !POP3 client blocked in ip.can: %s"
,socket, host_ip);
sockprintf(socket,"-ERR Access denied.");
close_socket(socket);
......@@ -555,8 +555,8 @@ static void pop3_thread(void* arg)
return;
}
if(trashcan(&scfg,host_name,"HOST")) {
lprintf("%04d !POP3 client blocked in HOST.CAN: %s"
if(trashcan(&scfg,host_name,"host")) {
lprintf("%04d !POP3 client blocked in host.can: %s"
,socket, host_name);
sockprintf(socket,"-ERR Access denied.");
close_socket(socket);
......@@ -1098,8 +1098,8 @@ static void smtp_thread(void* arg)
strcpy(hello_name,host_name);
if(trashcan(&scfg,host_ip,"IP")) {
lprintf("%04d !SMTP server blocked in IP.CAN: %s"
if(trashcan(&scfg,host_ip,"ip")) {
lprintf("%04d !SMTP server blocked in ip.can: %s"
,socket, host_ip);
sockprintf(socket,"550 Access denied.");
close_socket(socket);
......@@ -1107,8 +1107,8 @@ static void smtp_thread(void* arg)
return;
}
if(trashcan(&scfg,host_name,"HOST")) {
lprintf("%04d !SMTP server blocked in HOST.CAN: %s"
if(trashcan(&scfg,host_name,"host")) {
lprintf("%04d !SMTP server blocked in host.can: %s"
,socket, host_name);
sockprintf(socket,"550 Access denied.");
close_socket(socket);
......@@ -1168,8 +1168,8 @@ static void smtp_thread(void* arg)
return;
}
if(trashcan(&scfg,host_name,"SMTPSPY")
|| trashcan(&scfg,host_ip,"SMTPSPY")) {
if(trashcan(&scfg,host_name,"smtpspy")
|| trashcan(&scfg,host_ip,"smtpspy")) {
sprintf(str,"%sSMTPSPY.TXT", scfg.data_dir);
spy=fopen(str,"a");
}
......@@ -1615,7 +1615,7 @@ static void smtp_thread(void* arg)
sprintf(reverse_path,"%.*s",(int)sizeof(reverse_path)-1,p);
sender[0]=0;
sender_addr[0]=0;
if(spy==NULL && trashcan(&scfg,reverse_path,"SMTPSPY")) {
if(spy==NULL && trashcan(&scfg,reverse_path,"smtpspy")) {
sprintf(str,"%sSMTPSPY.TXT", scfg.data_dir);
spy=fopen(str,"a");
}
......@@ -1658,8 +1658,8 @@ static void smtp_thread(void* arg)
if(stricmp(tp+1,scfg.sys_inetaddr) &&
resolve_ip(tp+1)!=server_addr.sin_addr.s_addr) {
if(!trashcan(&scfg,host_name,"RELAY") &&
!trashcan(&scfg,host_ip,"RELAY")) {
if(!trashcan(&scfg,host_name,"relay") &&
!trashcan(&scfg,host_ip,"relay")) {
lprintf("%04d !SMTP Illegal relay attempt from %s [%s] to %s"
,socket, host_name, host_ip, tp+1);
sockprintf(socket, "550 Relay not allowed.");
......
......@@ -171,7 +171,7 @@ void sbbs_t::newuser()
truncsp(useron.alias);
if(useron.alias[0]<=SP || !isalpha(useron.alias[0])
|| strchr(useron.alias,0xff)
|| matchuser(&cfg,useron.alias) || trashcan(useron.alias,"NAME")
|| matchuser(&cfg,useron.alias) || trashcan(useron.alias,"name")
|| (!(cfg.uq&UQ_ALIASES) && !strchr(useron.alias,SP))) {
bputs(text[YouCantUseThatName]);
continue; }
......@@ -183,7 +183,7 @@ void sbbs_t::newuser()
bputs(text[EnterYourRealName]);
if(!getstr(useron.name,LEN_NAME
,K_UPRLWR|(cfg.uq&UQ_NOEXASC)|K_EDIT|K_AUTODEL)
|| trashcan(useron.name,"NAME")
|| trashcan(useron.name,"name")
|| strchr(useron.name,0xff)
|| !strchr(useron.name,SP)
|| (cfg.uq&UQ_DUPREAL
......@@ -207,7 +207,7 @@ void sbbs_t::newuser()
|| strchr(useron.handle,0xff)
|| (cfg.uq&UQ_DUPHAND
&& userdatdupe(0,U_HANDLE,LEN_HANDLE,useron.handle,0))
|| trashcan(useron.handle,"NAME"))
|| trashcan(useron.handle,"name"))
bputs(text[YouCantUseThatName]);
else
break; }
......@@ -255,7 +255,7 @@ void sbbs_t::newuser()
if(gettmplt(useron.phone,cfg.sys_phonefmt
,K_LINE|(cfg.uq&UQ_NOEXASC)|K_EDIT)<strlen(cfg.sys_phonefmt))
continue; }
if(!trashcan(useron.phone,"PHONE"))
if(!trashcan(useron.phone,"phone"))
break; } }
if(!online) return;
if(cfg.uq&UQ_SEX) {
......
......@@ -713,7 +713,7 @@ void sbbs_t::dirinfo(uint dirnum)
}
/****************************************************************************/
/* Searches the file <name>.CAN in the TEXT directory for matches */
/* Searches the file <name>.can in the TEXT directory for matches */
/* Returns 1 if found in list, 0 if not. */
/****************************************************************************/
extern "C" BOOL DLLCALL trashcan(scfg_t* cfg, char* insearch, char* name)
......
......@@ -283,7 +283,7 @@ void sbbs_t::upload(uint dirnum)
f.altpath=altul;
bputs(text[Filename]);
if(!getstr(fname,12,K_UPPER) || strchr(fname,'?') || strchr(fname,'*')
|| !checkfname(fname) || (trashcan(fname,"FILE") && !dir_op(dirnum))) {
|| !checkfname(fname) || (trashcan(fname,"file") && !dir_op(dirnum))) {
if(fname[0])
bputs(text[BadFilename]);
return; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment