repo sync

This commit is contained in:
hsn 2004-12-17 09:52:20 +00:00
parent 7fe08f7019
commit 0d3a35dd94
28 changed files with 548 additions and 234 deletions

View File

@ -15,12 +15,10 @@ FSP Protocol wire changes:
with older software versions.
- security: symlink to FILE can escape from FSP root directory, this will
be fixed as part of symlink support.
- add FSP change password command (??)
- add FSP change password command (do we really need this ??)
Code fixups:
- fix Sven's compiling problems on various unixes
- normalize return error codes of all clients
- server can be run multiple times on the same port, how to check?
on freebsd this works okay. needs re-testing on linux.
- fspd: add special defence against rapid/double fire clients (burst command in fspclient)
* for next point Stable version 2.8.3

View File

@ -1,4 +1,4 @@
Version NEXT
Version 2.8.1b22 - 17 Dec 2004
fixed sf bug 1060594: fspd: owner can't rename files
fixed sf bug 1060558: fpro 'l' sets 'm' flag instead (dairiki)
fixed sf bug 1060558: fpro 'l' flag was not correctly saved
@ -24,6 +24,35 @@ Version NEXT
fput: use request position for sizing of extra (timestamp) data.
use new upload cancel feature on user abort/kill.
fspd: default inetd timeout increased to 5 minutes.
udpio: Do not set reuse flag when binding socket
nicer help from configure --help
!! configure option --disable-timeout for disabling timeout code
in client util. This will switch clients into classic FSP
infinite retry mode.
some shell portability fixes in configure.ac shell tests
cleaned outdated information from INSTALL file
fcdcmd: do not print password to standard output. really
support cd into password protected root directory
!! Protocol Wire definiton of rename command has changed
PROTOCOL: CC_RENAME updated
fmvcmd,fspd: now supports this new definition.
fmvcmd: do not sent bye packet to server on bad command line arguments
client locking subsystem: do not report errors on deleting shm segment
!! shmem+semop client-side locking method added. This should solve all
problems with shmem+lockf locks.
autogen.sh updated for FreeBSD-5 + automake 1.9
lamerguide: added section on upload area setup.
sgml faq: added inetd fspd install
sgml faq: client commands updated, added more fspd info
fspd: default dirlistcache increased to 100
fspd: default fp cache increased to 20 and moved into server_conf.h
fget/grab cmd: better -h help
fput: add help on -p option
fmv alias added to both setup.c?sh scripts
fspd: logging of RENAME command fixed
fspd.conf: logging of stat and rename added to comments.
FILES: file somewhat updated
sgml fsp faq released as version 0.1, first public version
Version 2.8.1b21 - 1 Nov 2004
check for errors while copying files in fspd.

33
FILES
View File

@ -7,15 +7,16 @@ Complete content of the FSP package:
INSTALL Installation instructions for FSP
PROTOCOL FSP protocol definition
MACHINES Where FSP compiles out of box
faq.html FSP FAQ
Makefile.in input file for building makefile from configure script.
Makefile.am file for generating Makefile.in
aclocal.m4 Automake macros
install-sh A shell script for installation.
setup CSH script for initializing FSP (Unix).
setup.csh CSH script for initializing FSP (Unix).
setup.sh SH script for initializing FSP (Unix).
config.status GNU autoconf that will be regenerated every time configure
is run. It is used to regenerate the same configuration as
before.
config.guess Guess your operation system for configuration
configure SH script generated by GNU autoconf from configure.in used
to test certain parameters of the operating system in order
to enable compilation with the minimum of human
@ -23,6 +24,12 @@ Complete content of the FSP package:
configure.ac Input script to autoconf used to generate configure.
fspd.conf An example fspd.conf file suitable for copying and editing.
doc/ Aditional FSP documentation
faq.html OLD FSP FAQ
HISTORY OLD FSP Changelog
PROTOCOL FSP v2 protocol definition
fsp-faq.sgml New SGML FSP FAQ
bsd_src/ Directory containing additional sources derived from
those in public archive on uunet.uu.net. Most sources
are modified to deal with FSP or some architectures.
@ -61,6 +68,10 @@ Complete content of the FSP package:
frmcmd.c
frmdircmd.c
fver.c
fstatcmd.c
fmvcmd.c
fspprof.l lex rules for generating fsp_prof parser
fprintpro.c display protections flags in human readable form
merge.c This file is used to call the other client programs
when program merging option is used. Rather than
compiling into individual client utility programs,
@ -73,6 +84,8 @@ Complete content of the FSP package:
common/ Directory containing code used in both server and clients
Makefile.in input file for building makefile from configure script.
strdup.c Unix strdup function.
random.c Unix random function.
getsl.c gets with length limit
udp_io.c Lowest level routines that deal with the unix inet
sockets. Some changes might be needed to get it
running with other network implementations.
@ -128,12 +141,26 @@ Complete content of the FSP package:
fspd.1
fver.1
fsp_prof.5
fsp_env.7
server/ Files needed to compile the FSPD server
Makefile Unix Makefile for compiling the server.
acl.c ACL loading, saving, testing
conf.c fspd configuration file reading routines.
fifocache.c Simple FIFO - style cache
file.c Server routines for file i/o.
filecache.c fp-caching routines.
host.c Server routines for maintaining client database.
lib.c Server routines for inet socket i/o.
info.c Generation of INFO block
iprange.c Range checks for IPv4
log.c Loging stuff
main.c Server main routine and dispatch loop.
path.c Path parser
pidfile.c Pidfile writing
random.c Next KEY generator
server.c FSP Packet serving
contrib/ User contributed files
rotate.py 90deg. rotation of input text
fspscan.c FSP site scanner
auto_del.csh Remove outdated files from FSP home

44
INSTALL
View File

