fixed sf.net bugs

This commit is contained in:
hsn 2004-11-15 17:17:57 +00:00
parent 64fbc6327b
commit 8d63e4a1ea
7 changed files with 25 additions and 12 deletions

View File

@ -1,3 +1,8 @@
fixed sf bug 1060594: fspd: owner can't rename files
fixed sf bug 1060558: fpro 'l' sets 'm' flag instead
fixed sf bug 1060558: fpro 'l' flag was not correctly saved
into filesystem
fmvcmd: do not send trailing junk to the server
print key=, seq= in fspd debugs with fixed width for easy reading print key=, seq= in fspd debugs with fixed width for easy reading
added BUGS and HISTORY sections to fspscan.1 manual page added BUGS and HISTORY sections to fspscan.1 manual page
Lamerpack: disable most of command line options in fspd and print Lamerpack: disable most of command line options in fspd and print

5
TODO
View File

@ -37,9 +37,9 @@ fver and others add support new syntax fsp://host:port/file
add sem locking method, possible? add sem locking method, possible?
flscmd should not to do stat before directory listing. flscmd should not to do stat before directory listing.
directory listing should not need to get 0 sized block. Needs total code directory listing should not need to get 0 sized block. Needs total code
rewrite. rewrite.
better support for persistent keys - do not send cc_bye ? this should better support for persistent keys - do not send cc_bye ? this should
be probably configurable be probably configurable
:long-term goals: :long-term goals:
:better to write a new code instead of fixing 10 yo crap. :better to write a new code instead of fixing 10 yo crap.
@ -49,6 +49,7 @@ do not use global variables
CLIENTS CLIENTS
:high: :high:
fpro without directory name do not works
normalize return error codes of all clients normalize return error codes of all clients
write new clients for new commands - fpasswd finfo write new clients for new commands - fpasswd finfo
:low: :low:

View File

@ -63,7 +63,7 @@ static void rename_file (const char *fname,const char *target)
} }
/* send our nicely crafted junk to the server */ /* send our nicely crafted junk to the server */
reply=client_interact (CC_RENAME,0,n+l,buf,0,NULL); reply=client_interact (CC_RENAME,0,n,buf,0,NULL);
if(reply->cmd==CC_ERR) if(reply->cmd==CC_ERR)
{ {

View File

@ -66,6 +66,7 @@ int main (int argc, char ** argv)
env_client(); env_client();
if(argv[1] && (argv[1][0] == '+' || argv[1][0] == '-') && !argv[1][2]) { if(argv[1] && (argv[1][0] == '+' || argv[1][0] == '-') && !argv[1][2]) {
/* set pro command */
key = *++argv; key = *++argv;
while(*++argv) { while(*++argv) {
if(!(av = glob(*argv))) { if(!(av = glob(*argv))) {

View File

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a working configure script. dnl Process this file with autoconf to produce a working configure script.
dnl tested with autoconf 2.57 dnl tested with autoconf 2.57
AC_INIT(fsp,2.8.1b21,hsn@netmag.cz) AC_INIT(fsp,2.8.1b22,hsn@netmag.cz)
AC_CONFIG_SRCDIR(server/main.c) AC_CONFIG_SRCDIR(server/main.c)
AM_INIT_AUTOMAKE([dist-bzip2]) AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

View File

@ -64,12 +64,12 @@ void save_access_rights (DIRINFO *di)
if(!use_access_files) return; if(!use_access_files) return;
/* step2 save flagfiles */ /* step2 save flagfiles */
if(! (di->protection & DIR_GET) ) touch(FSP_NOGET); if(! (di->protection & DIR_GET) ) touch(FSP_NOGET);
if(di->protection & DIR_DEL) touch(FSP_DEL); if(di->protection & DIR_DEL) touch(FSP_DEL);
if(di->protection & DIR_ADD) touch(FSP_ADD); if(di->protection & DIR_ADD) touch(FSP_ADD);
if(di->protection & DIR_MKDIR) touch(FSP_MKDIR); if(di->protection & DIR_MKDIR) touch(FSP_MKDIR);
if(di->protection & DIR_RENAME) touch(FSP_RENAME); if(di->protection & DIR_RENAME) touch(FSP_RENAME);
if(!di->protection& DIR_LIST) touch(FSP_NOLIST); if(! (di->protection& DIR_LIST)) touch(FSP_NOLIST);
/* step3 pazzwordz */ /* step3 pazzwordz */
if(di->public_password) save_password(FSP_PASSWORD,di->public_password); if(di->public_password) save_password(FSP_PASSWORD,di->public_password);

View File

@ -752,6 +752,7 @@ const char *server_set_pro (DIRINFO *di, const char * key)
break; break;
case 'l': case 'l':
act=DIR_LIST; act=DIR_LIST;
break;
case 'r': case 'r':
act=DIR_RENAME; act=DIR_RENAME;
break; break;
@ -1091,6 +1092,11 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
else else
return ("Refusing to operate on special files"); return ("Refusing to operate on special files");
/* validate source object */ /* 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); pe=validate_path(ub,n,&src,&sdir,0);
if(pe) return pe; if(pe) return pe;
@ -1121,11 +1127,11 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet)
/* no, do simple rename */ /* no, do simple rename */
pe=require_access_rights( sdir,DIR_RENAME,inet,src.passwd); pe=require_access_rights( sdir,DIR_RENAME,inet,src.passwd);
if(pe[0]!='N') if(pe[0]!='N' && pe[0]!='O')
return ("Permission denied"); return ("Permission denied");
if(istargetdir==0) if(istargetdir==0)
pe=require_access_rights( sdir,DIR_DEL,inet,src.passwd); pe=require_access_rights( sdir,DIR_DEL,inet,src.passwd);
if(pe[0]!='N') if(pe[0]!='N' && pe[0]!='O')
return ("No permission for overwriting files"); return ("No permission for overwriting files");
/* now go to the action */ /* now go to the action */
if (rename(src.fullp,dest.fullp)) if (rename(src.fullp,dest.fullp))