Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-20-2006, 08:12 PM   #1
lex0
Junior Member
 
Join Date: Feb 2004
Posts: 5
Default Only allow dirs by rls group?

ZR-Ban does a good job of blocking dirs by keywords, but what if I want to use it for MP3 and I only want to allow like 20 rls groups? It would take forever to create a txt file to ban all other MP3 groups, and I probably wouldn't even get them all since new lame groups rls crap every day. Is there a script which will only allow dirs to be created by keyword (rls group) rather than blocking by keyword? I don't want an autonuker where the rls is uploaded and it nukes it later, I dont event want the rls to be uploaded on the site (waste of bandwidth). What are you guys doing in this situation? Thanks,.
lex0 is offline   Reply With Quote
Old 04-01-2006, 07:51 PM   #2
mr_F
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Jul 2005
Posts: 33
Default

hey, i made something, hope it suites your needs, worked perfectly for me

here's the source code:
Code:
/*
	another fine script request by mr_F ;)  ----- April 1st, 2006
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#define MAX_GROUPLEN 256
#define MAX_PATH_SIZE 2000
#define DEBUG 0


int
main(int argc, char *argv[]) {

	char *dirname;
	char path[MAX_PATH_SIZE];
	char *cwd;
	char groups[MAX_GROUPLEN];
	FILE *groupfile=NULL;
	int i;
	int had_mask=0;


#if DEBUG
	dirname = "somedir-DAAN";
	groupfile = fopen("groups.txt","r");
	cwd = malloc(sizeof(char) * 100);
	strcpy(cwd,"/shit****er");
#else
	dirname = argv[2];
	cwd = getenv("virtualpath");
	groupfile = fopen("..\\scripts\\ioAG\\groups.txt","r");
#endif	
	
	if (groupfile==NULL || dirname==NULL)
	{
		printf("Error with script, cannot find/oepn groups.txt and/or cannot detect directory\nIgnoring script interception\n");
		printf("directory = %s\n",dirname);
		return 0;
	}

	for (i=0; !feof(groupfile); i++)
	{
		fscanf(groupfile,"%s\t%s",groups,path);

		if (strstr(cwd,path)!=NULL)
			had_mask=1;
		else
			continue;

		
			if (strstr(dirname,groups)!=NULL)
				return 0;
		
	}

	fclose(groupfile);

	if (had_mask==0)
		return 0;
	else {
		printf("550 Permission denied.  Releases from this group are not allowed.\n");
		return 1;
	}

};
get it here http://www.dvnswtzk.com/ioAG.php


--------- mr_F
mr_F is offline   Reply With Quote
Old 04-11-2006, 12:36 AM   #3
mr_F
Member
FlashFXP Beta Tester
ioFTPD Foundation User
 
Join Date: Jul 2005
Posts: 33
Default

Hi, I updated the script, thinking back, I realized some releases might come in with a different casing than you have specified in your groups.txt.
Now make all your groups.txt entries in UPPERCASE, the script will convert all releases to uppercase before comparison. and just because it converts them to uppercase for COMPARISON, doesn't mean it will conver the ACTUAL DIRECTORY to uppercase, it will stay the same case they uploaded it as

example groups.txt:
Code:
-GROUP1 /upload
-FLT /iso.games
-DEVIANCE /iso.games
you get the point...

same link (above)
have fun
--mr_F
mr_F is offline   Reply With Quote
Reply

Tags
dirs, groups, mp3, rls, uploaded

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 Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:15 AM.

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