@ -1,18 +1,18 @@
Compilation:
The first step in running this fine software (:) is to get it to
compile. Every effort on my part will be made to make this code
compile and run on any reasonable system. The information in this
file CURRENTLY pertains only to Unix and Cygwin users.
Configuration:
The first step is to run the configure script provided in this
directory. This will generate a good makefile and a file called
tweak.h in the include directory. These files are vital for the
config.h in the include directory. These files are vital for the
compilation of the system.
You must also edit the files include/client_conf.h and
include server_conf.h as they contain parameters which must
still at this point be manually set by the person compiling
the code.
configure can take several optional switches. Most important
switch is --disable-timeout. This option switches fsp clients
into classic infinite retry mode which is preferred by people
with very flaky networks.
>> By default, the configure script will set up the Makefile
>> to install the code in /usr/local/bin and the man pages under
@ -21,6 +21,7 @@ Compilation:
>> machine, I install the files under /usr/jt/bin and /usr/jt/man.
>> To do this, I type configure --prefix=/usr/jt
Compilation:
At this point, you should just be able to type 'make'
and then 'make install'. This will compile and (if
you do an install) install the clients in the directory specified
@ -72,20 +73,13 @@ Client utilities:
all data will be transferred.
Server Administration:
The only things you need for setting up a FSP server is a work
directory for the service the FSP server itself (fspd) and
an fspd.conf file in the place you specified in include/server_conf.h.
To create an fspd.conf file, copy the example.conf file
provided to the correct place and edit to suit your tastes.
fspd can run independently or it can be run under inetd. When
running independently, fspd waits for messages through a UDP
socket whoes port number is defined in the fspd.conf file.
When runing under inetd, fspd is invoked as in.fspd. Inetd will
spawn fspd when a message arrives for the FSP socket. The fspd
process will take over and stick around to wait on additional
messages. After 2 minutes pass with no messages, fspd will exit
messages. After 5 minutes pass with no messages, fspd will exit
and return control to inted.
Sample setup for inetd operation:
@ -96,7 +90,7 @@ Server Administration:
In /etc/inetd.conf file:
fsp dgram udp wait ftp /usr/etc/fspd in.fspd
fsp dgram udp wait ftp /usr/local/bin/fspd in.fspd
In this sample, the same port number for ftp is used for the
fsp socket. There will not be a conflict because ftp uses
@ -107,31 +101,11 @@ Server Administration:
the fspd.conf file. Please read the comments in the fspd.conf
file for details.
FSPD provides directory security through a series of . files created
in the directories serviced by fspd. These files are invisible to
the clients, and can (mostly) be changed via the fprocmd client
utility (or by the server administrator manually). The only file
that can not be changed in this manner is the ownership of a
directory. The files and their meanings are:
.OWN.XXXXXXXX specifies that the machine whose IP number is
encoded as XXXXXXXX owns the directory. The owner
of a directory automatically has all other rights to
a directory and is the only one that can change the
other protections. It is created when a directory
is initially created in the archive via fmkdir.
Information about all other directory security . files is
maintained in 'man 1 fspd'.
Clients do not get to read the directory information directly.
Instead, fspd maintains a directory listing for each directory
in a cache file. If the directory is writable by fspd, or if a
writable file in it is prepared beforehand, fspd will store the
directory information in .FSP_CONTENT file in that directory.
Otherwise, it will store the information in a pair of files (with
hashed names) in a special directory specified in the fspd.conf
file. The latter allows read-only directories to be exported.
When a client requests information for a directory, the cache
file is created if it doesn't exist, and it is rebuilt if it is

23
TODO
View File

@ -34,20 +34,22 @@ we should retune retry algoritm for better support lines with higher
add more detailed stats from retry alg.
:low:
fver and others add support new syntax fsp://host:port/file
add sem locking method, possible?
flscmd should not to do stat before directory listing.
directory listing should not need to get 0 sized block. Needs total code
rewrite.
better support for persistent keys - do not send cc_bye ? this should
be probably configurable
:long-term goals:
drop this library and use libfsp instead
LOCKING
better support for persistent keys - do not send cc_bye ? this should
be probably configurable
CLIENTS
:high:
normalize return error codes of all clients
write new clients for new commands - fpasswd finfo
:low:
add support for more sane fsplist file format (as used by warez
ppl) to fhostcmd
@ -59,10 +61,6 @@ clients do not freeing memory allocated from glob()
FUTURE FEATURES FOR SERVER:
:high: required for 2.8.2 final
can be run multiple times on the same port, how to check?
drop reuse flag from socket bind?
Currently looks fine with flag on bsd. Fails on lin-suck.
report number of clients connected, size of hostable in new command
CC_INFO command
special defence against rapid/double fire clients (burst command in fspclient)
@ -73,8 +71,6 @@ new LSTAT COMMAND
write FSP_CHANGE_PASSWORD command
improve RENAME FSP command
* cross directory renames are unsuported for now
* server can send error reply even to denied per directory clients
- minor security flaw
:low:this will sure go after 2.8.2:
hashed passwords. Do we really needs them?
@ -86,7 +82,8 @@ ipv6 socket support
privileged Hosts, excluded from Byte transfer Limit (hard to do)
new toy
FSP Proxy repeater - look at old code.
FSP Proxy repeater - take a look at old code, but we have NAT and fspproxy
today.
PERFORMANCE:
host hashtable shrinking sometimes
@ -96,8 +93,8 @@ background time() alarm() caller
Current performance 1925648B/s
MAN:
finish sgml FAQ
separate manpage for 7 fsp (protocol definition) == write FSP RFC
manual page for fmvcmd.1
libraries and support for FSP protocol
======================================
@ -109,8 +106,8 @@ FSP plugin for Netscape/MSIE.
Not possible to write protocol plugins with Netscape 3 SDK
we have fsproxy now.
FSP backend for APT
Transfer HTTP over fsp transport
FSP support to lftp,wget,curl,gftp
Experimental transfer HTTP over fsp transport
FSP support in major ftp programs: lftp,wget,curl,gftp
AVFS plugin http://sourceforge.net/projects/avf
LARGEFILES64 how to turn them on:

View File

@ -31,7 +31,10 @@ if [ `uname -s` = 'FreeBSD' ]; then
AUTOHEADER=autoheader259; export AUTOHEADER
AUTOCONF=autoconf259; export AUTOCONF
export LDFLAGS=-L/usr/local/lib
autoreconf259 -iv
$ACLOCAL -I /usr/local/share/aclocal
$AUTOMAKE -a
$AUTOCONF
#autoreconf259 -iv -I /usr/local/share/aclocal
else
echo "Using your default auto* tools"
#this should work with recent autotools

View File

