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
|
||||
|
||||
|
||||
Copyright (c) 1998-2000 Alexander Belkin, Moscow, Russia.
|
||||
(c) 2004-2007 Evgeniy Kozhuhovskiy 2:450/256, 2:450/267
|
||||
(c) 2005 Andrey Slusar
|
||||
(c) 2006-2016 Max N. Boyarov
|
||||
(c) 2007-2008 Sergey Babitch
|
||||
(c) 2011-2014 Sergey Dorofeev
|
||||
(c) 2014 Alexander Skovpen
|
||||
(c) 2024 Alexey Khromov
|
||||
Older Sources
|
||||
-------------
|
||||
https://github.com/zotrix/binkleyforce/
|
||||
https://sourceforge.net/projects/binkforce/
|
||||
|
||||
Copyright <br>
|
||||
> (c) 1998-2000 Alexander Belkin, Moscow, Russia.<br>
|
||||
> (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
|
||||
clean-am:
|
||||
rm -f ./Makefile
|
||||
rm -f ../debian/Makefile
|
||||
rm -f ./include/config.h
|
||||
rm -f ./config.log
|
||||
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 */
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -755,6 +755,7 @@ int daemon_pidfile(int cmd)
|
||||
pid_t hispid, mypid = getpid();
|
||||
FILE *pf;
|
||||
struct stat sb;
|
||||
int res;
|
||||
|
||||
if( !pidfile )
|
||||
return 0;
|
||||
@ -768,7 +769,12 @@ int daemon_pidfile(int cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fscanf(pf, "%d", &hispid);
|
||||
res = fscanf(pf, "%d", &hispid);
|
||||
if (res != 1) {
|
||||
log("daemon pidfile: not readable");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose(pf);
|
||||
|
||||
if( hispid ) {
|
||||
@ -807,7 +813,12 @@ int daemon_pidfile(int cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fscanf(pf, "%d", &hispid);
|
||||
res = fscanf(pf, "%d", &hispid);
|
||||
if (res != 1) {
|
||||
log("daemon pidfile: not readable");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose(pf);
|
||||
|
||||
if( !hispid || (hispid == mypid) ) {
|
||||
@ -831,7 +842,12 @@ int daemon_pidfile(int cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fscanf(pf, "%d", &hispid);
|
||||
res = fscanf(pf, "%d", &hispid);
|
||||
if (res != 1) {
|
||||
log("daemon pidfile: not readable");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fclose(pf);
|
||||
unlink(pidfile);
|
||||
|
||||
|
@ -311,6 +311,7 @@ int session_set_inbound(void)
|
||||
{
|
||||
struct stat st;
|
||||
char *p_inb;
|
||||
int res;
|
||||
|
||||
p_inb = conf_string(cf_inbound_directory);
|
||||
if( !p_inb ) {
|
||||
@ -342,7 +343,11 @@ int session_set_inbound(void)
|
||||
log("inbound: %s", buf);
|
||||
state.inbound = (char*)xstrcpy(buf);
|
||||
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
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
int res;
|
||||
|
||||
if( fseek(fp, 0, SEEK_SET) == -1 )
|
||||
return -1;
|
||||
|
||||
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_noconn,
|
||||
(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->last_success_out,
|
||||
(unsigned long *) &stat->last_success_in);
|
||||
|
||||
if (res == 0) {
|
||||
log("Read STS unsuccessfull...");
|
||||
return -1;
|
||||
}
|
||||
/* Set last successfull session time */
|
||||
stat->last_success = MAX(stat->last_success_out, stat->last_success_in);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user