beta 18
This commit is contained in:
parent
f2feaf1ba6
commit
c43984e3cd
17
ChangeLog
17
ChangeLog
|
|
@ -1,4 +1,7 @@
|
||||||
Version NEXT
|
Version 2.8.1b18 - 24 Nov 24 2003
|
||||||
|
This is MINIMUM REQUIRED VERSION for applicatins which are using
|
||||||
|
javafsp library, only download machine atm. javafsp library will
|
||||||
|
be released shortly as separate package.
|
||||||
PROTOCOL updated. Made rules about breaking directory header on
|
PROTOCOL updated. Made rules about breaking directory header on
|
||||||
packet boundary more clear. Previous text was from fspd code comment
|
packet boundary more clear. Previous text was from fspd code comment
|
||||||
and was bad.
|
and was bad.
|
||||||
|
|
@ -10,19 +13,19 @@ Version NEXT
|
||||||
in PROTOCOL
|
in PROTOCOL
|
||||||
support for MIN_DELAY, MAX_DELAY and DEFAULT_DELAY in source
|
support for MIN_DELAY, MAX_DELAY and DEFAULT_DELAY in source
|
||||||
path parsing moved to separate file server/path.c
|
path parsing moved to separate file server/path.c
|
||||||
new test tool parsecheck
|
new test tool parsecheck for testing server path parser
|
||||||
reworked parse path: separate error messages for high bit chars,
|
reworked parse path: separate error messages for high bit chars,
|
||||||
control chars
|
control chars
|
||||||
do not segfault when parsing password protected files. Looks like
|
MAJOR BUGFIX: path with trailing / or starting / is now parsed correctly
|
||||||
nobody used password protected files for a long time. This means
|
|
||||||
that in future version of FSP I can change protocol definition
|
|
||||||
without worry about breaking anything
|
|
||||||
path with trailing / or starting / is now parsed correctly
|
|
||||||
pathes with dot after slash are now detected at parse level (side
|
pathes with dot after slash are now detected at parse level (side
|
||||||
effect of prev. fix)
|
effect of prev. fix)
|
||||||
tests moved from server/ into tests/ directory
|
tests moved from server/ into tests/ directory
|
||||||
removed special test case for root directory in path.c -> use more
|
removed special test case for root directory in path.c -> use more
|
||||||
general alg. instead. This fixed "/" dir.
|
general alg. instead. This fixed "/" dir.
|
||||||
|
parsecheck turned into test suite with hard coded test results
|
||||||
|
parsecheck added to 'make check'
|
||||||
|
support for multiple \n in filename - in future there will be
|
||||||
|
used for symlinks.
|
||||||
|
|
||||||
Version 2.8.1b17 -- 17 Nov 2003
|
Version 2.8.1b17 -- 17 Nov 2003
|
||||||
Allow filenames with spaces inside
|
Allow filenames with spaces inside
|
||||||
|
|
|
||||||
8
TODO
8
TODO
|
|
@ -13,8 +13,6 @@ password change command
|
||||||
TESTING NEEDED:
|
TESTING NEEDED:
|
||||||
Write a simple FSP protocol testing tool
|
Write a simple FSP protocol testing tool
|
||||||
Write a test suite using testing tool
|
Write a test suite using testing tool
|
||||||
test if ending slashes do not confuse directory engine
|
|
||||||
test for /../ root escapes
|
|
||||||
test for remote buffer overflows
|
test for remote buffer overflows
|
||||||
Test new command rename /when implemented/
|
Test new command rename /when implemented/
|
||||||
Test if >2GB files but <4GB works correctly with and without --disable-largefile
|
Test if >2GB files but <4GB works correctly with and without --disable-largefile
|
||||||
|
|
@ -89,9 +87,9 @@ separate manpage for 7 fsp (protocol definition) == write FSP RFC
|
||||||
libraries and support for FSP protocol
|
libraries and support for FSP protocol
|
||||||
======================================
|
======================================
|
||||||
|
|
||||||
|
DONE: FSP library for Java
|
||||||
new small,light fsplib for C.
|
new small,light fsplib for C.
|
||||||
FSP plugin do Netscape/MSIE
|
|
||||||
FSP library for Java
|
|
||||||
Transfer HTTP over fsp transport
|
|
||||||
FSP backend for APT
|
FSP backend for APT
|
||||||
|
FSP plugin do Netscape/MSIE
|
||||||
|
Transfer HTTP over fsp transport
|
||||||
FSP support to lftp,wget,curl
|
FSP support to lftp,wget,curl
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
const char *parse_path PROTO3(char *, fullp, unsigned int, len, PPATH *, pp)
|
const char *parse_path PROTO3(char *, fullp, unsigned int, len, PPATH *, pp)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
char *p;
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
if(len < 1) return("Path must have non-zero length");
|
if(len < 1) return("Path must have non-zero length");
|
||||||
|
|
@ -46,13 +47,19 @@ const char *parse_path PROTO3(char *, fullp, unsigned int, len, PPATH *, pp)
|
||||||
pp->d_len = 0;
|
pp->d_len = 0;
|
||||||
|
|
||||||
|
|
||||||
for(s = pp->fullp = pp->f_ptr = pp->d_ptr = fullp, state = 0; *s; s++)
|
for(
|
||||||
|
s = pp->fullp = pp->f_ptr = pp->d_ptr = fullp, state = 0;
|
||||||
|
*s;
|
||||||
|
s++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if(*s == '\n')
|
if(*s == '\n')
|
||||||
{
|
{
|
||||||
pp->passwd = s+1;
|
p=strrchr(pp->fullp,'\n');
|
||||||
|
pp->passwd = p+1;
|
||||||
|
*p = '\0';
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
if(dbug) fprintf(stderr,"parse_path: found password field %s\n", s+1);
|
if(dbug) fprintf(stderr,"parse_path: found password field %s\n", p+1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,4 @@ extra_DIST=mklargefile.py
|
||||||
|
|
||||||
cachecheck_SOURCES=../server/fifocache.c cachecheck.c
|
cachecheck_SOURCES=../server/fifocache.c cachecheck.c
|
||||||
parsecheck_SOURCES=parsecheck.c ../server/path.c
|
parsecheck_SOURCES=parsecheck.c ../server/path.c
|
||||||
|
TESTS=parsecheck
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,26 @@
|
||||||
#endif
|
#endif
|
||||||
#include "my-string.h"
|
#include "my-string.h"
|
||||||
|
|
||||||
int dbug=0;
|
int dbug=1;
|
||||||
|
|
||||||
const char *testcases[]={ "", ".","filename","/filename","//filename","//dirname/filename","//dirname//filename","dirname//dir3name//","filename\npasswd",
|
const char *testcases[]={
|
||||||
"file/.dir","directory.ext/filename.","/",
|
"", ".","/",
|
||||||
|
"filename","/filename","//filename",
|
||||||
|
"dirname/filename","//dirname/filename","//dirname//filename",
|
||||||
|
"dir1name/dir2name/","//dir1name//dir2name//",
|
||||||
|
"filename\npasswd","filename\nsymlink\npasswd",
|
||||||
|
"file/.dir","../updir","file/../dir",
|
||||||
NULL};
|
NULL};
|
||||||
|
PPATH testresults[]={
|
||||||
|
{".",".",1,".",1,NULL}, {NULL}, {".",".",1,".",1,NULL},
|
||||||
|
{"filename","filename",8,".",1,NULL} , {"filename","filename",8,".",1,NULL} , {"filename","filename",8,".",1,NULL},
|
||||||
|
{"dirname/filename","filename",8,"dirname",7,NULL} , {"dirname/filename","filename",8,"dirname",7,NULL} , {"dirname//filename","filename",8,"dirname",7,NULL},
|
||||||
|
{"dir1name/dir2name/",".",1,"dir1name/dir2name",17}, {"dir1name//dir2name//",".",1,"dir1name//dir2name",18},
|
||||||
|
{"filename","filename",8,".",1,"passwd"}, {"filename","filename",8,".",1,"passwd"},
|
||||||
|
{NULL},{NULL},{NULL},
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static void print_path(PPATH *pp)
|
static void print_path(PPATH *pp)
|
||||||
{
|
{
|
||||||
|
|
@ -29,8 +44,27 @@ static void print_path(PPATH *pp)
|
||||||
printf("passwd: %s",pp->passwd);
|
printf("passwd: %s",pp->passwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runtestcase(void)
|
/* returns: 0 okay, 1 different */
|
||||||
|
|
||||||
|
static int compareresults(PPATH *p1,PPATH *p2)
|
||||||
{
|
{
|
||||||
|
if(p1->fullp==NULL && p2->fullp==NULL) return 0;
|
||||||
|
if(p1->fullp==NULL || p2->fullp==NULL) return -1;
|
||||||
|
if(strcmp(p1->fullp,p2->fullp)) return -1;
|
||||||
|
if(p1->f_len!=p2->f_len) return -1;
|
||||||
|
if(strcmp(p1->f_ptr,p2->f_ptr)) return -1;
|
||||||
|
if(p1->d_len!=p2->d_len) return -1;
|
||||||
|
if(strncmp(p1->d_ptr,p2->d_ptr,p1->d_len)) return -1;
|
||||||
|
if(p1->passwd==NULL && p2->passwd==NULL)
|
||||||
|
return 0;
|
||||||
|
if(p1->passwd==NULL || p2->passwd==NULL) return -1;
|
||||||
|
if(strcmp(p1->passwd,p2->passwd)) return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int runtestcase(void)
|
||||||
|
{
|
||||||
|
int rc=0;
|
||||||
int i=0;
|
int i=0;
|
||||||
PPATH pp;
|
PPATH pp;
|
||||||
const char *err;
|
const char *err;
|
||||||
|
|
@ -39,24 +73,33 @@ static void runtestcase(void)
|
||||||
for(;testcases[i];i++)
|
for(;testcases[i];i++)
|
||||||
{
|
{
|
||||||
test=strdup(testcases[i]);
|
test=strdup(testcases[i]);
|
||||||
|
pp.fullp=NULL;
|
||||||
err=parse_path(test,strlen(test)+1,&pp);
|
err=parse_path(test,strlen(test)+1,&pp);
|
||||||
printf("parsing: '%s'",test);
|
printf("parsing: '%s'",test);
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
printf(" err: %s\n",err);
|
printf(" parse err: '%s'. ",err);
|
||||||
free(test);
|
pp.fullp=NULL;
|
||||||
continue;
|
|
||||||
} else
|
} else
|
||||||
printf(" okay.\n");
|
printf(" parsed okay. ");
|
||||||
printf(" ");
|
if(compareresults(&pp,&testresults[i]))
|
||||||
print_path(&pp);
|
{
|
||||||
printf("\n");
|
printf("!!!TEST FAILED!!!\a\n");
|
||||||
|
rc=1;
|
||||||
|
} else
|
||||||
|
printf(" Test passed.\n");
|
||||||
|
if(!err)
|
||||||
|
{
|
||||||
|
printf(" ");
|
||||||
|
print_path(&pp);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
free(test);
|
free(test);
|
||||||
}
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc,const char *argv[])
|
int main(int argc,const char *argv[])
|
||||||
{
|
{
|
||||||
runtestcase();
|
return runtestcase();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user