@ -11,6 +11,7 @@
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#include <time.h>
#include "client_def.h"
#include "c_extern.h"
#include "my-string.h"
@ -233,7 +234,6 @@ void client_init_key (unsigned long server_addr,
perror("shmat");
exit(1);
}
*share_key = key;
}
void client_destroy_key(void)
@ -242,13 +242,8 @@ void client_destroy_key(void)
if (shmdt((char *)share_key) < 0)
{
perror("shmdt");
exit(1);
}
if (shmctl(lock_shm,IPC_RMID,NULL) < 0)
{
perror("shmctl");
exit(1);
}
shmctl(lock_shm,IPC_RMID,NULL);
unlink(key_string);
}
#endif
@ -283,5 +278,144 @@ void client_destroy_key(void)
}
#endif
/********************************************************************/
/******* For those systems that has SysV shared memory + semop ******/
/********************************************************************/
#ifdef USE_SHAREMEM_AND_SEMOP
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
int key_persists = 0;
static unsigned short *share_key;
static int lock_shm;
static int lock_sem;
unsigned short client_get_key (void)
{
struct sembuf sem;
sem.sem_num = 0;
sem.sem_op = -1;
sem.sem_flg = SEM_UNDO;
if(semop(lock_sem,&sem,1) == -1 )
{
perror("semop");
exit(1);
}
return(*share_key);
}
void client_set_key (unsigned short key)
{
struct sembuf sem;
sem.sem_num = 0;
sem.sem_op = 1;
sem.sem_flg = SEM_UNDO;
*share_key = key;
if(semop(lock_sem,&sem,1) == -1) {
perror("semop");
exit(1);
}
}
void client_init_key (unsigned long server_addr,
unsigned long server_port,
unsigned short key)
{
unsigned long omask;
key_t lock_key;
int fd;
union semun sun;
struct sembuf sem;
make_key_string(server_addr,server_port);
omask = umask(0);
fd = open(key_string,O_RDWR|O_CREAT,0666);
umask(omask);
close(fd);
if((lock_key = ftok(key_string,238)) == -1) {
perror("ftok");
exit(1);
}
if((lock_shm = shmget(lock_key,sizeof(short),IPC_CREAT|0666)) == -1) {
perror("shmget");
exit(1);
}
if(!(share_key = (unsigned short *) shmat(lock_shm,(char*)0,0))) {
perror("shmat");
exit(1);
}
if((lock_sem = semget(lock_key,0,0)) == -1) {
/* create a new semaphore and init it */
if((lock_sem = semget(lock_key,2,IPC_CREAT|0666)) == -1) {
perror("semget");
}
/* we need to init this semaphore */
sun.val=1;
if(semctl(lock_sem,0,SETVAL,sun) == -1)
{
perror("semctl setval");
exit(1);
}
*share_key = key;
}
/* increase in use counter */
sem.sem_num = 1;
sem.sem_op = 1;
sem.sem_flg = SEM_UNDO;
if(semop(lock_sem,&sem,1) == -1) {
perror("semop");
exit(1);
}
/*
fd=semctl(lock_sem,0,GETVAL);
printf("sem value: %d\n",fd);
fd=semctl(lock_sem,0,GETNCNT);
printf("sem ncnt: %d\n",fd);
*/
}
void client_destroy_key(void)
{
int rc;
if (shmdt((char *)share_key) < 0)
{
perror("shmdt");
exit(1);
}
/* check if we are only one process holding lock */
rc = semctl(lock_sem,1,GETVAL);
if (rc == -1)
{
perror("semctl");
exit(1);
}
if (rc == 1)
{
/*
printf("destroying shmem()+sem()\n");
*/
/* safe to destroy */
if (
(semctl(lock_sem,0,IPC_RMID) < 0) ||
(shmctl(lock_shm,IPC_RMID,NULL) < 0) ||
(unlink(key_string) < 0) )
rc++;/* ignore cleanup errors */
}
}
#endif
/********************************************************************/
/********************************************************************/
/********************************************************************/

View File

