Compare commits
7 Commits
30e860885f
...
bcf0d456ee
Author | SHA1 | Date | |
---|---|---|---|
bcf0d456ee | |||
39dd885dd0 | |||
8b10d9f48a | |||
27b4c624b3 | |||
c2e418676b | |||
0b2630f624 | |||
097b39faa7 |
23
README.md
23
README.md
@ -25,13 +25,18 @@ New Versions
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
https://prj.zxalexis.ru/gitea/zx/bforce
|
https://prj.zxalexis.ru/gitea/zx/bforce
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 1998-2000 Alexander Belkin, Moscow, Russia.
|
Older Sources
|
||||||
(c) 2004-2007 Evgeniy Kozhuhovskiy 2:450/256, 2:450/267
|
-------------
|
||||||
(c) 2005 Andrey Slusar
|
https://github.com/zotrix/binkleyforce/
|
||||||
(c) 2006-2016 Max N. Boyarov
|
https://sourceforge.net/projects/binkforce/
|
||||||
(c) 2007-2008 Sergey Babitch
|
|
||||||
(c) 2011-2014 Sergey Dorofeev
|
Copyright <br>
|
||||||
(c) 2014 Alexander Skovpen
|
> (c) 1998-2000 Alexander Belkin, Moscow, Russia.<br>
|
||||||
(c) 2024 Alexey Khromov
|
> (c) 2004-2007 Evgeniy Kozhuhovskiy 2:450/256, 2:450/267<br>
|
||||||
|
> (c) 2005 Andrey Slusar<br>
|
||||||
|
> (c) 2006-2016 Max N. Boyarov<br>
|
||||||
|
> (c) 2007-2008 Sergey Babitch<br>
|
||||||
|
> (c) 2011-2014 Sergey Dorofeev<br>
|
||||||
|
> (c) 2014 Alexander Skovpen<br>
|
||||||
|
> (c) 2024 Alexey Khromov<br>
|
||||||
|
@ -146,6 +146,7 @@ clean:
|
|||||||
rm -f ./bin/core
|
rm -f ./bin/core
|
||||||
clean-am:
|
clean-am:
|
||||||
rm -f ./Makefile
|
rm -f ./Makefile
|
||||||
|
rm -f ../debian/Makefile
|
||||||
rm -f ./include/config.h
|
rm -f ./include/config.h
|
||||||
rm -f ./config.log
|
rm -f ./config.log
|
||||||
rm -f ./config.status
|
rm -f ./config.status
|
||||||
|
@ -453,7 +453,7 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
/* Reopen log file if it was defined in config */
|
/* Reopen log file if it was defined in config */
|
||||||
if( log_reopen(log_getfilename(LOG_FILE_SESSION), NULL, NULL) )
|
if( log_reopen(log_getfilename(LOG_FILE_SESSION), NULL, NULL) )
|
||||||
{
|
{
|
||||||
log("can't continue without logging");
|
DEB((D_CONFIG, "can't continue without logging"));
|
||||||
gotoexit(BFERR_FATALERROR);
|
gotoexit(BFERR_FATALERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,6 +755,7 @@ int daemon_pidfile(int cmd)
|
|||||||
pid_t hispid, mypid = getpid();
|
pid_t hispid, mypid = getpid();
|
||||||
FILE *pf;
|
FILE *pf;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
int res;
|
||||||
|
|
||||||
if( !pidfile )
|
if( !pidfile )
|
||||||
return 0;
|
return 0;
|
||||||
@ -768,7 +769,12 @@ int daemon_pidfile(int cmd)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
|
if (res != 1) {
|
||||||
|
log("daemon pidfile: not readable");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
fclose(pf);
|
fclose(pf);
|
||||||
|
|
||||||
if( hispid ) {
|
if( hispid ) {
|
||||||
@ -807,7 +813,12 @@ int daemon_pidfile(int cmd)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
|
if (res != 1) {
|
||||||
|
log("daemon pidfile: not readable");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
fclose(pf);
|
fclose(pf);
|
||||||
|
|
||||||
if( !hispid || (hispid == mypid) ) {
|
if( !hispid || (hispid == mypid) ) {
|
||||||
@ -831,7 +842,12 @@ int daemon_pidfile(int cmd)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
|
if (res != 1) {
|
||||||
|
log("daemon pidfile: not readable");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
fclose(pf);
|
fclose(pf);
|
||||||
unlink(pidfile);
|
unlink(pidfile);
|
||||||
|
|
||||||
|
@ -311,6 +311,7 @@ int session_set_inbound(void)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *p_inb;
|
char *p_inb;
|
||||||
|
int res;
|
||||||
|
|
||||||
p_inb = conf_string(cf_inbound_directory);
|
p_inb = conf_string(cf_inbound_directory);
|
||||||
if( !p_inb ) {
|
if( !p_inb ) {
|
||||||
@ -342,7 +343,11 @@ int session_set_inbound(void)
|
|||||||
log("inbound: %s", buf);
|
log("inbound: %s", buf);
|
||||||
state.inbound = (char*)xstrcpy(buf);
|
state.inbound = (char*)xstrcpy(buf);
|
||||||
snprintf( buf, PATH_MAX+30, "/bin/mkdir -p -m 700 %s", state.inbound ); /* 30 additional chars allowed */
|
snprintf( buf, PATH_MAX+30, "/bin/mkdir -p -m 700 %s", state.inbound ); /* 30 additional chars allowed */
|
||||||
system( buf );
|
res = system( buf );
|
||||||
|
if (res != 0) {
|
||||||
|
log("Inbound create error: %d", res);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,12 +70,14 @@ static char *session_stat_get_stsfile(s_faddr *addr, int linenum)
|
|||||||
|
|
||||||
static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
if( fseek(fp, 0, SEEK_SET) == -1 )
|
if( fseek(fp, 0, SEEK_SET) == -1 )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memset(stat, '\0', sizeof(s_sess_stat));
|
memset(stat, '\0', sizeof(s_sess_stat));
|
||||||
|
|
||||||
fscanf(fp, "%u %u %u %u %u %u %lu %lu %lu %lu",
|
res = fscanf(fp, "%u %u %u %u %u %u %lu %lu %lu %lu",
|
||||||
(unsigned int *) &stat->tries,
|
(unsigned int *) &stat->tries,
|
||||||
(unsigned int *) &stat->tries_noconn,
|
(unsigned int *) &stat->tries_noconn,
|
||||||
(unsigned int *) &stat->tries_noansw,
|
(unsigned int *) &stat->tries_noansw,
|
||||||
@ -86,7 +88,10 @@ static int session_stat_read_stsfile(FILE *fp, s_sess_stat *stat)
|
|||||||
(unsigned long *) &stat->hold_freqs,
|
(unsigned long *) &stat->hold_freqs,
|
||||||
(unsigned long *) &stat->last_success_out,
|
(unsigned long *) &stat->last_success_out,
|
||||||
(unsigned long *) &stat->last_success_in);
|
(unsigned long *) &stat->last_success_in);
|
||||||
|
if (res == 0) {
|
||||||
|
log("Read STS unsuccessfull...");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
/* Set last successfull session time */
|
/* Set last successfull session time */
|
||||||
stat->last_success = MAX(stat->last_success_out, stat->last_success_in);
|
stat->last_success = MAX(stat->last_success_out, stat->last_success_in);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user