added null install feature

This commit is contained in:
hsn 2004-11-29 17:17:01 +00:00
parent 7c2609d908
commit 5495b36ac7
4 changed files with 20 additions and 5 deletions

View File

@ -8,6 +8,8 @@
added BUGS and HISTORY sections to fspscan.1 manual page
Lamerpack: disable most of command line options in fspd and print
simpler help message.
server_install: zero length filename cancels upload in progress
this change is needed for upcoming fsplib.
version 2.8.1b21 - 1 Nov 2004
check for errors while copying files in fspd.

View File

@ -33,7 +33,7 @@ case $host_os in
* ) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING([if we are building lamer pack])
AC_ARG_ENABLE(lamerpack,[Build for lamers],AC_DEFINE(LAMERPACK,1,[Define if you want to build for lamer disbled ppl]) AC_MSG_RESULT(YES),AC_MSG_RESULT(NO))
AC_ARG_ENABLE(lamerpack,[Build for lamers],AC_DEFINE(LAMERPACK,1,[Define if you want to build for lamer disabled ppl]) AC_MSG_RESULT(YES),AC_MSG_RESULT(NO))
AC_MSG_CHECKING([if enable extra debug code])
AC_ARG_ENABLE(debug,[Enable client library debuging],AC_DEFINE(DEBUG,1,[Define if you want more debug messages]) AC_MSG_RESULT(YES),AC_MSG_RESULT(NO))
AC_PROG_RANLIB

View File

@ -1,8 +1,8 @@
FILE SERVICE PROTOCOL VERSION 2
FSP v2
Document version 0.13
Last updated 1 Nov 2004
Document version 0.14
Last updated 29 Nov 2004
Also known as
File Slurping Protocol,
@ -326,6 +326,11 @@ RDIRENT.HEADER types:
data: not used
xtra data: not used
To cancel upload in progress without installing any
file send CC_INSTALL command with zero length (only 00
terminator) filename. This removes temporary data
created by upload.
CC_DEL_FILE 0x45 - delete a file
request

View File

@ -891,14 +891,22 @@ const char *server_install (PPATH * pp, unsigned long inet_num,
if (dbug)
fprintf(stderr,"server_install: tname: %s, pp->fullp: %s\n",tname, pp->fullp);
/* zero length filename */
if( pp->f_len + pp->d_len == 0 )
{
if (dbug)
fprintf(stderr,"server_install: zero length name. aborting upload.\n");
unlink(tname);
return (NULLP);
}
if(fexist(pp->fullp) &&
( (di->protection & DIR_DEL) || acc[0]=='O' )
)
{
unlink(tname);
if(dbug)
fprintf(stderr,"File %s already exists, but there is no user is not directory owner and public can't delete files.\n",pp->fullp);
fprintf(stderr,"File %s already exists, but user is not directory owner and public can't delete files.\n",pp->fullp);
return("no permission for replacing that file. Not an owner.");
}