From 8d63e4a1ea40d8a7201aa1fd16d12d34a17c0ab2 Mon Sep 17 00:00:00 2001 From: hsn <> Date: Mon, 15 Nov 2004 17:17:57 +0000 Subject: [PATCH] fixed sf.net bugs --- ChangeLog | 5 +++++ TODO | 5 +++-- clients/fmvcmd.c | 2 +- clients/fprocmd.c | 1 + configure.ac | 2 +- server/acl.c | 12 ++++++------ server/file.c | 10 ++++++++-- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a94d6d9..67b3a57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 added BUGS and HISTORY sections to fspscan.1 manual page Lamerpack: disable most of command line options in fspd and print diff --git a/TODO b/TODO index cd243ee..25e4ff4 100644 --- a/TODO +++ b/TODO @@ -37,9 +37,9 @@ 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. + rewrite. better support for persistent keys - do not send cc_bye ? this should - be probably configurable + be probably configurable :long-term goals: :better to write a new code instead of fixing 10 yo crap. @@ -49,6 +49,7 @@ do not use global variables CLIENTS :high: +fpro without directory name do not works normalize return error codes of all clients write new clients for new commands - fpasswd finfo :low: diff --git a/clients/fmvcmd.c b/clients/fmvcmd.c index 0f55fa3..9479abb 100644 --- a/clients/fmvcmd.c +++ b/clients/fmvcmd.c @@ -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+l,buf,0,NULL); + reply=client_interact (CC_RENAME,0,n,buf,0,NULL); if(reply->cmd==CC_ERR) { diff --git a/clients/fprocmd.c b/clients/fprocmd.c index 14da457..264f688 100644 --- a/clients/fprocmd.c +++ b/clients/fprocmd.c @@ -66,6 +66,7 @@ int main (int argc, char ** argv) env_client(); if(argv[1] && (argv[1][0] == '+' || argv[1][0] == '-') && !argv[1][2]) { + /* set pro command */ key = *++argv; while(*++argv) { if(!(av = glob(*argv))) { diff --git a/configure.ac b/configure.ac index 5bbc6ec..3a8ceb6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a working configure script. 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) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE diff --git a/server/acl.c b/server/acl.c index ded9aca..c6228f5 100644 --- a/server/acl.c +++ b/server/acl.c @@ -64,12 +64,12 @@ void save_access_rights (DIRINFO *di) if(!use_access_files) return; /* step2 save flagfiles */ - if(! (di->protection & DIR_GET) ) touch(FSP_NOGET); - if(di->protection & DIR_DEL) touch(FSP_DEL); - if(di->protection & DIR_ADD) touch(FSP_ADD); - if(di->protection & DIR_MKDIR) touch(FSP_MKDIR); - if(di->protection & DIR_RENAME) touch(FSP_RENAME); - if(!di->protection& DIR_LIST) touch(FSP_NOLIST); + if(! (di->protection & DIR_GET) ) touch(FSP_NOGET); + if(di->protection & DIR_DEL) touch(FSP_DEL); + if(di->protection & DIR_ADD) touch(FSP_ADD); + if(di->protection & DIR_MKDIR) touch(FSP_MKDIR); + if(di->protection & DIR_RENAME) touch(FSP_RENAME); + if(! (di->protection& DIR_LIST)) touch(FSP_NOLIST); /* step3 pazzwordz */ if(di->public_password) save_password(FSP_PASSWORD,di->public_password); diff --git a/server/file.c b/server/file.c index e17d00e..f42b102 100644 --- a/server/file.c +++ b/server/file.c @@ -752,6 +752,7 @@ const char *server_set_pro (DIRINFO *di, const char * key) break; case 'l': act=DIR_LIST; + break; case 'r': act=DIR_RENAME; break; @@ -1091,6 +1092,11 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet) 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; @@ -1121,11 +1127,11 @@ const char *server_rename (char * ub, unsigned int l1, unsigned long inet) /* no, do simple rename */ pe=require_access_rights( sdir,DIR_RENAME,inet,src.passwd); - if(pe[0]!='N') + if(pe[0]!='N' && pe[0]!='O') return ("Permission denied"); if(istargetdir==0) 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"); /* now go to the action */ if (rename(src.fullp,dest.fullp))