@ -21,7 +21,7 @@
#include "merge.h"
#include "printpro.h"
static int f_cd (const char * p)
static int f_cd (char * p)
{
UBUF *ub;
@ -32,6 +32,7 @@ static int f_cd (const char * p)
fprintf(stderr, "ERR: %s\n",ub->buf);
return(0);
} else {
util_junk_password(p);
fprintf(stderr, "directory %s\nmode: ",p);
print_pro(ub,stderr);
return(1);
@ -45,8 +46,9 @@ int main (int argc, char ** argv)
env_client();
if(argc == 1) {
f_cd("/");
puts("/");
np=util_abs_path("/");
f_cd(np);
puts(np);
} else {
if(!(av = glob(argv[1]))) {
av = av2;
@ -56,7 +58,6 @@ int main (int argc, char ** argv)
np = util_abs_path(*av);
if(f_cd(np))
{
util_junk_password(np);
puts(np);
}
else {

View File

@ -186,7 +186,15 @@ static void usage (void)
#else
printf("fgrabcmd");
#endif
printf(" -[<f|o>|u|t|n|<a|c>] -r -p -h -?\n");
printf(" [options] [filename] ...\n");
printf("Options:\n");
printf("-f,-o\toverwrite existing files\n");
printf("-u\tuse unique names\n");
printf("-t\tdownload into temporary file\n");
printf("-n\tnever overwrite existing files\n");
printf("-a,-c\tappend to files\n");
printf("-p\tpreserve timestamp of remote files\n");
printf("-r\trecursively get directories\n");
}
/* Parse options

View File

@ -37,15 +37,15 @@ static int append_to_buf(const char *what,size_t len)
static void rename_file (const char *fname,const char *target)
{
char *fpath;
unsigned int l;
UBUF *reply;
unsigned int srclen,dstlen;
/* reset buffer */
n=0;
/* append source file */
fpath = util_abs_path(fname);
l=strlen(fpath)+1;
if(append_to_buf(fpath,l))
srclen=strlen(fpath)+1;
if(append_to_buf(fpath,srclen))
{
printf("path too long: %s.\n",fpath);
free(fpath);
@ -54,8 +54,8 @@ static void rename_file (const char *fname,const char *target)
free(fpath);
/* add dest */
fpath=util_abs_path(target);
l=strlen(fpath)+1;
if(append_to_buf(fpath,l))
dstlen=strlen(fpath)+1;
if(append_to_buf(fpath,dstlen))
{
printf("path too long: %s.\n",fpath);
free(fpath);
@ -63,7 +63,7 @@ static void rename_file (const char *fname,const char *target)
}
/* send our nicely crafted junk to the server */
reply=client_interact (CC_RENAME,0,n,buf,0,NULL);
reply=client_interact (CC_RENAME,dstlen,srclen,buf,dstlen,buf+srclen);
if(reply->cmd==CC_ERR)
{
@ -93,7 +93,10 @@ int main (int argc, char ** argv)
}
}
else
{
fprintf(stderr,"%s source target\n", argv[0]);
exit(1);
}
client_done();

View File

@ -26,7 +26,8 @@ static int optletter;
static void usage (void)
{
printf("fput");
printf(" [-p | [ -h | -? ] ] file ...\n");
printf(" [-p | -h | -? ] file ...\n");
printf("-p\tPreserve file modification time\n");
}
static int put_file (char * path)

View File

@ -93,6 +93,8 @@ int main (int argc, char ** argv)
printf("LOCKF");
#elif defined(NOLOCKING)
printf("None");
#elif defined(USE_SHAREMEM_AND_SEMOP)
printf("SHAREMEM_AND_SEMOP");
#else
#error "We do not have any locking method defined!"
#endif

View File

@ -45,7 +45,10 @@ int _x_udp (const char * bindaddress, unsigned short * port)
if(f == -1) return(-1);
if(setsockopt(f,SOL_SOCKET,SO_REUSEADDR,(char *)&zz,sizeof(zz)) < 0 ||
if(
#ifdef REUSE_SOCKET
setsockopt(f,SOL_SOCKET,SO_REUSEADDR,(char *)&zz,sizeof(zz)) < 0 ||
#endif
bind(f,(struct sockaddr *) &me,len) < 0 ||
getsockname(f,(struct sockaddr *)&myadr,&len) < 0) {
SAVE_ERRNO(((void) close(f)));

View File

@ -33,9 +33,17 @@ 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 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_ARG_ENABLE(lamerpack,AS_HELP_STRING([--enable-lamerpack],[Build fspd tuned for lamers (default no)]),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 enabling of extra debug code is requested])
AC_ARG_ENABLE(debug,AS_HELP_STRING([--enable-debug],[Enable client library debuging output (default no)]),AC_DEFINE(DEBUG,1,[Define if you want more debug messages]) AC_MSG_RESULT(yes),AC_MSG_RESULT(no))
AC_MSG_CHECKING([If client commands can time out])
AC_ARG_ENABLE(timeout,AS_HELP_STRING([--disable-timeout],[Disable timeouts in client commands (default enabled)]),,enable_timeout=yes)
if test "x${enable_timeout}" = xyes; then
AC_DEFINE(CLIENT_TIMEOUT,1,[Define if you want client commands timeout])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_PROG_RANLIB
AM_PROG_LEX
AC_PROG_LN_S
@ -43,7 +51,7 @@ AC_PROG_CC
dnl If we're using gcc, enable some warnings
AC_CACHE_CHECK(for additional compiler options, ac_cv_prog_gcc_flags, [
ac_cv_prog_gcc_flags=""
if test "$GCC" = yes
if test "x$GCC" = xyes
then
echo "void dummy(void);" >configure-dummy.c
echo "void dummy(void) {}" >>configure-dummy.c
@ -79,7 +87,6 @@ AC_C_CONST
AC_C_VOLATILE
AC_PROG_CPP
AC_ISC_POSIX
AC_SYS_LARGEFILE
if test "${enable_maintainer_mode+set}" = set; then
CFLAGS="-g3 $ac_cv_prog_gcc_flags"
AC_CHECK_LIB(efence,EF_Abort)
@ -94,15 +101,16 @@ AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(void)
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(off_t)
if test $ac_cv_sizeof_off_t -ge 8 -a "$ac_cv_func_fseeko" = yes; then
if test $ac_cv_sizeof_off_t -ge 8 -a "x$ac_cv_func_fseeko" = xyes; then
AC_DEFINE(NATIVE_LARGEFILES,1,[Define if we have 64bit off_t and fseeko])
AC_MSG_NOTICE([Native large file support enabled])
else
AC_MSG_NOTICE([No native 64 bit files support, fallback to fopen64])
AC_CHECK_FUNC(fopen64)
if test "$ac_cv_func_fopen64" = yes -a "$enable_largefile" = yes; then
if test "x$ac_cv_func_fopen64" = xyes -a "x$enable_largefile" = xyes; then
AC_MSG_ERROR([You have fopen64 but no native LFS support. This configuration is not currently supported. Report compiler version, os version and library version to Radim Kolar. Thank you for your cooperation.])
fi
fi
@ -114,7 +122,7 @@ AC_CHECK_TYPE(nlink_t, ,AC_DEFINE(nlink_t, int,[declare nlink_t as int if not fo
AC_CHECK_TYPE(rlim_t, ,AC_DEFINE(rlim_t, [unsigned int],[declare rlim_t as unsigned int if not found in <sys/resource.h>]),[#include <sys/resource.h>])
AC_TYPE_SIGNAL
AC_FUNC_CLOSEDIR_VOID
AC_CHECK_FUNCS(random strdup bcopy flock lockf getrlimit fork setsid)
AC_CHECK_FUNCS(random strdup bcopy flock lockf getrlimit fork setsid semop nanosleep)
AC_CACHE_CHECK(for working shmget ,fsp_cv_func_shmget,
[LOCKPATH="conftestlock"
AC_TRY_RUN([

View File

@ -19,7 +19,7 @@
### # # ### L8mer guide to FSP
### ## ## ###
### ### # ### LQ Version
##### # ###### ##### Oct 2004
##### # ###### ##### Dec 2004
Why you need it
@ -31,16 +31,18 @@ Why you need it
- 100% attack resistant
- net adminz do not like it
- lamerz can not handle it
- bandwidth friendly
STuFF firSt!
you neeeed to get a p-file called cygwin1.dll. lamerz at www.cygwin.com
have some. Grab a copy, man. Copy it to your winlost sistema32 dyr.
Have it? Right.
Have it? Right! You are ready now.
------------------------ sharing -------------------
Now rock!
FSP server rocks!
There is a p-file fspd.exe. This is for stuff sharing. Server. You know.
Right. Running this is easy:
@ -50,12 +52,32 @@ fspd.exe -d c:\your\stuff\to\share -p 53
this number is important. Recommended numbers for stealth
operation are: 53, 2090, 137-139, 13, 80, 443
You can be catched more easily with bad number, so chooze wisely. Rememmber,
You can be catched more easily with bad number, so chooze wisely. Remember,
some numbers like 2221, 21, 2000, 2001 are used only by Elite!
do not try it at home; bad thingz can hepen. you know. police will certainly
take a visit. Lamers can detect you more easily on this ports, so be
wise a little. Remember: You are c000l.
Upload area
You want uploads from users. Of course. You need to setup an upload
area. This is easy.
In your FSP homedir create subdirectory upload and and create file named
".FSP_OK_ADD" there. Content of this file dosnot matter. Copy your favourite
music into it if you want. Do something nice.
Last point is to add upload directory to server invocation arguments:
fspd.exe -d c:\your\stuff\to\share -p 53 -T c:\your\stuff\to\share\upload
that's all.
Wait! If you want to stop users from downloading files from your upload area,
simply create ".FSP_NO_GET" file here.
------------------------- leeching ------------------
Get more stuff!
Of course that you want to have the latest stuff, isn't it?
@ -96,7 +118,7 @@ much better guide - hq version. Try to offer something.
192.168.45.21 108
10.20.30.40 5060
never try to flood fsp server, this does not work, elite will lauch
never try to flood fsp server, this does not work, elite will laugh
at you and cut your accez down. remember, you ar elite, not a kiddie!
-----**************------*******************----------************---
@ -107,10 +129,9 @@ for HQ version of this guide send
number 550694
Features included:
list of hq quality sitez
how to setup upload facility
list of 5 hq quality sitez
how to search for new sitez
special seek tool
special fsp sites seek tool
and 3 secret bonuzez
!We Do NOT sEnDZ hQ guiDe to LAmeRZ! Prove yourself first.

View File

@ -1,8 +1,8 @@
FILE SERVICE PROTOCOL VERSION 2
FSP v2
Document version 0.15
Last updated 2 Dec 2004
Document version 0.16
Last updated 15 Dec 2004
Also known as
File Slurping Protocol,
@ -496,10 +496,9 @@ Commands starting from FSP 2.8.1 Beta 11
CC_RENAME 0x4E - rename file or directory
request
file position: not used
file position: size of extra data
data: ASCIIZ source file or directory
ASCIIZ destination file or directory
xtra data: not used
xtra data: ASCIIZ destination file or directory
Note: It is possible to do cross-directory rename. In this
case you must have rights to DELETE in source directory and

View File

@ -9,27 +9,28 @@
<firstname>Sven</firstname>
<othername>"Hoaxter"</othername>
<surname>Hoexter</surname>
<affiliation>
<address><email>sven@du-gehoerst-mir.de-nospam</email></address>
</affiliation>
</author>
<author>
<firstname>Radim</firstname>
<othername>"HSN"</othername>
<surname>Kolar</surname>
<affiliation>
<address><email>hsn@sendmail.cz.nospam</email></address>
<address><email>hsn@no.spam.sendmail.cz</email></address>
</affiliation>
</author>
<copyright>
<year>2003-2004</year>
<holder>Authors</holder>
</copyright>
<!-- I'll call it 0.1 later
<revhistory>
<revision>
<revnumber>0.1</revnumber>
<date>2003.09.10</date>
<date>2004.12.17</date>
</revision>
</revhistory>
-->
<!-- starting with some general stuff -->
<abstract>
<para>
@ -58,8 +59,8 @@
FSP stands for &fsp;. In general FSP is what anonymous ftp should be: a reliable and bandwidth friendly
way to access publicly available data.
<para>
FSP is a UDP based protocol for transferring files around. It has
many benefits over FTP, mainly for running
FSP is a lightweight UDP based protocol for transferring files around.
It has many benefits over FTP, mainly for running
anonymous archives. FSP protocol is valuable in all kinds of
environments because it is one of the only TCP/IP protocols that is not
aggressive about bandwidth, while still being sufficiently fault tolerant.
@ -103,6 +104,9 @@
which solves problems with aborted and timed out transfer. Because
FSP is stateless protocol, it can survive even server reboot without
interruption.
<para>
More information about FSP use can be found
in <ulink url="http://cvs.sourceforge.net/viewcvs.py/fsp/fsp/INFO?view=auto">INFO document</ulink>.
</para>
</sect2>
<sect2 id="comparison">
@ -140,6 +144,7 @@
<para>
HTTP: widely supported by servers, clients and proxies.
De-facto standard protocol for accessing information today.
HTTP is also primary protocol used for file distribution today.
<para>
FSP: Can provide directory listings, which are not supported
by standard HTTP/1.1 protocol. You need to have configured
@ -151,21 +156,25 @@
<para>
FTP: widely supported by servers and clients, more difficult
to proxy than HTTP, uses 2 TCP connections, can provide directory
listings in site-specific format, more heavy service than HTTP.
listings in site-specific format, server side is more heavy service
than HTTP. FTP is being replaced by HTTP today.
<para>
FSP: do not needs to make any connection, very lightweight service,
directory listings are standardized by protocol.
FSP: do not needs to make any connection, server side is very
lightweight service,
directory listings are standardized by protocol and very quick,
no problems with NAT.
</sect3>
<sect3 id="comparetftp">
<title>FSP vs. tftp</title>
<para>
tftp is UDP (but TCP version also exists) used mainly
for loading boot and flash ROM images from network.
tftp is simple UDP (but TCP version also exists) protocol used mainly
for loading boot and flash ROM images from network. Standard
tftp uses 512 bytes long packets.
<para>
TFTP: more widely used, standardized, most network cards
TFTP: more widely used, standardized in RFC, most network cards
can boot image via TFTP.
<para>
FSP: about 1.5-times faster because of bigger packet size,
FSP: about 1.5-times faster because of 1k packet size,
supports directory listings,
can query file date and size,
can provide random access to file and supports opening
@ -186,12 +195,14 @@
files from your archive. It also helps people during spikes periods
when archive is very busy.
<para>
There are also some people which likes slower FSP downloads, because
it saves their bandwidth for interactive tasks.
There are also some people which likes slower FSP downloads better,
because
it saves their bandwidth for interactive tasks. This is often prefered
way of downloading large files, like CD-ROM images.
<para>
It is not true that UDP based protocols are unsecure. &fsp; provides
the same security level as anonymous FTP and is much more resistant
against denial of service attack. It is nearly impossible to overload
against denial of service attacks. It is nearly impossible to overload
fsp server by flooding. On other side, TCP-based protocols are very
simple to SYN flood.
<sect2 id="wherecanifind">
@ -324,18 +335,22 @@
version 2.7.1 was released. It was quite popular at that time,
mainly because it was superior way for transferring warez around
when compared with FTP. Because of this, FSP protocol got a bad
name and suffers from it even today. I see that FSP warez era
name "Underground file sharing protocol" and suffers from it even today.
I see that FSP warez era
as practical demonstration how can FSP perform nicely on
overloaded sites and lines.
<para>
After that then was some work on
FSP in 1995 and which ends with now famous FSP version 2.8.1b3
in March 1996. This version is used on some
servers today because Debian Woody has it, but 2.7.1 is still
used on some forgotten machines in universities. It has also
known security issues (fspd follows all symlinks), but at this
time there were viewed as feature, not a bug.
After that then was some maintenance work on FSP in 1995 which ends
with famous last official beta FSP version 2.8.1b3
in March 1996, which was coded by original FSP developers team.
This version is used on some servers today because Debian Woody has it.
<para>
Last official stable FSP version was 2.7.1. This is still
used on some forgotten machines in universities today. It has also
known security issue (fspd follows all symlinks), but at this
time this was viewed as feature, not a bug.
<para>
Radim Kolar released 2.8.1b4 in 2001, which was just some bugfixed
@ -343,6 +358,7 @@
Active working on FSP again starts on 25 June 2003 when Version
2.8.1b5 goes out. Major parts of FSP server code was rewrited
for higher performance and many old bugs in FSP code fixed.
Some bugs gets fixed after more than 10 years.
<para>
In the past various people worked on the &fsp;, see
@ -354,7 +370,7 @@
<para>
Radim Kolar started to work on the &fsp; again in June 2003. Since
that time he's maintaining the source distribution. You can reach him
on the mailinglists or via e-mail <email>hsn@sendmail.cz-nospam</email>.
on the mailinglists or via e-mail <email>hsn@no.spam.sendmail.cz</email>.
</para>
<para>
Since September 2003 Sven Hoexter is working on parts of the documentation.
@ -414,33 +430,59 @@
<sect1 id="serverside">
<title>How to set up your FSP server</title>
<para>
FIXME
Information about the fspd
Maybe I should start a second document describing all the
possible configuration options in the fspd?
Raw overview for this section:
- install fspd -> see prior section
- basic infos on fspd.conf
- info about init scripts
- info about the several .FSP_ files
</para>
Setting FSP server is a easy task. Majority of people runs FSP
server in read only mode. In this mode fspd needs to know
only home directory and port number. Both can be supplied by command
line arguments to fspd.
<para>
If you need additional features, such as
logging, you will need to know <xref linkend="fspd.conf">
</para>
<sect2 id="installserver">
<title>How to install fsp server</title>
<para>
See <xref linkend="installation"> first.
<para>
Server can be installed as inetd service or standalone. I prefer
inetd installation, because modification of system startup
scripts is not needed.
<para>
Server can operate even without user supplied configuration file
fspd.conf. Basic setup can be easily done by command line arguments.
</sect2>
<sect2 id="installfspdquick">
<title>How to quickly install fsp server</title>
<para>
Add following line to your /etc/inetd.conf
<programlisting>
ftp dgram udp wait ftp /usr/local/bin/fspd in.fspd -d /home/ftp
</programlisting>
This easy setup will run fsp server on standard port 21, home directory set to /home/ftp and effective user set to ftp. If you do not have configured
temporary directory in fspd.conf, fsp server will run in read-only
mode.
<sect2 id="fspd.conf">
<title>How to setup a basic fspd.conf</title>
<para>
FIXME
Example config file for fsp server is called fspd.conf and can be
found in distribution. This file needs to be installed as
/usr/local/etc/fspd.conf or you can specify alternate location
by -f command line switch passed to fspd.
<para>
Configuration file itself is commented. Read comments inside.
</para>
</sect2>
<sect2 id="initscript">
<title>How can I start the fspd automagicly on reboot?</title>
<para>
FIXME
Use init scripts ;)
FIXME.
Use init scripts ;) or run it from inetd.
</para>
</sect2>
<sect2 id="restrictions">
<title>How to setup restrictions on directories?</title>
<para>
FIXME
FIXME.
See manual page fspd(1).
</para>
</sect2>
</sect1>
@ -450,15 +492,29 @@
<sect1 id="clientside">
<title>How to use the fsp client tools</title>
<para>
FIXME
Explain client tools and those f*cking shell script wrappers *hrhr*
Check the X based fsp tools, maybe they'll compile ...
</para>
For accessing FSP server, you need to use programs which supports
FSP v2 protocol. There are several programs available today.
</para>
<sect2 id="fsptoolchain">
<title>The fsp tool collection</title>
<para>
FIXME
Information about all the f* commands
Classic command line interfacing with FSP server is via client
utilities found in basic distribution. Because FSP protocol
do not uses connections, there is no central command line interpreter
like found in ftp, because it is not needed. Information about
current remote server address and remote working directory is kept
in several environment variables. See manual page fsp_env for more
info.
<para>
Fsp client commands are started from normal shell interpreter. Because
most commands does remote globing which can not be done by your
local shell, you will need to turn globing in your shell off or
use one of prepared shell aliases. In distribution you will find
setup.sh and setup.csh shell scripts. These scripts must be
sourced (not executed) by your current shell.
<para>
Fsp commands names follows unix standard with f prepended. For
example: fcd, fpwd, fls. Files are transfered by fget/fput commands.
</para>
</sect2>
<sect2 id="fspclient">
@ -554,7 +610,7 @@
<para>
For bigger performance enhancement we need to use at least 2KB,
but packets of that size must be fragmented on most network and fragmenting increases possibility of packet loss. We will not increase packet size
in FSP v2, but we are willing to do some experiments in FSP v3.
in FSP v2 codebase, but we are willing to do some experiments in FSP v3.
</sect1>
</article>
<!-- vim: set expandtab: -->

View File

@ -124,7 +124,8 @@ logfile ../logs/logfile
# The log command takes the following options
# 'none' or any of 'all', '(!)errors', '(!)version', '(!)getdir',
# '(!)getfile', '(!)upload', '(!)install', '(!)delfile', '(!)deldir',
# '(!)setpro', '(!)getpro', '(!)makedir', '(!)grabfile',(!)readonly.
# '(!)setpro', '(!)getpro', '(!)makedir', '(!)grabfile',(!)readonly,
# '(!)stat', '(!)rename'.
# logging of 'all' will include logging of errors.
# for example:
# log all !errors -- will log all commands sent, but no error messages.

View File

@ -2,4 +2,4 @@
noinst_HEADERS=bsd_extern.h c_extern.h client_conf.h client_def.h co_extern.h \
common_def.h find.h ls.h my-string.h s_extern.h server_conf.h \
server_def.h tweak.h
server_def.h tweak.h fspinfo.h

View File

@ -15,12 +15,10 @@
#define FSPPROF ".fsp_prof"
/****************************************************************************
* Define the following if you want the client programs to time out and *
* abort after a certain period (period is settable via an environment *
* variable. See the INFO, client man pages, and ChangeLog files for *
* details *
* Define the CLIENT_TIMEOUT if you want the client programs to time out
* and abort after a certain period. Period is settable via an environment
* variable FSP_TIMEOUT. See the fsp_env(7) for details
****************************************************************************/
#define CLIENT_TIMEOUT 1
/****************************************************************************
* Define the following if you want fhostcmd to attempt to perform name *
@ -39,18 +37,22 @@
/* find the best locking method, defines one of USE_SHAREMEM_AND_LOCKF,
* USE_FLOCK,USE_LOCKF,NOLOCKING 1 */
#if defined(HAVE_SHMEM) && defined(HAVE_LOCKF)
#define USE_SHAREMEM_AND_LOCKF 1
#if defined(HAVE_SHMEM) && defined(HAVE_SEMOP)
#define USE_SHAREMEM_AND_SEMOP 1
#else
#ifdef HAVE_LOCKF
#define USE_LOCKF 1
#else
#ifdef HAVE_FLOCK
#define USE_FLOCK 1
#else
#define NOLOCKING
#endif
#endif
#endif
#if defined(HAVE_SHMEM) && defined(HAVE_LOCKF)
#define USE_SHAREMEM_AND_LOCKF 1
#else
#ifdef HAVE_LOCKF
#define USE_LOCKF 1
#else
#ifdef HAVE_FLOCK
#define USE_FLOCK 1
#else
#define NOLOCKING
#endif
#endif
#endif
#endif /* locking story */
#endif /* _FSP_CLIENT_CONF_H_ */

View File

@ -25,6 +25,7 @@ void destroy_configuration (void);
int init_caches (void);
void shutdown_caches (void);
void stat_caches (FILE *fp);
void init_home_dir (void);
const char *validate_path (char *, unsigned, PPATH *,DIRINFO **, int);
const char *server_get_dir (DIRLISTING **,const DIRINFO *);
const char *server_del_file (PPATH *, DIRINFO *);
@ -43,8 +44,7 @@ const char *server_grab_file (FILE **, unsigned long,
unsigned short);
const char *server_grab_done (unsigned long, unsigned short);
const char *server_stat (UBUF * buf);
const char *server_rename (char *,unsigned int,unsigned long);
void init_home_dir (void);
const char *server_rename (PPATH *src,PPATH *dest,DIRINFO *sdir, DIRINFO *tdir);
/* filecache.c, open filehandles cache */

View File

@ -18,23 +18,32 @@
#endif
/****************************************************************************
* DEFAULT_DIRLISTCACHE_SIZE should be set to contain the number of *
* listings you want to held in memory cache. Dirlisting needs a lot of *
* syscalls, so it should be set to some higher number. *
* Following setting is a minimum recommended size. *
* DEFAULT_DIRLISTCACHE_SIZE should be set to contain the number of
* listings you want to held in memory cache.
* Dirlisting building needs a lot of syscalls, so it should be set to
* some higher number.
* Following setting is a minimum recommended size.
****************************************************************************/
#define DEFAULT_DIRLISTCACHE_SIZE 50
#define DEFAULT_DIRLISTCACHE_SIZE 100
/****************************************************************************
* DEFAULT_DIRSTATCACHE_SIZE should be set to contain the number of dirs *
* you want to held in dirstat memory cache. This cache avoids calling stat *
* on directory and loading access perms. This operation is far less
* expensive than listing a directory, so if can be a lower number.
*/
***************************************************************************/
#define DEFAULT_DIRSTATCACHE_SIZE 30
/****************************************************************************
* Set this value to the maximum number of open files you wish your system *
* to keep around at any given time. The smaller this number is, the more *
* likely the server is to be opening and closing files, but the less file *
* descriptors need to be taken up by the server itself. *
****************************************************************************/
#define DEFAULT_FPCACHE_SIZE 20
/* THCCOUNT is the number of seconds used to compute average throughput.
* 10 seconds seems to be a good value
*/

View File

@ -1,4 +1,4 @@
.TH FVER 1 "Oct 2004" FSP
.TH FVER 1 "Dec 2004" FSP
.SH NAME
fver \- displays the version number string of the FSP database
.SH SYNOPSIS
@ -8,8 +8,9 @@ fver \- displays the version number string of the FSP database
.LP
Without arguments,
.B fver
displays the version string of the FSP server.
Otherwise, the version string of the client utilities is displayed.
displays the version string of the remote FSP server.
Otherwise, the version string of the client utilities and
compile time options are displayed.
.SH ENVIRONMENT
.LP
See fsp_env(7) for list of used environment variables.

View File

@ -64,16 +64,7 @@ unsigned int dir_cache_limit = DEFAULT_DIRLISTCACHE_SIZE;
unsigned int stat_cache_limit = DEFAULT_DIRSTATCACHE_SIZE;
mode_t upload_umask = 0033;
mode_t system_umask = 0077;
/****************************************************************************
* Set this value to the maximum number of open files you wish your system *
* to keep around at any given time. The smaller this number is, the more *
* likely the server is to be opening and closing files, but the less file *
* descriptors need to be taken up by the server itself *
* Five seems to work reasonably well on my system *
****************************************************************************/
unsigned int fp_cache_limit=10;
unsigned int fp_cache_limit= DEFAULT_FPCACHE_SIZE;
static void log_set (int flag, int neg)
{
@ -98,7 +89,6 @@ static int get_boolean (const char *q)
fprintf(stderr,"Bogus boolean value '%s'. Exiting.\n",q);
exit(1);
return -1;
}
static void read_configuration (const char * name)

View File

@ -1066,32 +1066,15 @@ const char *server_stat (UBUF * ubuf )
}
/* rename FILE/directory object */
const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
const char *server_rename (PPATH *src,PPATH *dest,DIRINFO *sdir, DIRINFO *tdir)
{
struct stat sb;
int issrcdir, istargetdir;
unsigned n;
PPATH src,dest;
const char *pe;
DIRINFO *sdir,*tdir;
/* compute size of 1st component */
for(n=0;n<l1;n++)
if(ub[n] == '\0')
break;
n++;
/* parse suplied request data */
pe=parse_path(ub, n, &src );
if(pe)
return pe;
pe=parse_path(ub+n,l1- n, &dest );
if(pe)
return pe;
/* explore type of source object */
if(FSP_STAT(src.fullp,&sb)) return("can't find source file or directory");
if(FSP_STAT(src->fullp,&sb)) return("can't find source file or directory");
if(S_ISDIR(sb.st_mode))
issrcdir=1;
else
@ -1099,17 +1082,9 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
issrcdir=0;
else
return ("Refusing to operate on special files");
/* validate source object */
/* we must turn \0 back into \n in password field */
if(src.passwd)
{
ub[n-strlen(src.passwd)-2]='\n';
}
pe=validate_path(ub,n,&src,&sdir,0);
if(pe) return pe;
/* --- explore Target --- */
if(FSP_STAT(dest.fullp,&sb))
if(FSP_STAT(dest->fullp,&sb))
istargetdir=-1; /* non - existent! */
else
if(S_ISDIR(sb.st_mode))
@ -1120,20 +1095,13 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
else
return ("Refusing to operate on special files");
/* validate target */
if(istargetdir==1)
pe=validate_path(ub+n,l1 - n,&dest,&tdir,1);
else
pe=validate_path(ub+n,l1 - n,&dest,&tdir,0);
if(pe) return pe;
/* --=== now check ACL and do it ===-- */
/* Cross - directory rename? */
if (sdir == tdir)
{
/* no, do simple rename */
/* not needed checked at upper level
pe=require_access_rights( sdir,DIR_RENAME,inet,src.passwd);
if(pe[0]!='N' && pe[0]!='O')
return ("Permission denied");
@ -1141,8 +1109,9 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
pe=require_access_rights( sdir,DIR_DEL,inet,src.passwd);
if(pe[0]!='N' && pe[0]!='O')
return ("No permission for overwriting files");
*/
/* now go to the action */
if (rename(src.fullp,dest.fullp))
if (rename(src->fullp,dest->fullp))
return ("Rename failed");
/* update dir listing */
sdir->lastcheck=cur_time;

View File

@ -49,7 +49,7 @@ do { if((logging & (FLAG)) && !old) { \
#define ACTIONLOG2(FLAG,X) \
do { if((logging & (FLAG)) && !old) { \
fsplogs(); \
fsploga("%s %-8s /%.*s %s %s", inetstr, (X), l1, s1, s1+l1); \
fsploga("%s %-8s /%.*s /%.*s", inetstr, (X), l1, s1, l2, s2); \
} } while (0)
#define ACTIONINFO(FLAG,F) \
@ -102,6 +102,8 @@ static const char * print_command(unsigned char cmd)
return "BYE";
case CC_VERSION:
return "VER";
case CC_INFO:
return "INFO";
case CC_ERR:
return "ERR";
case CC_GET_DIR:
@ -875,15 +877,88 @@ static void server_process_packet (unsigned bytes, UBUF * ub, int old,
}
if(!old)
{
DIRINFO *srcdir;
PPATH srcpath;
int istargetdir;
struct stat sb;
ACTIONLOG2(L_RENAME,"RENAME");
if ( (pe = server_rename(ub->buf,l1,inet_num)) )
/* validate source file */
pe = validate_path(s1,l1,&pp,&di,0);
if (pe)
{
ACTIONLOG1(L_RENAME|L_ERR,"RENAME");
ACTIONLOG2(L_ERR|L_RENAME,"RENAME");
ACTIONFAILED(L_ERR|L_RENAME,pe);
send_error(from, ub, pe) ;
return;
}
CHECK_ACCESS_RIGHTS(DIR_RENAME,L_RENAME);
srcdir=di;
srcpath=pp;
/* validate target */
pe = NULL;
/* check if target path is zero terminated */
if(s2[l2-1])
pe = ("Target path is not zero terminated");
else
{
if(FSP_STAT(s2,&sb))
istargetdir=-1; /* non - existent! */
else
if(S_ISDIR(sb.st_mode))
istargetdir=1;
else
if(S_ISREG(sb.st_mode))
istargetdir=0;
else
pe = ("Refusing to operate on special files");
}
if (!pe)
{
if (istargetdir == 1)
pe = validate_path(s2,l2,&pp,&di,1);
else
pe = validate_path(s2,l2,&pp,&di,0);
}
if (pe)
{
ACTIONLOG2(L_ERR|L_RENAME,"RENAME");
ACTIONFAILED(L_ERR|L_RENAME,pe);
send_error(from, ub, pe) ;
return;
}
/* check ACL in target directory */
if (istargetdir == 0)
{
/* we need delete right in the target directory */
pe = require_access_rights(di,DIR_DEL,inet_num,pp.passwd);
if(pe[0]!='N' && pe[0]!='O')
pe=("No permission for overwriting files");
else
pe=NULL;
}
/* execute rename */
if (!pe)
pe = server_rename(&srcpath,&pp,srcdir,di);
if ( pe )
{
ACTIONLOG2(L_RENAME|L_ERR,"RENAME");
ACTIONFAILED(L_RENAME|L_ERR,pe);
send_error(from, ub, pe);
return;
}
}
/* clear position field */
memset(ub->bb_pos,0,4);
server_reply(from,ub,0,0);
ACTIONOK(L_RENAME);
return;

View File

@ -22,4 +22,5 @@ alias fpro \(set noglob\; exec fprocmd \!\*\)
alias fpwd echo \$FSP_DIR on \$FSP_HOST port \$FSP_PORT
alias frm \(set noglob\; exec frmcmd \!\*\)
alias frmdir \(set noglob\; exec frmdircmd \!\*\)
alias fmv \(set noglob\; exec fmvcmd \!\*\)
alias ftouch "touch \!:1;fput \!:1;rm \!:1"

View File

@ -52,6 +52,8 @@ alias frmdir='set -f;_frmdir'
ftouch() { touch "$1"; fput "$1"; rm "$1" ;}
_fcd() { export FSP_DIR=$(fcdcmd "$@"); set +f;}
alias fcd='set -f;_fcd'
_fmv() { fmvcmd "$@"; set +f;}
alias fmv='set -f;_fmv'
####something like wget emulation####
_fspget() {