Skip to content
Snippets Groups Projects
Commit f38c4ef3 authored by rswindell's avatar rswindell
Browse files

FTP Server now supports configurable IP address to use in PASV responses

(for broken firewall/NAT devices) and PASV port ranges (default is 1024-65535).
parent 62a39f65
No related branches found
No related tags found
No related merge requests found
......@@ -1945,9 +1945,15 @@ static void filexfer(SOCKADDR_IN* addr, SOCKET ctrl_sock, SOCKET pasv_sock, SOCK
} else { /* PASV */
if(startup->options&FTP_OPT_DEBUG_DATA)
lprintf(LOG_DEBUG,"%04d PASV DATA socket %d listening on %s port %u"
if(startup->options&FTP_OPT_DEBUG_DATA) {
addr_len=sizeof(SOCKADDR_IN);
if((result=getsockname(pasv_sock, (struct sockaddr *)addr,&addr_len))!=0)
lprintf(LOG_ERR,"%04d !ERROR %d (%d) getting address/port of passive socket (%u)"
,ctrl_sock,result,ERROR_VALUE,pasv_sock);
else
lprintf(LOG_DEBUG,"%04d PASV DATA socket %d listening on %s port %u"
,ctrl_sock,pasv_sock,inet_ntoa(addr->sin_addr),ntohs(addr->sin_port));
}
/* Setup for select() */
tv.tv_sec=TIMEOUT_SOCKET_LISTEN;
......@@ -2283,6 +2289,7 @@ static void ctrl_thread(void* arg)
char* np;
char* tp;
char* dp;
char* mode="active";
char password[64];
char fname[MAX_PATH+1];
char qwkfile[MAX_PATH+1];
......@@ -2831,12 +2838,16 @@ static void ctrl_thread(void* arg)
#endif
if(!strnicmp(cmd, "PORT ",5)) {
if(pasv_sock!=INVALID_SOCKET)
ftp_close_socket(&pasv_sock,__LINE__);
p=cmd+5;
while(*p && *p<=' ') p++;
sscanf(p,"%ld,%ld,%ld,%ld,%hd,%hd",&h1,&h2,&h3,&h4,&p1,&p2);
data_addr.sin_addr.s_addr=htonl((h1<<24)|(h2<<16)|(h3<<8)|h4);
data_addr.sin_port=(u_short)((p1<<8)|p2);
if(data_addr.sin_port<1024) {
if(data_addr.sin_port< IPPORT_RESERVED) {
lprintf(LOG_WARNING,"%04d !SUSPECTED BOUNCE ATTACK ATTEMPT by %s to %s port %u"
,sock,user.alias
,inet_ntoa(data_addr.sin_addr),data_addr.sin_port);
......@@ -2850,6 +2861,7 @@ static void ctrl_thread(void* arg)
}
data_addr.sin_port=htons(data_addr.sin_port);
sockprintf(sock,"200 PORT Command successful.");
mode="active";
continue;
}
......@@ -2867,32 +2879,46 @@ static void ctrl_thread(void* arg)
if(startup->options&FTP_OPT_DEBUG_DATA)
lprintf(LOG_DEBUG,"%04d PASV DATA socket %d opened",sock,pasv_sock);
pasv_addr.sin_port = 0;
for(port=startup->pasv_port_low; port<=startup->pasv_port_high; port++) {
result=bind(pasv_sock, (struct sockaddr *) &pasv_addr,sizeof(pasv_addr));
if(startup->options&FTP_OPT_DEBUG_DATA)
lprintf(LOG_DEBUG,"%04d PASV DATA trying to bind socket to port %u"
,sock,port);
pasv_addr.sin_port = htons(port);
if((result=bind(pasv_sock, (struct sockaddr *) &pasv_addr,sizeof(pasv_addr)))==0)
break;
}
if(result!= 0) {
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) binding socket", sock, result, ERROR_VALUE);
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) binding socket to port %u"
,sock, result, ERROR_VALUE, port);
sockprintf(sock,"425 Error %d binding data socket",ERROR_VALUE);
ftp_close_socket(&pasv_sock,__LINE__);
continue;
}
if(startup->options&FTP_OPT_DEBUG_DATA)
lprintf(LOG_DEBUG,"%04d PASV DATA socket %d bound to port %u",sock,pasv_sock,port);
addr_len=sizeof(addr);
if((result=getsockname(pasv_sock, (struct sockaddr *)&addr,&addr_len))!=0) {
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) getting address/port", sock, result, ERROR_VALUE);
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) getting address/port"
,sock, result, ERROR_VALUE);
sockprintf(sock,"425 Error %d getting address/port",ERROR_VALUE);
ftp_close_socket(&pasv_sock,__LINE__);
continue;
}
if((result=listen(pasv_sock, 1))!= 0) {
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) listening on socket", sock, result, ERROR_VALUE);
lprintf(LOG_ERR,"%04d !PASV ERROR %d (%d) listening on port %u"
,sock, result, ERROR_VALUE,port);
sockprintf(sock,"425 Error %d listening on data socket",ERROR_VALUE);
ftp_close_socket(&pasv_sock,__LINE__);
continue;
}
ip_addr=ntohl(pasv_addr.sin_addr.s_addr);
if((ip_addr=startup->pasv_ip_addr)==0)
ip_addr=ntohl(pasv_addr.sin_addr.s_addr);
port=ntohs(addr.sin_port);
sockprintf(sock,"227 Entering Passive Mode (%d,%d,%d,%d,%hd,%hd)"
,(ip_addr>>24)&0xff
......@@ -2902,6 +2928,7 @@ static void ctrl_thread(void* arg)
,(port>>8)&0xff
,port&0xff
);
mode="passive";
continue;
}
......@@ -3029,7 +3056,7 @@ static void ctrl_thread(void* arg)
}
SAFEPRINTF2(path,"%s%s",local_dir, *p ? p : "*");
lprintf(LOG_INFO,"%04d %s listing: %s", sock, user.alias, path);
lprintf(LOG_INFO,"%04d %s listing: %s in %s mode", sock, user.alias, path, mode);
sockprintf(sock, "150 Directory of %s%s", local_dir, p);
now=time(NULL);
......@@ -3247,7 +3274,7 @@ static void ctrl_thread(void* arg)
/* RETR */
lprintf(LOG_INFO,"%04d %s downloading: %s (%lu bytes) in %s mode"
,sock,user.alias,fname,flength(fname)
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
sockprintf(sock,"150 Opening BINARY mode data connection for file transfer.");
filexfer(&data_addr,sock,pasv_sock,&data_sock,fname,filepos
,&transfer_inprogress,&transfer_aborted,FALSE,FALSE
......@@ -3270,7 +3297,7 @@ static void ctrl_thread(void* arg)
SAFEPRINTF2(fname,"%s%s",local_dir,p);
lprintf(LOG_INFO,"%04d %s uploading: %s in %s mode", sock,user.alias,fname
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
sockprintf(sock,"150 Opening BINARY mode data connection for file transfer.");
filexfer(&data_addr,sock,pasv_sock,&data_sock,fname,filepos
,&transfer_inprogress,&transfer_aborted,FALSE,FALSE
......@@ -3351,7 +3378,7 @@ static void ctrl_thread(void* arg)
}
if(lib<0) { /* Root dir */
lprintf(LOG_INFO,"%04d %s listing: root",sock,user.alias);
lprintf(LOG_INFO,"%04d %s listing: root in %s mode",sock,user.alias, mode);
/* QWK Packet */
if(startup->options&FTP_OPT_ALLOW_QWK/* && fexist(qwkfile)*/) {
......@@ -3476,7 +3503,8 @@ static void ctrl_thread(void* arg)
fprintf(fp,"%s\r\n",scfg.lib[i]->sname);
}
} else if(dir<0) {
lprintf(LOG_INFO,"%04d %s listing: %s library",sock,user.alias,scfg.lib[lib]->sname);
lprintf(LOG_INFO,"%04d %s listing: %s library in %s mode"
,sock,user.alias,scfg.lib[lib]->sname,mode);
for(i=0;i<scfg.total_dirs;i++) {
if(scfg.dir[i]->lib!=lib)
continue;
......@@ -3495,8 +3523,8 @@ static void ctrl_thread(void* arg)
fprintf(fp,"%s\r\n",scfg.dir[i]->code_suffix);
}
} else if(chk_ar(&scfg,scfg.dir[dir]->ar,&user)) {
lprintf(LOG_INFO,"%04d %s listing: %s/%s directory"
,sock,user.alias,scfg.lib[lib]->sname,scfg.dir[dir]->code_suffix);
lprintf(LOG_INFO,"%04d %s listing: %s/%s directory in %s mode"
,sock,user.alias,scfg.lib[lib]->sname,scfg.dir[dir]->code_suffix,mode);
SAFEPRINTF2(path,"%s%s",scfg.dir[dir]->path,*p ? p : "*");
glob(path,0,NULL,&g);
......@@ -3545,8 +3573,8 @@ static void ctrl_thread(void* arg)
}
globfree(&g);
} else
lprintf(LOG_INFO,"%04d %s listing: %s/%s directory (empty - no access)"
,sock,user.alias,scfg.lib[lib]->sname,scfg.dir[dir]->code_suffix);
lprintf(LOG_INFO,"%04d %s listing: %s/%s directory in %s mode (empty - no access)"
,sock,user.alias,scfg.lib[lib]->sname,scfg.dir[dir]->code_suffix,mode);
fclose(fp);
filexfer(&data_addr,sock,pasv_sock,&data_sock,fname,0L
......@@ -3673,7 +3701,7 @@ static void ctrl_thread(void* arg)
if(!getsize && !getdate)
lprintf(LOG_INFO,"%04d %s downloading QWK packet (%lu bytes) in %s mode"
,sock,user.alias,flength(fname)
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
/* ASCII Index File */
} else if(startup->options&FTP_OPT_INDEX_FILE
&& !stricmp(p,startup->index_file_name)
......@@ -3687,7 +3715,7 @@ static void ctrl_thread(void* arg)
if(!getsize && !getdate)
lprintf(LOG_INFO,"%04d %s downloading index for %s in %s mode"
,sock,user.alias,vpath(lib,dir,str)
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
success=TRUE;
credits=FALSE;
tmpfile=TRUE;
......@@ -3880,7 +3908,7 @@ static void ctrl_thread(void* arg)
if(!getsize && !getdate)
lprintf(LOG_INFO,"%04d %s downloading HTML index for %s in %s mode"
,sock,user.alias,vpath(lib,dir,str)
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
success=TRUE;
credits=FALSE;
tmpfile=TRUE;
......@@ -3977,7 +4005,7 @@ static void ctrl_thread(void* arg)
if(!getsize && !getdate && !delecmd)
lprintf(LOG_INFO,"%04d %s downloading: %s (%lu bytes) in %s mode"
,sock,user.alias,fname,flength(fname)
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
}
}
}
......@@ -4112,7 +4140,7 @@ static void ctrl_thread(void* arg)
sprintf(fname,"%sfile/%04d.rep",scfg.data_dir,user.number);
lprintf(LOG_INFO,"%04d %s uploading: %s in %s mode"
,sock,user.alias,fname
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
} else {
append=(strnicmp(cmd,"APPE",4)==0);
......@@ -4182,7 +4210,7 @@ static void ctrl_thread(void* arg)
,p /* filename */
,vpath(lib,dir,str) /* virtual path */
,scfg.dir[dir]->path /* actual path */
,pasv_sock==INVALID_SOCKET ? "active":"passive");
,mode);
}
sockprintf(sock,"150 Opening BINARY mode data connection for file transfer.");
filexfer(&data_addr,sock,pasv_sock,&data_sock,fname,filepos
......
......@@ -49,6 +49,9 @@ typedef struct {
WORD qwk_timeout;
WORD sem_chk_freq; /* semaphore file checking frequency (in seconds) */
DWORD interface_addr;
DWORD pasv_ip_addr;
WORD pasv_port_low;
WORD pasv_port_high;
DWORD options; /* See FTP_OPT definitions */
void* cbdata; /* Private data passed to callbacks */
......
......@@ -42,14 +42,21 @@
#include "sbbsdefs.h" /* JAVASCRIPT_* macros */
static const char* nulstr="";
static const char* strAutoStart="AutoStart";
static const char* strCtrlDirectory="CtrlDirectory";
static const char* strTempDirectory="TempDirectory";
static const char* strOptions="Options";
static const char* strInterface="Interface";
static const char* strPort="Port";
static const char* strMaxClients="MaxClients";
static const char* strMaxInactivity="MaxInactivity";
static const char* strHostName="HostName";
static const char* strLogMask="LogMask";
static const char* strBindRetryCount="BindRetryCount";
static const char* strBindRetryDelay="BindRetryDelay";
static const char* strAnswerSound="AnswerSound";
static const char* strHangupSound="HangupSound";
static const char* strHackAttemptSound="HackAttemptSound";
static const char* strJavaScriptMaxBytes ="JavaScriptMaxBytes";
static const char* strJavaScriptContextStack ="JavaScriptContextStack";
static const char* strJavaScriptThreadStack ="JavaScriptThreadStack";
......@@ -107,7 +114,7 @@ void sbbs_get_ini_fname(char* ini_file, char* ctrl_dir, char* pHostName)
iniFileName(ini_file,MAX_PATH,ctrl_dir,"startup.ini");
}
static sbbs_fix_js_settings(js_startup_t* js)
static void sbbs_fix_js_settings(js_startup_t* js)
{
/* Some sanity checking here */
if(js->max_bytes==0) js->max_bytes=JAVASCRIPT_MAX_BYTES;
......@@ -277,7 +284,7 @@ void sbbs_read_ini(
section = "BBS";
if(run_bbs!=NULL)
*run_bbs=iniReadBool(fp,section,"AutoStart",TRUE);
*run_bbs=iniReadBool(fp,section,strAutoStart,TRUE);
if(bbs!=NULL) {
......@@ -338,9 +345,9 @@ void sbbs_read_ini(
,iniReadString(fp,section,"DOSemuPath",default_dosemu_path,value));
SAFECOPY(bbs->answer_sound
,iniReadString(fp,section,"AnswerSound",nulstr,value));
,iniReadString(fp,section,strAnswerSound,nulstr,value));
SAFECOPY(bbs->hangup_sound
,iniReadString(fp,section,"HangupSound",nulstr,value));
,iniReadString(fp,section,strHangupSound,nulstr,value));
bbs->log_mask
=iniReadBitField(fp,section,strLogMask,log_mask_bits,global->log_mask);
......@@ -356,23 +363,32 @@ void sbbs_read_ini(
section = "FTP";
if(run_ftp!=NULL)
*run_ftp=iniReadBool(fp,section,"AutoStart",TRUE);
*run_ftp=iniReadBool(fp,section,strAutoStart,TRUE);
if(ftp!=NULL) {
ftp->interface_addr
=iniReadIpAddress(fp,section,strInterface,global->interface_addr);
ftp->port
=iniReadShortInt(fp,section,"Port",IPPORT_FTP);
=iniReadShortInt(fp,section,strPort,IPPORT_FTP);
ftp->max_clients
=iniReadShortInt(fp,section,"MaxClients",10);
=iniReadShortInt(fp,section,strMaxClients,10);
ftp->max_inactivity
=iniReadShortInt(fp,section,"MaxInactivity",300); /* seconds */
=iniReadShortInt(fp,section,strMaxInactivity,300); /* seconds */
ftp->qwk_timeout
=iniReadShortInt(fp,section,"QwkTimeout",600); /* seconds */
ftp->sem_chk_freq
=iniReadShortInt(fp,section,strSemFileCheckFrequency,global->sem_chk_freq);
/* Passive transfer settings (for stupid firewalls/NATs) */
ftp->pasv_ip_addr
=iniReadIpAddress(fp,section,"PasvIpAddress",0);
ftp->pasv_port_low
=iniReadShortInt(fp,section,"PasvPortLow",IPPORT_RESERVED);
ftp->pasv_port_high
=iniReadShortInt(fp,section,"PasvPortHigh",0xffff);
/* JavaScript Operating Parameters */
sbbs_read_js_settings(fp, section, &ftp->js, &global->js);
......@@ -387,11 +403,11 @@ void sbbs_read_ini(
,iniReadString(fp,section,"HtmlIndexScript","ftp-html.js",value));
SAFECOPY(ftp->answer_sound
,iniReadString(fp,section,"AnswerSound",nulstr,value));
,iniReadString(fp,section,strAnswerSound,nulstr,value));
SAFECOPY(ftp->hangup_sound
,iniReadString(fp,section,"HangupSound",nulstr,value));
,iniReadString(fp,section,strHangupSound,nulstr,value));
SAFECOPY(ftp->hack_sound
,iniReadString(fp,section,"HackAttemptSound",nulstr,value));
,iniReadString(fp,section,strHackAttemptSound,nulstr,value));
SAFECOPY(ftp->temp_dir
,iniReadString(fp,section,strTempDirectory,ftp->temp_dir,value));
......@@ -410,7 +426,7 @@ void sbbs_read_ini(
section = "Mail";
if(run_mail!=NULL)
*run_mail=iniReadBool(fp,section,"AutoStart",TRUE);
*run_mail=iniReadBool(fp,section,strAutoStart,TRUE);
if(mail!=NULL) {
......@@ -423,9 +439,9 @@ void sbbs_read_ini(
mail->relay_port
=iniReadShortInt(fp,section,"RelayPort",IPPORT_SMTP);
mail->max_clients
=iniReadShortInt(fp,section,"MaxClients",10);
=iniReadShortInt(fp,section,strMaxClients,10);
mail->max_inactivity
=iniReadShortInt(fp,section,"MaxInactivity",120); /* seconds */
=iniReadShortInt(fp,section,strMaxInactivity,120); /* seconds */
mail->max_delivery_attempts
=iniReadShortInt(fp,section,"MaxDeliveryAttempts",50);
mail->rescan_frequency
......@@ -487,7 +503,7 @@ void sbbs_read_ini(
section = "Services";
if(run_services!=NULL)
*run_services=iniReadBool(fp,section,"AutoStart",TRUE);
*run_services=iniReadBool(fp,section,strAutoStart,TRUE);
if(services!=NULL) {
......@@ -507,9 +523,9 @@ void sbbs_read_ini(
,iniReadString(fp,section,strTempDirectory,services->temp_dir,value));
SAFECOPY(services->answer_sound
,iniReadString(fp,section,"AnswerSound",nulstr,value));
,iniReadString(fp,section,strAnswerSound,nulstr,value));
SAFECOPY(services->hangup_sound
,iniReadString(fp,section,"HangupSound",nulstr,value));
,iniReadString(fp,section,strHangupSound,nulstr,value));
services->log_mask
=iniReadBitField(fp,section,strLogMask,log_mask_bits,global->log_mask);
......@@ -525,18 +541,18 @@ void sbbs_read_ini(
section = "Web";
if(run_web!=NULL)
*run_web=iniReadBool(fp,section,"AutoStart",FALSE);
*run_web=iniReadBool(fp,section,strAutoStart,FALSE);
if(web!=NULL) {
web->interface_addr
=iniReadIpAddress(fp,section,strInterface,global->interface_addr);
web->port
=iniReadShortInt(fp,section,"Port",IPPORT_HTTP);
=iniReadShortInt(fp,section,strPort,IPPORT_HTTP);
web->max_clients
=iniReadShortInt(fp,section,"MaxClients",10);
=iniReadShortInt(fp,section,strMaxClients,10);
web->max_inactivity
=iniReadShortInt(fp,section,"MaxInactivity",120); /* seconds */
=iniReadShortInt(fp,section,strMaxInactivity,120); /* seconds */
web->sem_chk_freq
=iniReadShortInt(fp,section,strSemFileCheckFrequency,global->sem_chk_freq);
......@@ -573,16 +589,16 @@ void sbbs_read_ini(
,iniReadString(fp,section,"EmbJavaScriptExtension",".bbs",value));
web->max_inactivity
=iniReadShortInt(fp,section,"MaxInactivity",120); /* seconds */
=iniReadShortInt(fp,section,strMaxInactivity,120); /* seconds */
web->max_cgi_inactivity
=iniReadShortInt(fp,section,"MaxCgiInactivity",120); /* seconds */
SAFECOPY(web->answer_sound
,iniReadString(fp,section,"AnswerSound",nulstr,value));
,iniReadString(fp,section,strAnswerSound,nulstr,value));
SAFECOPY(web->hangup_sound
,iniReadString(fp,section,"HangupSound",nulstr,value));
,iniReadString(fp,section,strHangupSound,nulstr,value));
SAFECOPY(web->hack_sound
,iniReadString(fp,section,"HackAttemptSound",nulstr,value));
,iniReadString(fp,section,strHackAttemptSound,nulstr,value));
web->log_mask
=iniReadBitField(fp,section,strLogMask,log_mask_bits,global->log_mask);
......@@ -685,7 +701,7 @@ BOOL sbbs_write_ini(
section = "BBS";
if(!iniSetBool(lp,section,"AutoStart",run_bbs,&style))
if(!iniSetBool(lp,section,strAutoStart,run_bbs,&style))
break;
if(bbs->telnet_interface==global->interface_addr)
......@@ -747,9 +763,9 @@ BOOL sbbs_write_ini(
if(!iniSetString(lp,section,"DOSemuPath",bbs->dosemu_path,&style))
break;
if(!iniSetString(lp,section,"AnswerSound",bbs->answer_sound,&style))
if(!iniSetString(lp,section,strAnswerSound,bbs->answer_sound,&style))
break;
if(!iniSetString(lp,section,"HangupSound",bbs->hangup_sound,&style))
if(!iniSetString(lp,section,strHangupSound,bbs->hangup_sound,&style))
break;
if(!iniSetBitField(lp,section,strOptions,bbs_options,bbs->options,&style))
......@@ -769,7 +785,7 @@ BOOL sbbs_write_ini(
section = "FTP";
if(!iniSetBool(lp,section,"AutoStart",run_ftp,&style))
if(!iniSetBool(lp,section,strAutoStart,run_ftp,&style))
break;
if(ftp->interface_addr==global->interface_addr)
......@@ -777,15 +793,23 @@ BOOL sbbs_write_ini(
else if(!iniSetIpAddress(lp,section,strInterface,ftp->interface_addr,&style))
break;
if(!iniSetShortInt(lp,section,"Port",ftp->port,&style))
if(!iniSetShortInt(lp,section,strPort,ftp->port,&style))
break;
if(!iniSetShortInt(lp,section,"MaxClients",ftp->max_clients,&style))
if(!iniSetShortInt(lp,section,strMaxClients,ftp->max_clients,&style))
break;
if(!iniSetShortInt(lp,section,"MaxInactivity",ftp->max_inactivity,&style))
if(!iniSetShortInt(lp,section,strMaxInactivity,ftp->max_inactivity,&style))
break;
if(!iniSetShortInt(lp,section,"QwkTimeout",ftp->qwk_timeout,&style))
break;
/* Passive transfer settings */
if(!iniSetIpAddress(lp,section,"PasvIpAddress",ftp->pasv_ip_addr,&style))
break;
if(!iniSetShortInt(lp,section,"PasvPortLow",ftp->pasv_port_low,&style))
break;
if(!iniSetShortInt(lp,section,"PasvPortHigh",ftp->pasv_port_high,&style))
break;
if(ftp->sem_chk_freq==global->sem_chk_freq)
iniRemoveValue(lp,section,strSemFileCheckFrequency);
else if(!iniSetShortInt(lp,section,strSemFileCheckFrequency,ftp->sem_chk_freq,&style))
......@@ -818,11 +842,11 @@ BOOL sbbs_write_ini(
if(!iniSetString(lp,section,"HtmlIndexScript",ftp->html_index_script,&style))
break;
if(!iniSetString(lp,section,"AnswerSound",ftp->answer_sound,&style))
if(!iniSetString(lp,section,strAnswerSound,ftp->answer_sound,&style))
break;
if(!iniSetString(lp,section,"HangupSound",ftp->hangup_sound,&style))
if(!iniSetString(lp,section,strHangupSound,ftp->hangup_sound,&style))
break;
if(!iniSetString(lp,section,"HackAttemptSound",ftp->hack_sound,&style))
if(!iniSetString(lp,section,strHackAttemptSound,ftp->hack_sound,&style))
break;
if(!iniSetBitField(lp,section,strOptions,ftp_options,ftp->options,&style))
......@@ -843,7 +867,7 @@ BOOL sbbs_write_ini(
section = "Mail";
if(!iniSetBool(lp,section,"AutoStart",run_mail,&style))
if(!iniSetBool(lp,section,strAutoStart,run_mail,&style))
break;
if(mail->interface_addr==global->interface_addr)
......@@ -867,9 +891,9 @@ BOOL sbbs_write_ini(
break;
if(!iniSetShortInt(lp,section,"RelayPort",mail->relay_port,&style))
break;
if(!iniSetShortInt(lp,section,"MaxClients",mail->max_clients,&style))
if(!iniSetShortInt(lp,section,strMaxClients,mail->max_clients,&style))
break;
if(!iniSetShortInt(lp,section,"MaxInactivity",mail->max_inactivity,&style))
if(!iniSetShortInt(lp,section,strMaxInactivity,mail->max_inactivity,&style))
break;
if(!iniSetShortInt(lp,section,"MaxDeliveryAttempts",mail->max_delivery_attempts,&style))
break;
......@@ -940,7 +964,7 @@ BOOL sbbs_write_ini(
section = "Services";
if(!iniSetBool(lp,section,"AutoStart",run_services,&style))
if(!iniSetBool(lp,section,strAutoStart,run_services,&style))
break;
if(services->interface_addr==global->interface_addr)
......@@ -973,9 +997,9 @@ BOOL sbbs_write_ini(
else if(!iniSetString(lp,section,strTempDirectory,services->temp_dir,&style))
break;
if(!iniSetString(lp,section,"AnswerSound",services->answer_sound,&style))
if(!iniSetString(lp,section,strAnswerSound,services->answer_sound,&style))
break;
if(!iniSetString(lp,section,"HangupSound",services->hangup_sound,&style))
if(!iniSetString(lp,section,strHangupSound,services->hangup_sound,&style))
break;
if(!iniSetBitField(lp,section,strOptions,service_options,services->options,&style))
......@@ -996,7 +1020,7 @@ BOOL sbbs_write_ini(
section = "Web";
if(!iniSetBool(lp,section,"AutoStart",run_web,&style))
if(!iniSetBool(lp,section,strAutoStart,run_web,&style))
break;
if(web->interface_addr==global->interface_addr)
......@@ -1004,11 +1028,11 @@ BOOL sbbs_write_ini(
else if(!iniSetIpAddress(lp,section,strInterface,web->interface_addr,&style))
break;
if(!iniSetShortInt(lp,section,"Port",web->port,&style))
if(!iniSetShortInt(lp,section,strPort,web->port,&style))
break;
if(!iniSetShortInt(lp,section,"MaxClients",web->max_clients,&style))
if(!iniSetShortInt(lp,section,strMaxClients,web->max_clients,&style))
break;
if(!iniSetShortInt(lp,section,"MaxInactivity",web->max_inactivity,&style))
if(!iniSetShortInt(lp,section,strMaxInactivity,web->max_inactivity,&style))
break;
if(web->sem_chk_freq==global->sem_chk_freq)
......@@ -1056,16 +1080,16 @@ BOOL sbbs_write_ini(
if(!iniSetString(lp,section,"JavaScriptExtension",web->ssjs_ext,&style))
break;
if(!iniSetShortInt(lp,section,"MaxInactivity",web->max_inactivity,&style))
if(!iniSetShortInt(lp,section,strMaxInactivity,web->max_inactivity,&style))
break;
if(!iniSetShortInt(lp,section,"MaxCgiInactivity",web->max_cgi_inactivity,&style))
break;
if(!iniSetString(lp,section,"AnswerSound",web->answer_sound,&style))
if(!iniSetString(lp,section,strAnswerSound,web->answer_sound,&style))
break;
if(!iniSetString(lp,section,"HangupSound",web->hangup_sound,&style))
if(!iniSetString(lp,section,strHangupSound,web->hangup_sound,&style))
break;
if(!iniSetString(lp,section,"HackAttemptSound",web->hack_sound,&style))
if(!iniSetString(lp,section,strHackAttemptSound,web->hack_sound,&style))
break;
if(!iniSetBitField(lp,section,strOptions,web_options,web->options,&style))
......
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