ioFTPD General New releases, comments, questions regarding the latest version of ioFTPD. |
03-12-2004, 04:57 PM
|
#1
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
How can i stop ppl from uploading stupid files in wrong dirs ?
Got tired today of kids sending .nfo files in CD2 dirs... and trigerring imdb announces x times per upload.
So i stopped them liked that.
[VFS]
Upload = */CD?/*.nfo !*
Upload = */Sample/*.nfo !*
Upload = /DVDR/*/DVD?/*.nfo !*
Upload = /DVDR/*/DISC?/*.nfo !*
The match isn't case-sensitive, so those will match cd1 and CD1 and Cd1, etc.
*edit 2: Changed a little the DVD? and DISC? lines
|
|
|
03-12-2004, 04:58 PM
|
#2
|
Member
Join Date: Feb 2003
Posts: 91
|
thx nice script
|
|
|
03-12-2004, 05:31 PM
|
#3
|
Member
ioFTPD Foundation User
Join Date: Nov 2003
Posts: 42
|
Good idea :banana:
|
|
|
03-13-2004, 05:32 AM
|
#4
|
Senior Member
ioFTPD Scripter
Join Date: Oct 2002
Posts: 703
|
To continue this little io tips n tricks...
To deny download of contents in nuked dirs, but allow nfo-files:
Download = */[[]NUKED]-*/*.nfo *
Download = */[[]NUKED]-* !*
To deny download of your site tags (if they are files, not dirs):
Download = */[[]Site]* !*
Change those to match your site.
Dunno how to deny download of dirs. I think ftp clients only take the name of the dir and makes MKD <that dir> on target, instead of RETR <dirname>. So the site tags (dirs) would still end up on other sites if users, without proper skiplist set, downloads from your site.
Another thing comes into mind that could be used - denying MKD in dirs like CD1, CD2 that would create Some.rel-ZERO/CD1/CD1 or similar:
MakeDir = /DVDR/*/DVD[1-9]/*/* !*
MakeDir = /DVDR/*/DISC[1-9]/*/* !*
MakeDir = */CD[1-9]/*/* !*
Edit: Added the DVD? and DISC? too. Stealing Moutons ideas here.
Edit2: Corrected dvdr rules etc.
Edit3: Replaced CD[123456789] (and CD?) with CD[1-9] etc.
Note: Why does it have to be [[]NUKED]-* instead of [NUKED]-* ?
[NUKED]-* would try to match dirs named N-*, U-*, K-* etc.
|
|
|
03-13-2004, 05:52 AM
|
#5
|
Member
FlashFXP Registered User ioFTPD Registered User
Join Date: Mar 2003
Posts: 87
|
yeah
Nice tips Mouton :banana: & ZeroRacer
|
|
|
03-13-2004, 07:03 AM
|
#6
|
Member
ioFTPD Foundation User
Join Date: Nov 2003
Posts: 60
|
héhé thx i 'll try it today
@tte
|
|
|
03-13-2004, 01:01 PM
|
#7
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
The right syntaxt for Zer0's suggestions for makedir would be:
MakeDir = /DVDR/*/DVD?/*/* !*
MakeDir = /DVDR/*/DISC?/*/* !*
MakeDir = */CD?/*/* !*
Otherwise, you won't even be able to MKD CDx dirs at all...
|
|
|
03-13-2004, 04:52 PM
|
#8
|
Senior Member
ioFTPD Scripter
Join Date: Oct 2002
Posts: 703
|
Quote:
Originally posted by Mouton
The right syntaxt for Zer0's suggestions for makedir would be:
MakeDir = /DVDR/*/DVD?/*/* !*
MakeDir = /DVDR/*/DISC?/*/* !*
MakeDir = */CD?/*/* !*
Otherwise, you won't even be able to MKD CDx dirs at all...
|
Ah, point taken. My syntax would mess upp dirs like /incoming/dvdr But please explain to me why it has to be with those double /*/* at the end. I wouldn't allow MKD in any DVD1, DISC1 dirs. Or am I missing something here?
Also to be more precise and only match numbers for the missing character could be to use CD[1-9] and DVD[1-9] etc.
Edit: Replaced CD[123456789] with CD[1-9].
|
|
|
03-13-2004, 06:06 PM
|
#9
|
Senior Member
Join Date: Jan 2004
Posts: 203
|
zer0racer:
MakeDir = /DVDR/*/DISC?/*/* !*
Section = /DVDR
Releasename = /*
Disc# = /DISC?
Disc# Subdirectory = /*
Filename = /*
So it's like:
MakeDir = /Section/releasename(*)/Disc?/all_subdirs_arent_allowed(*)/nothing_is_allowed_for_filename(*)
hope that explains it for you
|
|
|
03-13-2004, 06:16 PM
|
#10
|
Senior Member
ioFTPD Scripter
Join Date: Oct 2002
Posts: 703
|
Doesn't make sense since I wanna block MakeDir, not uploading files. If the dir is not there, no files can be uploaded in it. They would get permission denied on the MKD and No such file or directory on STOR to */DISC1/DISC1 or whatever.
Example:
MakeDir = /DVDR/*/DISC1/* !*
...would mean 'nobody has permission to create a dir inside any dir called DISC1 under /DVDR'
That should be enough.
Edit: Okay, the above doesn't work. Even though I think it should
|
|
|
03-13-2004, 08:30 PM
|
#11
|
Senior Member
Join Date: Jan 2004
Posts: 203
|
because
MakeDir = /DVDR/*/DISC1/* !*
will block paths like this being created:
/DVDR/releasename/DISC1/*
meaning * as file wildcard, that's the way io works.
I see what you're saying "why does makedir need a wildcard for a file?"
My guess is because d1 doesn't have to modify the routine he uses to check if permissions. Considering many of other permissions can work with dirs and filenames, it only makes sense to use the same routine so as not having to write another routine.
MakeDir = /DVDR/*/DISC1/*/* !*
is necessary, as it means to block:
/DVDR/releasename/DISC1/any_subdir/*
I might be wrong, and that might not even make sense.
|
|
|
03-14-2004, 03:58 AM
|
#12
|
Senior Member
ioFTPD Scripter
Join Date: Oct 2002
Posts: 703
|
After some testing and trying to understand the double /*/* I think if come up with something that 'works' in my head.
MakeDir = */CD[1-9]/* !* would indeed mean 'i wanna block MKD of anything matching this rule' Ie. MKD cd1 anywhere would match it.
Where as MakeDir = */CD[1-9]/* /* !* would match path called */CD[1-9]/* as above and the last /* would mean INSIDE any path matching */CD[1-9]/*.
It works like this even if it doesn't make perfect sense.
|
|
|
03-14-2004, 04:20 AM
|
#13
|
Senior Member
ioFTPD Scripter
Join Date: Oct 2002
Posts: 703
|
To take things even further, and use my trial and error on */dir/* ...
To block any dir between CD4 and CD9 (anywhere) plus blocking MKD inside any CD1 -> CD9 dir (as above):
MakeDir = */CD[1-9]/*/* !*
MakeDir = */CD[4-9]/* !*
And maybe to never allow more than two dvdr discs:
MakeDir = /DVDR/*/DISC[1-9]/*/* !*
MakeDir = /DVDR/*/DVD[1-9]/*/* !*
MakeDir = /DVDR/*/DISC[3-9]/* !*
MakeDir = /DVDR/*/DVD[3-9]/* !*
Or if you never wanna allow more than 1 disc dvdr:
MakeDir = /DVDR/*/DISC[1-9]/* !*
MakeDir = /DVDR/*/DVD[1-9]/* !*
Basically the same set of rules used in different situations.
Update:
To block upload of files directly in section dir but still allow new dirs and upload in those new dirs...
Upload = /DVDR/*/*/* *
Upload = /DVDR/*/* !*
Upload = /REQUESTS/*/*/* *
Upload = /REQUESTS/*/* !*
etc.
Looks crazy, but it works.
Anymore ideas on what could be done?
|
|
|
03-14-2004, 10:04 PM
|
#14
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
Quote:
Originally posted by Zer0Racer
But please explain to me why it has to be with those double /*/* at the end. I wouldn't allow MKD in any DVD1, DISC1 dirs. Or am I missing something here?
|
In fact, to make it more understandable, the last star is not needed:
MakeDir = */CD?/*/* !*
should be
MakeDir = */CD?/*/ !*
But since * means anything, including nothing, having a trailing * doesn't change anything.
And that was also the problem with your old rules...
MakeDir = */CD?/* !*
is equivalent to
MakeDir = */CD?/ !*
and would match MKD /somedir/CD1/
so nobody could MKD a CD1 dir anywhere...
By adding another dir level, we deny MKD of any subdir inside a CD? dir:
MakeDir = */CD?/*/* !*
would match MKD /somedir/CD1/some.other.dir/
but not MKD /somedir/CD1/
|
|
|
05-26-2004, 04:38 PM
|
#15
|
Senior Member
ioFTPD Foundation User
Join Date: Feb 2003
Posts: 170
|
everything you guys wrote was cool stuff, so i added some in my ioftpd.ini
but got some problems... first my upload settings from ioftpd.ini:
Upload = */CD?/*.nfo !*
Upload = */Sample/*.nfo !*
Upload = /DVDR/*/DVD?/*.nfo !*
Upload = /DVDR/*/DISC?/*.nfo !*
Upload = /other_sections_here/*/*/* *
Upload = /other_sections_here/*/* !*
Upload = /REQUEST/*/*/* *
Upload = /REQUEST/*/* !*
Upload = * !-testtt *
Upload = * *
user 'testtt' should not be able to upload anywhere.
when i try to upload zip file in REQUEST dir i got disconnected from ftp, like this:
TYPE I
200 Type set to I.
PROT P
200 Protection set to: Private.
PORT 127,0,0,1,18,204
200 PORT command successful.
STOR up_test.zip
Connected. Negotiating SSL/TLS session.. (<- using auth ssl)
Connection lost: test_ftp
i reconnect, try to reupload and ffxp disconnects again
or maybe i fuxored some upload = ... settings, hm...
thx in advance.
regards
|
|
|
Thread Tools |
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:04 PM.
|