Binkp transmitter filename escape added
This commit is contained in:
parent
9e48540c59
commit
4d2e8e6da5
@ -11,6 +11,10 @@ v0.37.4 10-May-2003
|
|||||||
Added check for inconv.h in configure script for UNIX98
|
Added check for inconv.h in configure script for UNIX98
|
||||||
character set conversion.
|
character set conversion.
|
||||||
|
|
||||||
|
mbcico:
|
||||||
|
The binkp transmitter does now escape the unsafe filename
|
||||||
|
characters.
|
||||||
|
|
||||||
|
|
||||||
v0.37.3 09-Apr-2003 - 10-May-2003
|
v0.37.3 09-Apr-2003 - 10-May-2003
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Binkp protocol copyright : Dima Maloff.
|
* Binkp protocol copyright : Dima Maloff.
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2002
|
* Copyright (C) 1997-2003
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -55,6 +55,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Safe characters for binkp filenames, the rest will be escaped.
|
||||||
|
*/
|
||||||
#define BNKCHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@&=+%$-_.!()#|"
|
#define BNKCHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@&=+%$-_.!()#|"
|
||||||
|
|
||||||
|
|
||||||
@ -99,6 +102,20 @@ int transferred = FALSE;
|
|||||||
int batchnr = 0, crc_errors = 0;
|
int batchnr = 0, crc_errors = 0;
|
||||||
|
|
||||||
|
|
||||||
|
int resync(off_t);
|
||||||
|
char *unix2binkd(char *);
|
||||||
|
void binkp_send_data(char *, int);
|
||||||
|
void binkp_send_control(int,...);
|
||||||
|
int binkp_recv_frame(char *, int *, int *);
|
||||||
|
void binkp_settimer(int);
|
||||||
|
int binkp_expired(void);
|
||||||
|
void b_banner(int);
|
||||||
|
void b_nul(char *);
|
||||||
|
void fill_binkp_list(binkp_list **, file_list *, off_t);
|
||||||
|
void debug_binkp_list(binkp_list **);
|
||||||
|
int binkp_batch(file_list *, int);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int binkp(int role)
|
int binkp(int role)
|
||||||
{
|
{
|
||||||
@ -204,7 +221,7 @@ int resync(off_t off)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Translate filename to binkd filename
|
* Translate filename to binkd filename, unsafe characters are escaped.
|
||||||
*/
|
*/
|
||||||
char *unix2binkd(char *fn)
|
char *unix2binkd(char *fn)
|
||||||
{
|
{
|
||||||
@ -240,7 +257,6 @@ void binkp_send_data(char *buf, int len)
|
|||||||
{
|
{
|
||||||
unsigned short header = 0;
|
unsigned short header = 0;
|
||||||
|
|
||||||
Syslog('B', "send_data(%d)", len);
|
|
||||||
header = ((BINKP_DATA_BLOCK + len) & 0xffff);
|
header = ((BINKP_DATA_BLOCK + len) & 0xffff);
|
||||||
|
|
||||||
PUTCHAR((header >> 8) & 0x00ff);
|
PUTCHAR((header >> 8) & 0x00ff);
|
||||||
@ -339,7 +355,6 @@ void binkp_settimer(int interval)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int binkp_expired(void);
|
|
||||||
int binkp_expired(void)
|
int binkp_expired(void)
|
||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
@ -352,7 +367,6 @@ int binkp_expired(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void b_banner(int);
|
|
||||||
void b_banner(int originate)
|
void b_banner(int originate)
|
||||||
{
|
{
|
||||||
time_t t;
|
time_t t;
|
||||||
@ -372,7 +386,6 @@ void b_banner(int originate)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void b_nul(char *);
|
|
||||||
void b_nul(char *msg)
|
void b_nul(char *msg)
|
||||||
{
|
{
|
||||||
if (strncmp(msg, "SYS ", 4) == 0) {
|
if (strncmp(msg, "SYS ", 4) == 0) {
|
||||||
@ -804,7 +817,6 @@ SM_RETURN
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void fill_binkp_list(binkp_list **, file_list *, off_t);
|
|
||||||
void fill_binkp_list(binkp_list **bll, file_list *fal, off_t offs)
|
void fill_binkp_list(binkp_list **bll, file_list *fal, off_t offs)
|
||||||
{
|
{
|
||||||
binkp_list **tmpl;
|
binkp_list **tmpl;
|
||||||
@ -826,11 +838,10 @@ void fill_binkp_list(binkp_list **bll, file_list *fal, off_t offs)
|
|||||||
(*tmpl)->state = NoState;
|
(*tmpl)->state = NoState;
|
||||||
(*tmpl)->get = FALSE;
|
(*tmpl)->get = FALSE;
|
||||||
(*tmpl)->local = xstrcpy(fal->local);
|
(*tmpl)->local = xstrcpy(fal->local);
|
||||||
(*tmpl)->remote = xstrcpy(fal->remote);
|
(*tmpl)->remote = xstrcpy(unix2binkd(fal->remote));
|
||||||
(*tmpl)->offset = offs;
|
(*tmpl)->offset = offs;
|
||||||
(*tmpl)->size = tstat.st_size;
|
(*tmpl)->size = tstat.st_size;
|
||||||
(*tmpl)->date = tstat.st_mtime;
|
(*tmpl)->date = tstat.st_mtime;
|
||||||
Syslog('b', "fill_binkp_list %s => %s", fal->remote, unix2binkd(fal->remote));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -843,7 +854,7 @@ char *lbstat[]={(char *)"None",
|
|||||||
(char *)"Get"};
|
(char *)"Get"};
|
||||||
|
|
||||||
|
|
||||||
void debug_binkp_list(binkp_list **);
|
|
||||||
void debug_binkp_list(binkp_list **bll)
|
void debug_binkp_list(binkp_list **bll)
|
||||||
{
|
{
|
||||||
binkp_list *tmpl;
|
binkp_list *tmpl;
|
||||||
|
Reference in New Issue
Block a user