PDA

View Full Version : Only allow dirs by rls group?


lex0
03-20-2006, 08:12 PM
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,.

mr_F
04-01-2006, 07:51 PM
hey, i made something, hope it suites your needs, worked perfectly for me

here's the source 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
04-11-2006, 12:36 AM
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:

-GROUP1 /upload
-FLT /iso.games
-DEVIANCE /iso.games

you get the point...

same link (above)
have fun
--mr_F