Compare commits
15
Commits
88900cd0da
..
0.26
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fb8e32a9b | ||
|
|
235a6a3072 | ||
|
|
4da486264b | ||
|
|
25cfb143dc | ||
|
|
4e86852c41 | ||
|
|
324b11aad7 | ||
|
|
7fd0d85557 | ||
|
|
0cb9a2b2cf | ||
|
|
9bc3a14dd0 | ||
|
|
a1c93b8016 | ||
|
|
34daba8a0e | ||
|
|
51034e6e59 | ||
|
|
b3f2e1bfc6 | ||
|
|
de81a82f43 | ||
|
|
721fa8fdf1 |
@@ -268,10 +268,8 @@ Alexey Khromov (zx@zxalexis.ru)
|
|||||||
+ Added systemd and xinetd service files to contrib folder
|
+ Added systemd and xinetd service files to contrib folder
|
||||||
+ Fixed flag files creation
|
+ Fixed flag files creation
|
||||||
+ Added flags for TIC files (inctic_flag) and files (incfile_flag)
|
+ Added flags for TIC files (inctic_flag) and files (incfile_flag)
|
||||||
+ Fixed nodelist index creation for root nodes
|
+ Fixed nodelist index creation
|
||||||
+ Added support for TCP port description in IBN/IFC/ITN flags
|
+ Added support for TCP port description in IBN/IFC/ITN flags
|
||||||
|
|
||||||
0.26
|
0.26
|
||||||
+ Added option binkp_waitaka - wait on caller AKA on incoming sessions
|
+ Fixed incorrect binkp protocol realization in unprotected sessions.
|
||||||
and switch self AKA with the hideAKA config
|
|
||||||
+ Initial nodelist change detection for daemon mode
|
|
||||||
|
|||||||
+4
-5
@@ -1,20 +1,19 @@
|
|||||||
pkgname=bforce
|
pkgname=bforce
|
||||||
_gitname=binkleyforce
|
pkgver=r235.a1c93b8
|
||||||
pkgver=r197.ad1776c
|
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="binkleyforce FTN mailer"
|
pkgdesc="binkleyforce FTN mailer"
|
||||||
arch=('i686' 'x86_64' 'aarch64')
|
arch=('i686' 'x86_64' 'aarch64')
|
||||||
url="http://binkleyforce.sourceforge.net/"
|
url="https://prj.zxalexis.ru/gitea/zx/bforce/"
|
||||||
license=('GPL2')
|
license=('GPL2')
|
||||||
source=(
|
source=(
|
||||||
"${pkgname}::git+https://github.com/zotrix/binkleyforce.git"
|
"${pkgname}::git+https://prj.zxalexis.ru/gitea/zx/bforce.git"
|
||||||
)
|
)
|
||||||
makedepends=('git' 'gcc' 'make' 'glibc')
|
makedepends=('git' 'gcc' 'make' 'glibc')
|
||||||
provides=('bforce')
|
provides=('bforce')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${pkgname}/source"
|
cd "${srcdir}/${pkgname}/source"
|
||||||
./configure --prefix=/
|
./configure --prefix=/ --disable-syslog --with-owner=fido --with-group=uucp
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
# These files are considered legacy and are unnecessary on legacy-free
|
# These files are considered legacy and are unnecessary on legacy-free
|
||||||
# systems.
|
# systems.
|
||||||
|
|
||||||
d /run/lock 0777 root lock -
|
z /run/lock 0777 root lock -
|
||||||
L /var/lock - - - - ../run/lock
|
z /var/lock 0777 root lock - ../run/lock
|
||||||
|
|
||||||
# /run/lock/subsys is used for serializing SysV service execution, and
|
# /run/lock/subsys is used for serializing SysV service execution, and
|
||||||
# hence without use on SysV-less systems.
|
# hence without use on SysV-less systems.
|
||||||
|
|
||||||
d /run/lock/subsys 0775 root lock -
|
z /run/lock/subsys 0775 root lock -
|
||||||
|
|||||||
@@ -0,0 +1,138 @@
|
|||||||
|
2006-10-27 Evgeniy Kozhuhovskiy <ugenk@mgts.by>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): some fixes
|
||||||
|
|
||||||
|
2006-02-05 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/logger.c: trying to fix broken syslog.
|
||||||
|
|
||||||
|
2006-01-04 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/daemon_call.c (daemon_call_branch): if phone ==
|
||||||
|
00-00-000000, we call via ip
|
||||||
|
|
||||||
|
2005-10-24 Evgeniy Kozhuhovskiy <ugenk@mgts.by>
|
||||||
|
|
||||||
|
* bforce/sess_call.c (call_system): added possibility to run
|
||||||
|
external script for each line in override
|
||||||
|
|
||||||
|
2005-09-03 Andrey Slusar <anray@users.sourceforge.net>
|
||||||
|
|
||||||
|
* bforce/prot_emsi_misc.c (emsi_parsedat): correct time_t arg
|
||||||
|
size.
|
||||||
|
|
||||||
|
* bforce/prot_zmrecv.c (zmodem_proc_ZFILE): correct time_t arg
|
||||||
|
size.
|
||||||
|
|
||||||
|
2005-09-03 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/prot_hydra.c: added patch to fix problems while sending
|
||||||
|
files from ?lo on hydra, by anray
|
||||||
|
|
||||||
|
2005-06-23 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/prot_emsi.c (sm_rx_waitseq): reviewed code for buggy-emsi option
|
||||||
|
|
||||||
|
* configure.in: added --disable-buggy-emsi option for stupid mailers
|
||||||
|
|
||||||
|
2005-06-05 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* configure.in: added logdir and spooldir to ./configure
|
||||||
|
(thnx to max boyarov)
|
||||||
|
|
||||||
|
2005-06-03 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* configure.in: fixed warnings under *bsd (removed sys/mount.h
|
||||||
|
from the list of checking headers)
|
||||||
|
* configure.in: syslog disabled by default
|
||||||
|
|
||||||
|
2005-05-08 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bfutil/nlookup.c (print_nodeinfo): added "Type" entry to the
|
||||||
|
nlookup output
|
||||||
|
|
||||||
|
2005-05-08 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* configure.in: Some changes
|
||||||
|
* configure.in: Now default prefix is /usr/local/fido (as in fidogate)
|
||||||
|
|
||||||
|
2005-03-26 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): fixed compilation with gcc-2.95
|
||||||
|
|
||||||
|
2005-03-22 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* INSTALL.ru: added some information
|
||||||
|
|
||||||
|
2005-02-21 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/sess_answ.c (answ_system): fixed deiniting of tcpip port
|
||||||
|
|
||||||
|
2005-02-20 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/sess_answ.c (answ_system): fixed bug with loggin inbound
|
||||||
|
tcpip sessions
|
||||||
|
|
||||||
|
* bforce/logger.c (log_getfilename): fixed possible bug
|
||||||
|
|
||||||
|
2005-02-17 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* configure.in: fixed --with-owner and --with-group
|
||||||
|
|
||||||
|
2005-02-16 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/prot_emsi.c (sm_rx_waitseq): fixed unexpected emsi
|
||||||
|
sequence
|
||||||
|
|
||||||
|
2005-02-13 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/sess_call.c (call_system_quiet): added run_before_session
|
||||||
|
|
||||||
|
2005-02-12 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* outman: added bso support
|
||||||
|
|
||||||
|
2005-02-10 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce.conf: added nodelist mask examples
|
||||||
|
|
||||||
|
2005-02-09 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): fixed stupid memory leak.
|
||||||
|
|
||||||
|
2005-01-16 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): fixed mask detection
|
||||||
|
* bforce/nodelist.c (nodelist_open): added tmpseekdir, contains
|
||||||
|
full path to currently seeked nodelist
|
||||||
|
|
||||||
|
2005-01-12 Andrey Slusar <anray@users.sourceforge.net>
|
||||||
|
|
||||||
|
* Makefile.in (installdirs): fix compiling when use a bsd
|
||||||
|
chown.
|
||||||
|
|
||||||
|
* Makefile.in (bforce/expression.c): fix compiling when use
|
||||||
|
a bsd make.
|
||||||
|
|
||||||
|
2005-01-12 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): rewritten logic
|
||||||
|
|
||||||
|
* bforce/logger.c (log): fixed working with --enable-syslog
|
||||||
|
|
||||||
|
* include/logger.h: fixed some warnings
|
||||||
|
|
||||||
|
2005-01-11 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): fixed warnings
|
||||||
|
|
||||||
|
2005-01-11 Andrey Slusar <anray@users.sourceforge.net>
|
||||||
|
|
||||||
|
* Makefile.in (CFLAGS): added -fno-builtin.
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_checkheader): small fixes.
|
||||||
|
|
||||||
|
2005-01-10 Evgeniy Kozhuhovskiy <e.kozhuhovskiy@generation-p.com>
|
||||||
|
|
||||||
|
* bforce/nodelist.c (nodelist_open): added mask detection.
|
||||||
|
|
||||||
@@ -67,7 +67,6 @@ s_conf_entry bforce_config[BFORCE_NUMBER_OF_KEYWORDS+1] = {
|
|||||||
CONF_KEY(address, CT_ADDRESS),
|
CONF_KEY(address, CT_ADDRESS),
|
||||||
CONF_KEY(amiga_outbound_directory, CT_PATH),
|
CONF_KEY(amiga_outbound_directory, CT_PATH),
|
||||||
CONF_KEY(binkp_timeout, CT_NUMBER),
|
CONF_KEY(binkp_timeout, CT_NUMBER),
|
||||||
CONF_KEY(binkp_waitaka, CT_BOOLEAN),
|
|
||||||
CONF_KEY(daemon_circle, CT_NUMBER),
|
CONF_KEY(daemon_circle, CT_NUMBER),
|
||||||
CONF_KEY(daemon_circle_crash, CT_NUMBER),
|
CONF_KEY(daemon_circle_crash, CT_NUMBER),
|
||||||
CONF_KEY(daemon_circle_direct, CT_NUMBER),
|
CONF_KEY(daemon_circle_direct, CT_NUMBER),
|
||||||
|
|||||||
+1
-29
@@ -112,7 +112,6 @@ static RETSIGTYPE daemon_sighandler(int signum)
|
|||||||
|
|
||||||
static int daemon_sysentry_init(s_sysentry *sysent)
|
static int daemon_sysentry_init(s_sysentry *sysent)
|
||||||
{
|
{
|
||||||
int res = -1;
|
|
||||||
s_override *p;
|
s_override *p;
|
||||||
char msg[64] = "";
|
char msg[64] = "";
|
||||||
char abuf[BF_MAXADDRSTR+1];
|
char abuf[BF_MAXADDRSTR+1];
|
||||||
@@ -121,12 +120,7 @@ static int daemon_sysentry_init(s_sysentry *sysent)
|
|||||||
(void)session_stat_get(&sysent->stat, &sysent->node.addr);
|
(void)session_stat_get(&sysent->stat, &sysent->node.addr);
|
||||||
|
|
||||||
/* Lookup node in nodelist */
|
/* Lookup node in nodelist */
|
||||||
res = nodelist_lookup(&sysent->node, sysent->node.addr);
|
(void)nodelist_lookup(&sysent->node, sysent->node.addr);
|
||||||
|
|
||||||
if (res == -1) {
|
|
||||||
log("QUEUE: nodelist error for %s", ftn_addrstr(abuf, sysent->node.addr));
|
|
||||||
log("QUEUE: try to re-read config!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set overrides */
|
/* Set overrides */
|
||||||
if( (p = conf_override(cf_override, sysent->node.addr)) )
|
if( (p = conf_override(cf_override, sysent->node.addr)) )
|
||||||
@@ -1040,28 +1034,6 @@ int daemon_run(const char *confname, const char *incname, bool quit)
|
|||||||
*/
|
*/
|
||||||
if( !timer_running(timer_rescan) || timer_expired(timer_rescan) )
|
if( !timer_running(timer_rescan) || timer_expired(timer_rescan) )
|
||||||
{
|
{
|
||||||
//Check the presence of nodelist index.
|
|
||||||
s_faddr locaddr;
|
|
||||||
char * wcard;
|
|
||||||
s_node * mynode;
|
|
||||||
wcard = xstrcpy('\0');
|
|
||||||
DEB((D_DAEMON,"daemon: chk nodelist"));
|
|
||||||
if (!ftn_addrparse(&locaddr, conf_string(cf_address), wcard) )
|
|
||||||
{
|
|
||||||
//Check the presence of nodelist index.
|
|
||||||
if (!nodelist_lookup(mynode, locaddr)) {
|
|
||||||
// All OK
|
|
||||||
DEB((D_DAEMON,"daemon: chk nodelist OK"));
|
|
||||||
} else {
|
|
||||||
// All NOT OK
|
|
||||||
DEB((D_DAEMON,"daemon: chk nodelist FAILED"));
|
|
||||||
dmstate = DM_Restart;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// End checkpresense
|
|
||||||
(void)daemon_rescan_sysqueue(&daemon_sys_queue,
|
(void)daemon_rescan_sysqueue(&daemon_sys_queue,
|
||||||
daemon_queues);
|
daemon_queues);
|
||||||
timer_set(&timer_rescan, circle_rescan);
|
timer_set(&timer_rescan, circle_rescan);
|
||||||
|
|||||||
@@ -572,7 +572,7 @@ int nodelist_close(s_nodelist *nlp)
|
|||||||
logerr("cannot close nodelist index \"%s\"", nlp->name_index);
|
logerr("cannot close nodelist index \"%s\"", nlp->name_index);
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
memset(nlp,'\0',sizeof(s_nodelist));
|
|
||||||
free(nlp);
|
free(nlp);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
+43
-48
@@ -95,12 +95,12 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
bstate->emptyloop = 0;
|
bstate->emptyloop = 0;
|
||||||
bstate->continuesend = false;
|
bstate->continuesend = false;
|
||||||
|
|
||||||
unsigned short read_pos=0;
|
uint16_t read_pos=0;
|
||||||
unsigned short read_blklen=0;
|
uint16_t read_blklen=0;
|
||||||
unsigned short want_read=BINKP_HEADER;
|
uint16_t want_read=BINKP_HEADER;
|
||||||
|
|
||||||
unsigned short write_pos=0;
|
uint16_t write_pos=0;
|
||||||
unsigned short have_to_write=0;
|
uint16_t have_to_write=0;
|
||||||
|
|
||||||
int n, m;
|
int n, m;
|
||||||
bool no_more_to_send = false;
|
bool no_more_to_send = false;
|
||||||
@@ -140,6 +140,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
return PRC_ERROR;
|
return PRC_ERROR;
|
||||||
}
|
}
|
||||||
writebuf[1] = block_length&0xff;
|
writebuf[1] = block_length&0xff;
|
||||||
|
// TODO: FIX unprotected mode
|
||||||
if (bstate->mode==bmode_transfer && bstate->remote_data->options&BINKP_OPT_CRYPT)
|
if (bstate->mode==bmode_transfer && bstate->remote_data->options&BINKP_OPT_CRYPT)
|
||||||
encrypt_buf(writebuf, have_to_write, bstate->remote_data->keys_out);
|
encrypt_buf(writebuf, have_to_write, bstate->remote_data->keys_out);
|
||||||
}
|
}
|
||||||
@@ -209,15 +210,19 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
log("read: remote socket shutdown");
|
log("read: remote socket shutdown");
|
||||||
return PRC_REMOTEABORTED;
|
return PRC_REMOTEABORTED;
|
||||||
}
|
}
|
||||||
if (bstate->mode==bmode_transfer && bstate->remote_data->options & BINKP_OPT_CRYPT)
|
// TODO: FIX unprotected mode
|
||||||
|
if (bstate->mode==bmode_transfer && bstate->remote_data->options & BINKP_OPT_CRYPT) {
|
||||||
decrypt_buf(readbuf+read_pos, n, bstate->remote_data->keys_in);
|
decrypt_buf(readbuf+read_pos, n, bstate->remote_data->keys_in);
|
||||||
|
} else {
|
||||||
|
DEB((D_24554,"binkp: not encripted transfer"));
|
||||||
|
};
|
||||||
DEB((D_24554, "got %d bytes", n));
|
DEB((D_24554, "got %d bytes", n));
|
||||||
want_read -= n;
|
want_read -= n;
|
||||||
read_pos += n;
|
read_pos += n;
|
||||||
if (read_pos == BINKP_HEADER) {
|
if (read_pos == BINKP_HEADER) {
|
||||||
// have read header, want read body
|
// have read header, want read body
|
||||||
DEB((D_24554, "it should be 0: %d", want_read));
|
DEB((D_24554, "it should be 0: %d", want_read));
|
||||||
want_read = ((unsigned short)(readbuf[0]&0x7F)<<8) | readbuf[1];
|
want_read = ((uint16_t)(readbuf[0]&0x7F)<<8) | (uint16_t)readbuf[1];
|
||||||
DEB((D_24554, "got block header, block length %u", want_read));
|
DEB((D_24554, "got block header, block length %u", want_read));
|
||||||
} // no else here: if want_read may be zero here for zero length block
|
} // no else here: if want_read may be zero here for zero length block
|
||||||
}
|
}
|
||||||
@@ -228,6 +233,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
block_length = read_pos - BINKP_HEADER;
|
block_length = read_pos - BINKP_HEADER;
|
||||||
DEB((D_24554, "binkp: complete block is received %d %hu", block_type, block_length));
|
DEB((D_24554, "binkp: complete block is received %d %hu", block_type, block_length));
|
||||||
m = binkp_doreceiveblock(bstate, readbuf+BINKP_HEADER, block_type, block_length);
|
m = binkp_doreceiveblock(bstate, readbuf+BINKP_HEADER, block_type, block_length);
|
||||||
|
DEB((D_24554, "binkp: dorecieveblock result is %d", m));
|
||||||
if(m==1) {
|
if(m==1) {
|
||||||
DEB((D_24554, "block is successfully accepted"));
|
DEB((D_24554, "block is successfully accepted"));
|
||||||
read_pos = 0;
|
read_pos = 0;
|
||||||
@@ -339,8 +345,6 @@ int binkp_transfer(s_binkp_sysinfo *local_data, s_binkp_sysinfo *remote_data, s_
|
|||||||
int binkp_getforsend(s_binkp_state *bstate, char *buf, int *block_type, unsigned short *block_length)
|
int binkp_getforsend(s_binkp_state *bstate, char *buf, int *block_type, unsigned short *block_length)
|
||||||
{
|
{
|
||||||
int my_sf, wr_pos;
|
int my_sf, wr_pos;
|
||||||
s_faddr *bestaddr;
|
|
||||||
|
|
||||||
int n; // read file
|
int n; // read file
|
||||||
if (bstate->extracmd[0]!=(char)-1) {
|
if (bstate->extracmd[0]!=(char)-1) {
|
||||||
DEB((D_24554, "Send cmd to remote %d %s", bstate->extracmd[0], bstate->extracmd+1));
|
DEB((D_24554, "Send cmd to remote %d %s", bstate->extracmd[0], bstate->extracmd+1));
|
||||||
@@ -421,6 +425,7 @@ case 7:
|
|||||||
// seems not to remove files from inbound until successful session end is enough to eliminate dupes
|
// seems not to remove files from inbound until successful session end is enough to eliminate dupes
|
||||||
// if (!nodelist_checkflag (state.node.flags, "ND"))
|
// if (!nodelist_checkflag (state.node.flags, "ND"))
|
||||||
// strcat(buf+1, " ND");
|
// strcat(buf+1, " ND");
|
||||||
|
// TODO: add GZ BZ2 and maybe EXTCMD
|
||||||
*block_length = 1 + strlen(buf+1);
|
*block_length = 1 + strlen(buf+1);
|
||||||
DEB((D_24554, "send M_NUL %s", buf+1));
|
DEB((D_24554, "send M_NUL %s", buf+1));
|
||||||
return 1;
|
return 1;
|
||||||
@@ -436,40 +441,10 @@ case 7:
|
|||||||
// p
|
// p
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
DEB((D_24554, "WaitAKA: phase 2, mode=%d, waitaka %d, address_est %d",bstate->mode, cf_binkp_waitaka, bstate->address_established));
|
DEB((D_24554, "send address"));
|
||||||
if ( (bstate->mode==bmode_incoming_handshake) && (conf_boolean(cf_binkp_waitaka)) && (!(bstate->address_established)) )
|
|
||||||
{
|
|
||||||
DEB((D_24554, "send address paused - waitaka option present"));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
DEB((D_24554, "Send address - begin"));
|
|
||||||
bstate->phase += 1;
|
bstate->phase += 1;
|
||||||
buf[0] = BPMSG_ADR;
|
buf[0] = BPMSG_ADR;
|
||||||
wr_pos = 1;
|
wr_pos = 1;
|
||||||
if (conf_boolean(cf_binkp_waitaka))
|
|
||||||
{
|
|
||||||
// Sending bestAKA:
|
|
||||||
DEB((D_24554, "Binkp - getting best aka - waitaka option present"));
|
|
||||||
bestaddr = session_get_bestaka(state.remoteaddrs[0].addr);
|
|
||||||
if (bestaddr->point) {
|
|
||||||
wr_pos += sprintf(buf+wr_pos, "%d:%d/%d.%d@%s",
|
|
||||||
bestaddr->zone, bestaddr->net,
|
|
||||||
bestaddr->node, bestaddr->point,
|
|
||||||
bestaddr->domain);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
wr_pos += sprintf(buf+wr_pos, "%d:%d/%d@%s",
|
|
||||||
bestaddr->zone, bestaddr->net,
|
|
||||||
bestaddr->node,
|
|
||||||
bestaddr->domain);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Sending all adresses:
|
|
||||||
int i;
|
int i;
|
||||||
for( i = 0; i < state.n_localaddr; i++ )
|
for( i = 0; i < state.n_localaddr; i++ )
|
||||||
{
|
{
|
||||||
@@ -487,12 +462,10 @@ case 2:
|
|||||||
state.localaddrs[i].addr.domain);
|
state.localaddrs[i].addr.domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
*block_type = BINKP_BLK_CMD;
|
*block_type = BINKP_BLK_CMD;
|
||||||
*block_length = wr_pos;
|
*block_length = wr_pos;
|
||||||
DEB((D_24554, "send address: %s", buf+1));
|
DEB((D_24554, "send address: %s", buf+1));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
case 3: // send password on outgoing or pw confirmation on incoming
|
case 3: // send password on outgoing or pw confirmation on incoming
|
||||||
// special empty password is sent if there is no password for the remote addr
|
// special empty password is sent if there is no password for the remote addr
|
||||||
@@ -550,28 +523,47 @@ case 3: // send password on outgoing or pw confirmation on incoming
|
|||||||
|
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
if (bstate->mode==bmode_incoming_handshake) {
|
|
||||||
int i = 0;
|
|
||||||
DEB((D_24554, "incoming handshake is complete"));
|
|
||||||
bstate->complete = true;
|
|
||||||
char *p;
|
char *p;
|
||||||
char pbuf[32];
|
char pbuf[32];
|
||||||
|
int pwset = 0;
|
||||||
|
|
||||||
|
if (bstate->mode==bmode_incoming_handshake) {
|
||||||
|
DEB((D_24554, "incoming handshake is complete"));
|
||||||
|
bstate->complete = true;
|
||||||
|
|
||||||
for (i=0;i<state.n_remoteaddr;i++)
|
for (i=0;i<state.n_remoteaddr;i++)
|
||||||
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
||||||
|
pwset = 1;
|
||||||
init_keys(bstate->remote_data->keys_in, pbuf?pbuf:"-");
|
init_keys(bstate->remote_data->keys_in, pbuf?pbuf:"-");
|
||||||
init_keys(bstate->remote_data->keys_out, "-");
|
init_keys(bstate->remote_data->keys_out, "-");
|
||||||
for (p=pbuf?pbuf:"-"; *p; p++)
|
for (p=pbuf?pbuf:"-"; *p; p++)
|
||||||
update_keys(bstate->remote_data->keys_out, (int)*p);
|
update_keys(bstate->remote_data->keys_out, (int)*p);
|
||||||
}
|
}
|
||||||
|
//TODO: FIX incoming options
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
//TODO: Fix outgoing options
|
||||||
DEB((D_24554, "outgoing handshake: everything is sent"));
|
DEB((D_24554, "outgoing handshake: everything is sent"));
|
||||||
|
for (i=0;i<state.n_remoteaddr;i++)
|
||||||
|
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
||||||
|
pwset = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// We have password-protected link. Remote options are already set,
|
||||||
|
// Now we determine how to CRYPT or not to CRYPT our file transfer
|
||||||
|
// Our CRYPT flag is always sent, so if the other side have CRYPT
|
||||||
|
// and link is password is set - The CRYPT must be
|
||||||
|
// Literally: if we have no pass -> drop the CRYPT flag
|
||||||
|
if ( !pwset ) {
|
||||||
|
DEB((D_24554, "binkp handshake: password NOT set, dropping CRYPT"));
|
||||||
|
bstate->remote_data->options &= !BINKP_OPT_CRYPT;
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (bstate->mode == bmode_transfer) {
|
else if (bstate->mode == bmode_transfer) {
|
||||||
|
|
||||||
switch (bstate->phase) {
|
switch (bstate->phase) {
|
||||||
send_next_file:
|
send_next_file:
|
||||||
@@ -686,7 +678,10 @@ bstate->extracmd[0] = BPMSG_ERR; strcpy(bstate->extracmd+1, msg); bstate->extrai
|
|||||||
|
|
||||||
int binkp_doreceiveblock(s_binkp_state *bstate, char *buf, int block_type, unsigned short block_length)
|
int binkp_doreceiveblock(s_binkp_state *bstate, char *buf, int block_type, unsigned short block_length)
|
||||||
{
|
{
|
||||||
|
DEB((D_24554, "dorecieveblock_type: %d", block_type));
|
||||||
|
DEB((D_24554, "dorecieveblock_bytes: %x %x %x %x", buf[0], buf[1], buf[2], buf[3]));
|
||||||
switch (block_type) {
|
switch (block_type) {
|
||||||
|
|
||||||
case BINKP_BLK_CMD:
|
case BINKP_BLK_CMD:
|
||||||
if (block_length<1) {
|
if (block_length<1) {
|
||||||
PROTO_ERROR("Zero length command received")
|
PROTO_ERROR("Zero length command received")
|
||||||
@@ -1181,7 +1176,7 @@ void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
strnxcpy(remote_data->opt, buffer+4, sizeof(remote_data->opt));
|
strnxcpy(remote_data->opt, buffer+4, sizeof(remote_data->opt));
|
||||||
|
DEB((D_24554,"Process OPT"));
|
||||||
binkp_parse_options(remote_data, buffer+4);
|
binkp_parse_options(remote_data, buffer+4);
|
||||||
}
|
}
|
||||||
else if( strncmp(buffer, "VER ", 4) == 0 )
|
else if( strncmp(buffer, "VER ", 4) == 0 )
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void binkp_set_sysinfo(s_binkp_sysinfo *binkp, s_faddr *remote_addr, bool caller
|
|||||||
void binkp_parse_options(s_binkp_sysinfo *binkp, char *options)
|
void binkp_parse_options(s_binkp_sysinfo *binkp, char *options)
|
||||||
{
|
{
|
||||||
char *p, *n;
|
char *p, *n;
|
||||||
|
DEB((D_24554,"binkp: parse_options: %s", options));
|
||||||
for( p = string_token(options, &n, NULL, 0); p;
|
for( p = string_token(options, &n, NULL, 0); p;
|
||||||
p = string_token(NULL, &n, NULL, 0) )
|
p = string_token(NULL, &n, NULL, 0) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ int call_system_tcpip(int callwith) // only TCPIP values
|
|||||||
char abuf[BF_MAXADDRSTR+1];
|
char abuf[BF_MAXADDRSTR+1];
|
||||||
int rc = BFERR_NOERROR;
|
int rc = BFERR_NOERROR;
|
||||||
char * pbuf;
|
char * pbuf;
|
||||||
char * target;
|
char * target = 0;
|
||||||
int resflg;
|
int resflg;
|
||||||
/*
|
/*
|
||||||
* Set verbal line name to "tcpip" value
|
* Set verbal line name to "tcpip" value
|
||||||
@@ -542,6 +542,7 @@ defalt:
|
|||||||
{
|
{
|
||||||
target = strchr(p, ',');
|
target = strchr(p, ',');
|
||||||
if ( target ) target[0] = '\0';
|
if ( target ) target[0] = '\0';
|
||||||
|
target = 0;
|
||||||
target = strrchr(p, ':');
|
target = strrchr(p, ':');
|
||||||
if ( target ) {
|
if ( target ) {
|
||||||
target++;
|
target++;
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ typedef enum {
|
|||||||
cf_address,
|
cf_address,
|
||||||
cf_amiga_outbound_directory,
|
cf_amiga_outbound_directory,
|
||||||
cf_binkp_timeout,
|
cf_binkp_timeout,
|
||||||
cf_binkp_waitaka,
|
|
||||||
cf_daemon_circle,
|
cf_daemon_circle,
|
||||||
cf_daemon_circle_crash,
|
cf_daemon_circle_crash,
|
||||||
cf_daemon_circle_direct,
|
cf_daemon_circle_direct,
|
||||||
|
|||||||
Reference in New Issue
Block a user