Go Back   FlashFXP Forums > > > >

ioFTPD General New releases, comments, questions regarding the latest version of ioFTPD.

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-12-2004, 04:57 PM   #1
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default 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
Mouton is offline   Reply With Quote
Old 03-12-2004, 04:58 PM   #2
Flare2
Member
 
Join Date: Feb 2003
Posts: 91
Default

thx nice script
Flare2 is offline   Reply With Quote
Old 03-12-2004, 05:31 PM   #3
MatC
Member
ioFTPD Foundation User
 
Join Date: Nov 2003
Posts: 42
Default

Good idea :banana:
MatC is offline   Reply With Quote
Old 03-13-2004, 05:32 AM   #4
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

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.
Zer0Racer is offline   Reply With Quote
Old 03-13-2004, 05:52 AM   #5
biboun
Member
FlashFXP Registered User
ioFTPD Registered User
 
Join Date: Mar 2003
Posts: 87
Default yeah

Nice tips Mouton :banana: & ZeroRacer
biboun is offline   Reply With Quote
Old 03-13-2004, 07:03 AM   #6
epoke
Member
ioFTPD Foundation User
 
Join Date: Nov 2003
Posts: 60
Default

héhé thx i 'll try it today

@tte
epoke is offline   Reply With Quote
Old 03-13-2004, 01:01 PM   #7
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

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...
Mouton is offline   Reply With Quote
Old 03-13-2004, 04:52 PM   #8
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

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].
Zer0Racer is offline   Reply With Quote
Old 03-13-2004, 06:06 PM   #9
mr_F_2
Senior Member
 
Join Date: Jan 2004
Posts: 203
Default

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
mr_F_2 is offline   Reply With Quote
Old 03-13-2004, 06:16 PM   #10
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

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
Zer0Racer is offline   Reply With Quote
Old 03-13-2004, 08:30 PM   #11
mr_F_2
Senior Member
 
Join Date: Jan 2004
Posts: 203
Default

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.
mr_F_2 is offline   Reply With Quote
Old 03-14-2004, 03:58 AM   #12
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

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.
Zer0Racer is offline   Reply With Quote
Old 03-14-2004, 04:20 AM   #13
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

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?
Zer0Racer is offline   Reply With Quote
Old 03-14-2004, 10:04 PM   #14
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

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/
Mouton is offline   Reply With Quote
Old 05-26-2004, 04:38 PM   #15
zpr
Senior Member
ioFTPD Foundation User
 
Join Date: Feb 2003
Posts: 170
Default

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
zpr is offline   Reply With Quote
Reply

Tags
cd1, dirs, files, match, upload

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Site to site question, wont connect Xbox4144 General Discussion 3 01-09-2005 10:38 AM
site deluser Shorty Bug Reports 1 01-13-2003 09:31 AM


All times are GMT -5. The time now is 02:00 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)