You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(16) |
Aug
(7) |
Sep
(4) |
Oct
(94) |
Nov
(11) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(128) |
Jun
(22) |
Jul
(46) |
Aug
|
Sep
(15) |
Oct
|
Nov
|
Dec
(32) |
2006 |
Jan
(11) |
Feb
(2) |
Mar
(74) |
Apr
(3) |
May
|
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(23) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Juan B. <tu...@us...> - 2005-12-26 05:21:50
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29183/src Modified Files: glines.c ircd.c m_server.c m_shun.c s_conf.c s_serv.c s_user.c toys.c userban.c Log Message: Read CHANGES log Index: toys.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/toys.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** toys.c 4 Sep 2005 06:31:10 -0000 1.2 --- toys.c 26 Dec 2005 05:21:38 -0000 1.3 *************** *** 102,106 **** short *next_state_p; ! old_text = LowerAll(old_text); len = strlen(old_text); curr_state = 0; --- 102,106 ---- short *next_state_p; ! old_text = LowerAll(old_text); len = strlen(old_text); curr_state = 0; *************** *** 116,120 **** *next_state_p = curr_state = next_free_state++; } - DupString(state[curr_state].replacement, new_text); } --- 116,119 ---- *************** *** 125,133 **** char *old_frag, *last_replacement, *add_frag, *temp; int curr_state, old_frag_len, add_frag_len; ! int last_replacement_len=0; ! old_text = LowerAll(old_text); chars_left--; /* Leave space for null terminator */ ! temp = new_text; --- 124,131 ---- char *old_frag, *last_replacement, *add_frag, *temp; int curr_state, old_frag_len, add_frag_len; ! int last_replacement_len=0; old_text = LowerAll(old_text); chars_left--; /* Leave space for null terminator */ ! temp = new_text; *************** *** 137,141 **** curr_state = 0; last_replacement = 0; - do { curr_state = state[curr_state].next_state[*old_frag++ & 0x7f]; --- 135,138 ---- *************** *** 178,182 **** next_free_state = 1; #ifdef CHECK ! printf("states used: %d\n", next_free_state); #endif } --- 175,179 ---- next_free_state = 1; #ifdef CHECK ! fprintf(stderr, "states used: %d\n", next_free_state); #endif } *************** *** 305,316 **** * End ELMER routines *****************************************/ ! #ifdef CHECK ! void main(void) { ! char buffer[256], buffer2[256]; ! init_chef(); ! printf("Text: "); ! gets(buffer); ! encode_chef(buffer, buffer2, 256); ! printf("Translation: %s\n",buffer2); ! } ! #endif --- 302,304 ---- * End ELMER routines *****************************************/ ! Index: s_conf.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_conf.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** s_conf.c 4 Dec 2005 07:14:07 -0000 1.10 --- s_conf.c 26 Dec 2005 05:21:38 -0000 1.11 *************** *** 86,89 **** --- 86,92 ---- extern void confparse_error(char *, int); extern int klinestore_init(int); + #ifdef TOYS + extern void init_chef(); + #endif /* initclass() *************** *** 1491,1498 **** cVar *tmp; struct userBan *ban; ! int i, c = 0; char *ub_u = NULL, *ub_r = NULL, *host = NULL; - char fbuf[512]; - aClient *ub_acptr; for(tmp = vars[c]; tmp; tmp = vars[++c]) --- 1494,1499 ---- cVar *tmp; struct userBan *ban; ! int c = 0; char *ub_u = NULL, *ub_r = NULL, *host = NULL; for(tmp = vars[c]; tmp; tmp = vars[++c]) *************** *** 2346,2350 **** initclass(); new_confopts = 0; ! if(initconf(configfile) == -1) { --- 2347,2353 ---- initclass(); new_confopts = 0; ! #ifdef TOYS ! init_chef(); /* For now */ ! #endif if(initconf(configfile) == -1) { Index: s_user.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_user.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** s_user.c 4 Dec 2005 08:43:13 -0000 1.16 --- s_user.c 26 Dec 2005 05:21:38 -0000 1.17 *************** *** 943,961 **** char *reason, *ktype; ! int local; ! ! char *gtype; ! int global; ! ! global = (ban->flags & UBAN_GLINE) ? 1 : 0; ! gtype = global ? NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; ! reason = ban->reason ? ban->reason : gtype; ! ! ! local = (ban->flags & UBAN_LOCAL) ? 1 : 0; ! ktype = local ? LOCAL_BANNED_NAME : NETWORK_BANNED_NAME; ! reason = ban->reason ? ban->reason : ktype; ! sendto_one(sptr, err_str(ERR_YOUREBANNEDCREEP), me.name, --- 943,953 ---- char *reason, *ktype; ! int local = (ban->flags & UBAN_LOCAL) ? 1 : 0; ! if (ban->flags & UBAN_GLINE) ! ktype = NETWORK_GLINNED_NAME; ! else ! ktype = local ? LOCAL_BANNED_NAME : NETWORK_BANNED_NAME; ! reason = ban->reason ? ban->reason : ktype; sendto_one(sptr, err_str(ERR_YOUREBANNEDCREEP), me.name, *************** *** 1709,1712 **** --- 1701,1705 ---- { char silly_buffer[BUFSIZE]; + switch (sptr->user->special) { Index: glines.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/glines.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** glines.c 4 Dec 2005 07:14:07 -0000 1.1 --- glines.c 26 Dec 2005 05:21:38 -0000 1.2 *************** *** 86,90 **** struct userBan *existing; ! if (!OPCanGline(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); --- 86,90 ---- struct userBan *existing; ! if (!IsPrivileged(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); *************** *** 163,167 **** /* only looks for duplicate glines, not akills */ if ((existing = find_userban_exact(ban, UBAN_GLINE))) ! { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s is already %s: %s", me.name, parv[0], user, host, NETWORK_GLINE_NAME, --- 163,168 ---- /* only looks for duplicate glines, not akills */ if ((existing = find_userban_exact(ban, UBAN_GLINE))) ! { ! if (!IsServer(sptr)) sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s is already %s: %s", me.name, parv[0], user, host, NETWORK_GLINE_NAME, *************** *** 171,175 **** } ! if (user_match_ban(sptr, ban)) { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s matches you, rejected", --- 172,176 ---- } ! if (MyClient(sptr) && user_match_ban(sptr, ban)) { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s matches you, rejected", *************** *** 178,183 **** return 0; } - ircsnprintf(rbuf, sizeof(rbuf), "%s (%s)", reason, smalldate(0)); ban->reason = MyMalloc(strlen(rbuf) + 1); strcpy(ban->reason, rbuf); --- 179,188 ---- return 0; } + + if (!IsServer(sptr)) + ircsnprintf(rbuf, sizeof(rbuf), "%s (%s)", reason, smalldate(0)); + else + ircsnprintf(rbuf, sizeof(rbuf), "%s", reason); ban->reason = MyMalloc(strlen(rbuf) + 1); strcpy(ban->reason, rbuf); *************** *** 198,201 **** --- 203,208 ---- host = get_userban_host(ban, rbuf, sizeof(rbuf)); + + sendto_serv_butone(MyConnect(sptr) ? NULL : cptr, ":%s GLINE %l %s@%s :%s", sptr->name, tgseconds, user, host, reason); if (tgminutes) *************** *** 225,229 **** struct userBan *existing; ! if (!OPCanUNGline(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); --- 232,236 ---- struct userBan *existing; ! if (!IsPrivileged(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); *************** *** 270,274 **** if (existing->flags & UBAN_CONF) { ! sendto_one(sptr, ":%s NOTICE %s :UNGline: %s@%s is specified in the" " configuration file and cannot be removed online", me.name, parv[0], user, host); --- 277,281 ---- if (existing->flags & UBAN_CONF) { ! sendto_one(sptr, ":%s NOTICE %s :UNGLINE: %s@%s is specified in the" " configuration file and cannot be removed online", me.name, parv[0], user, host); *************** *** 280,285 **** userban_free(existing); ! sendto_ops("%s has removed the G-Line for: [%s@%s]", parv[0], user, host); ! return 0; } --- 287,292 ---- userban_free(existing); ! sendto_ops("%s has removed the G-Line for: [%s@%s]", sptr->name, user, host); ! sendto_serv_butone(MyConnect(sptr) ? NULL : cptr, ":%s UNGLINE %s@%s", sptr->name, user, host); return 0; } Index: m_server.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_server.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** m_server.c 4 Dec 2005 15:13:20 -0000 1.5 --- m_server.c 26 Dec 2005 05:21:38 -0000 1.6 *************** *** 235,243 **** send_simbans(cptr, SBAN_GCOS|SBAN_NETWORK); - /* We need to send our gline list when we link! - - send_glines(cptr, UBAN_GLINE); - - */ /* Send out fake server list and other 'fake' stuff */ fakeserver_sendserver(cptr); --- 235,238 ---- *************** *** 290,293 **** --- 285,289 ---- sendnick_TS(cptr, acptr); } + sync_lists(cptr); /* Send out shuns and g-lines */ } Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** s_serv.c 4 Dec 2005 16:22:15 -0000 1.13 --- s_serv.c 26 Dec 2005 05:21:38 -0000 1.14 *************** *** 2485,2923 **** #endif /* UNKLINE */ - #if 0 - int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) - { - struct userBan *ban, *oban; - #if defined (LOCKFILE) - struct pgl *g; - #else - int out; - #endif - - char buffer[1024]; - - char *filename; /* filename to use for kline */ - char *user, *host; - char *reason; - char *current_date; - aClient *acptr; - char tempuser[USERLEN + 2]; - char temphost[HOSTLEN + 1]; - int temporary_gline_time = 0; /* -Dianora */ - time_t temporary_gline_time_seconds = 0; - int time_specified = 0; - char *argv; - int i; - char fbuf[512]; - - if (!MyClient(sptr) || !IsAnOper(sptr) || !OPCanGline(sptr)) - { - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); - return 0; - } - - if (parc < 2) - { - sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), - me.name, parv[0], "GLINE"); - return 0; - } - - argv = parv[1]; - - if ((temporary_gline_time = isnumber(argv)) >= 0) - { - if (parc < 3) - { - sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), - me.name, parv[0], "GLINE"); - return 0; - } - if (temporary_gline_time > (24 * 60 * 7)) - temporary_gline_time = (24 * 60 * 7); /* Max it at 1 week */ - - temporary_gline_time_seconds = - (gtime_t) temporary_gline_time *(gtime_t) 60; - - /* turn it into minutes */ - argv = parv[2]; - parc--; - time_specified = 1; - } - else - { - temporary_gline_time = 0; /* -1 minute klines are bad... :) - lucas */ - } - - if(strchr(argv, ' ')) - { - sendto_one(sptr, ":%s NOTICE %s :Poorly formatted hostname " - "(contains spaces). Be sure you are using the form: " - "/quote GLINE [time] <user@host/nick> :<reason>", - me.name, parv[0]); - return 0; - } - - - if ((host = strchr(argv, '@')) || *argv == '*') - { - /* Explicit user@host mask given */ - - if (host) /* Found user@host */ - { - user = argv; /* here is user part */ - *(host++) = '\0'; /* and now here is host */ - } - else - { - user = "*"; /* no @ found, assume its *@somehost */ - host = argv; - } - - if (!*host) /* duh. no host found, assume its '*' host */ - host = "*"; - strncpyzt(tempuser, user, USERLEN + 2); /* allow for '*' in front */ - strncpyzt(temphost, host, HOSTLEN); - user = tempuser; - host = temphost; - } - else - { - /* Try to find user@host mask from nick */ - - if (!(acptr = find_chasing(sptr, argv, NULL))) - return 0; - - if (!acptr->user) - return 0; - - if (IsServer(acptr)) - { - sendto_one(sptr, ":%s NOTICE %s :Can't GLINE a server, use @'s " - "where appropriate", me.name, parv[0]); - return 0; - } - /* - * turn the "user" bit into "*user", blow away '~' if found in - * original user name (non-idented) - */ - - tempuser[0] = '*'; - if (*acptr->user->username == '~') - strcpy(tempuser + 1, (char *) acptr->user->username + 1); - else - strcpy(tempuser + 1, acptr->user->username); - user = tempuser; - host = cluster(acptr->user->host); - } - - if (time_specified) - argv = parv[3]; - else - argv = parv[2]; - - #ifdef DEFAULT_GLINE_TIME - if (time_specified == 0) - { - temporary_gline_time = DEFAULT_GLINE_TIME; - temporary_gline_time_seconds = - (time_t) temporary_gline_time *(time_t) 60; - } - #endif - - if (parc > 2) - { - if (*argv) - reason = argv; - else - reason = "No reason"; - } - else - reason = "No reason"; - - if (!match(user, "akjhfkahfasfjd") && - !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) - { - sendto_one(sptr, ":%s NOTICE %s :Can't G-Line *@*", me.name, - parv[0]); - return 0; - } - - /* we can put whatever we want in temp K: lines */ - if (temporary_gline_time == 0 && strchr(reason, ':')) - { - sendto_one(sptr, - ":%s NOTICE %s :Invalid character ':' in comment", - me.name, parv[0]); - return 0; - } - - if (temporary_gline_time == 0 && strchr(reason, '#')) - { - sendto_one(sptr, - ":%s NOTICE %s :Invalid character '#' in comment", - me.name, parv[0]); - return 0; - } - - ban = make_hostbased_ban(user, host); - if(!ban) - { - sendto_one(sptr, ":%s NOTICE %s :Malformed ban %s@%s", me.name, parv[0], - user, host); - return 0; - } - - if ((oban = find_userban_exact(ban, 0))) - { - char *gtype = (oban->flags & UBAN_GLINE) ? - NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; - - sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", - me.name, parv[0], user, host, gtype, - oban->reason ? oban->reason : "<No Reason>"); - - userban_free(ban); - return 0; - } - - current_date = smalldate((gtime_t) 0); - ircsprintf(buffer, "%s (%s)", reason, current_date); - - ban->flags |= UBAN_GLINE; - ban->reason = (char *) MyMalloc(strlen(buffer) + 1); - strcpy(ban->reason, buffer); - - if (temporary_gline_time) - { - ban->flags |= UBAN_TEMPORARY; - ban->timeset = timeofday; - ban->duration = temporary_gline_time_seconds; - } - - if(user_match_ban(sptr, ban)) - { - sendto_one(sptr, ":%s NOTICE %s :You attempted to add a ban [%s@%s]" - " which would affect yourself. Aborted.", - me.name, parv[0], user, host); - userban_free(ban); - return 0; - } - - add_hostbased_userban(ban); - - /* Check local users against it */ - - userban_sweep(ban); - - host = get_userban_host(ban, fbuf, 512); - - if(temporary_gline_time) - { - sendto_realops("%s added temporary %d min. "NETWORK_GLINE_NAME" for" - " [%s@%s] [%s]", parv[0], temporary_gline_time, user, - host, reason); - return 0; - } - - /* from here on, we're dealing with a perm gline */ - - filename = configfile; - - sendto_one(sptr, ":%s NOTICE %s :Added G-Line [%s@%s] to server " - "configfile", me.name, parv[0], user, host); - - // We need to send glines information to servers ? -Sheik - sendto_serv_butone(cptr, ":%s GLINE %s@%s %l :%s", parv[0], user, host, reason); - - sendto_realops("%s added G-Line for [%s@%s] [%s]", - parv[0], user, host, reason); - - - #if defined(LOCKFILE) - if ((g = (struct pgl *) malloc(sizeof(struct pgl))) == NULL) - { - sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", - me.name, parv[0]); - return (0); - } - - ircsprintf(buffer, "/* %s!%s@%s Added kill for: %s@%s\n" - " * at %s */\n", - sptr->name, sptr->user->username, - sptr->user->host, user, host, current_date); - - if ((g->comment = strdup(buffer)) == NULL) - { - free(k); - sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", - me.name, parv[0]); - return (0); - } - - ircsprintf(buffer, "kill {\n" - " mask \"%s@%s\";\n" - " reason \"%s\";\n" - "};\n\n", - user, host, reason); - - if ((g->gline = strdup(buffer)) == NULL) - { - free(k->comment); - free(k); - sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", - me.name, parv[0]); - return (0); - } - g->next = pending_glines; - pending_glines = g; - - do_pending_glines(); - return (0); - - #else /* LOCKFILE - MDP */ - - if ((out = open(filename, O_RDWR | O_APPEND | O_CREAT)) == -1) - { - sendto_one(sptr, ":%s NOTICE %s :Problem opening %s ", - me.name, parv[0], filename); - return 0; - } - - ircsprintf(buffer, "/* %s!%s@%s Added kill for: %s@%s\n" - " * at %s */\n", - sptr->name, sptr->user->username, - sptr->user->host, user, host, current_date); - - if (write(out, buffer, strlen(buffer)) <= 0) - { - sendto_one(sptr, ":%s NOTICE %s :Problem writing to %s", - me.name, parv[0], filename); - close(out); - return 0; - } - - ircsprintf(buffer, "kill {\n" - " mask \"%s@%s\";\n" - " reason \"%s\";\n" - "};\n\n", - user, host, reason); - - if (write(out, buffer, strlen(buffer)) <= 0) - { - sendto_one(sptr, ":%s NOTICE %s :Problem writing to %s", - me.name, parv[0], filename); - close(out); - return 0; - } - close(out); - - #ifdef USE_SYSLOG - syslog(LOG_NOTICE, "%s added G-Line for [%s@%s] [%s]", parv[0], - user, host, reason); - #endif - - return 0; - #endif /* LOCKFILE */ - } - #endif - - - #if 0 - /* - * * m_ungline - * Added Aug 31, 1997 - * common (Keith Fralick) fr...@ga... - * - * parv[0] = sender - * parv[1] = address to remove - * - * re-worked and cleanedup for use in hybrid-5 -Dianora - * - */ - int m_ungline(aClient *cptr, aClient *sptr, int parc, char *parv[]) - { - struct userBan *ban; - char *user, *host; - - if (!IsAnOper(sptr) || !OPCanUnGline(sptr)) - { - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); - return 0; - } - - if (parc < 2) - { - sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), - me.name, parv[0], "UNGLINE"); - return 0; - } - - if ((host = strchr(parv[1], '@')) || *parv[1] == '*') - { - /* Explicit user@host mask given */ - - if (host) /* Found user@host */ - { - user = parv[1]; /* here is user part */ - *(host++) = '\0'; /* and now here is host */ - } - else - { - user = "*"; /* no @ found, assume its *@somehost */ - host = parv[1]; - } - } - else - { - sendto_one(sptr, ":%s NOTICE %s :Invalid parameters", - me.name, parv[0]); - return 0; - } - - if ((user[0] == '*') && (user[1] == '\0') && (host[0] == '*') && - (host[1] == '\0')) - { - sendto_one(sptr, ":%s NOTICE %s :Cannot UNG-Line everyone", - me.name, parv[0]); - return 0; - } - - ban = make_hostbased_ban(user, host); - if(ban) - { - struct userBan *oban; - - ban->flags |= (UBAN_GLINE|UBAN_TEMPORARY); - if((oban = find_userban_exact(ban, UBAN_GLINE|UBAN_TEMPORARY))) - { - char tmp[512]; - - host = get_userban_host(oban, tmp, 512); - - remove_userban(oban); - glinestore_remove(oban); - userban_free(oban); - userban_free(ban); - - sendto_one(sptr, ":%s NOTICE %s :G-Line for [%s@%s] is removed", - me.name, parv[0], user, host); - // We need to send glines info to servers ? -Sheik - sendto_serv_butone(cptr, ":%s GLINE - %s@%s %l :%s", parv[0], user, host, 1); - - sendto_ops("%s has removed the G-Line for: [%s@%s] (%d matches)", - parv[0], user, host, 1); - - return 0; - } - userban_free(ban); - } - sendto_one(sptr, ":%s NOTICE %s :No Gline matches [%s@%s]", - me.name, parv[0], user, host); - return 0; - } - - #endif /* UNGLINE */ /* m_rehash */ --- 2485,2489 ---- Index: userban.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/userban.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** userban.c 4 Dec 2005 16:22:15 -0000 1.9 --- userban.c 26 Dec 2005 05:21:38 -0000 1.10 *************** *** 540,550 **** kset[0] = 'K'; } ! ! else if (ban->flags & UBAN_GLINE) ! { ! kset[0] = 'g'; ! } ! ! else if (ban->flags & UBAN_SHUN) { kset[0] = 's'; --- 540,548 ---- kset[0] = 'K'; } ! else if (ban->flags & UBAN_GLINE) ! { ! kset[0] = 'g'; ! } ! else if (ban->flags & UBAN_SHUN) { kset[0] = 's'; *************** *** 568,586 **** (ban->reason) ? ban->reason : "No reason"); } - else if (ban->flags & UBAN_SHUN) - { - sendto_one(cptr, ":%s SHUN %d %s@%s :%s", me.name, - (ban->flags & UBAN_TEMPORARY) ? ((ban->duration + ban->timeset) - NOW) : 0, - (ban->flags & UBAN_WILDUSER) ? "*" : ban->u, host, - (ban->reason) ? ban->reason : "No reason"); - } - else if (ban->flags & UBAN_GLINE) - { - sendto_one(cptr, ":%s GLINE %d %s@%s :%s", me.name, - (ban->flags & UBAN_TEMPORARY) ? ((ban->duration + ban->timeset) - NOW) : 0, - (ban->flags & UBAN_WILDUSER) ? "*" : ban->u, host, - (ban->reason) ? ban->reason : "No reason"); - } - bl = LIST_NEXT(bl, lp); } --- 566,569 ---- *************** *** 1619,1646 **** char *reason; char *btext; ! char *ntext; ! //char *gtext; ! //char *stext; int clientonly = 1; int i; ! //if (ban->flags & UBAN_NETWORK) ! if (ban->flags & (UBAN_NETWORK|UBAN_LOCAL|UBAN_GLINE)) ! { ! btext = NETWORK_BANNED_NAME; ntext = NETWORK_BAN_NAME; ! } ! ! else ! { btext = LOCAL_BANNED_NAME; ntext = LOCAL_BAN_NAME; ! ! btext = NETWORK_GLINNED_NAME; ! ntext = NETWORK_GLINE_NAME; ! } ! ! ! if (!(reason = ban->reason)) --- 1602,1619 ---- char *reason; char *btext; ! char *ntext; int clientonly = 1; int i; ! if (ban->flags & UBAN_NETWORK) { ! btext = NETWORK_BANNED_NAME; ntext = NETWORK_BAN_NAME; ! } else if (ban->flags & UBAN_GLINE) { /* Also, include glines now */ ! btext = NETWORK_GLINNED_NAME; ! ntext = NETWORK_GLINE_NAME; ! } else { btext = LOCAL_BANNED_NAME; ntext = LOCAL_BAN_NAME; ! } if (!(reason = ban->reason)) *************** *** 1666,1672 **** sendto_ops("%s active for %s", btext, get_client_name(acptr, FALSE)); - //Send the information to servers. - sendto_serv_butone("%s active for %s", btext, - get_client_name(acptr, FALSE)); exit_client(acptr, acptr, &me, rbuf); i--; --- 1639,1642 ---- *************** *** 1827,1831 **** } ! static inline void sync_me(aClient *cptr, uBanEnt *bl) { --- 1797,1801 ---- } ! /* Revised for shuns and g-lines */ static inline void sync_me(aClient *cptr, uBanEnt *bl) { *************** *** 1838,1844 **** if (ban->flags & UBAN_SHUN) ! sendto_one(cptr, ":%s SHUN %d %s@%s :%s", me.name, ban->duration, ban->u ? ban->u : "*", ban->h ? ban->h : "*", ban->reason); - bl = bln; } --- 1808,1816 ---- if (ban->flags & UBAN_SHUN) ! sendto_one(cptr, ":%s SHUN %l %s@%s :%s", me.name, ban->duration, ! ban->u ? ban->u : "*", ban->h ? ban->h : "*", ban->reason); ! else if (ban->flags & UBAN_GLINE) ! sendto_one(cptr, ":%s GLINE %l %s@%s :%s", me.name, ban->duration, ban->u ? ban->u : "*", ban->h ? ban->h : "*", ban->reason); bl = bln; } Index: ircd.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/ircd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ircd.c 4 Sep 2005 05:24:13 -0000 1.6 --- ircd.c 26 Dec 2005 05:21:38 -0000 1.7 *************** *** 145,148 **** --- 145,152 ---- time_t nextbanexpire = 1; /* next time to expire the throttles/userbans */ + #ifdef TOYS + extern void init_chef(); + #endif + #ifdef PROFILING extern void _start, etext; *************** *** 851,855 **** initclass(); ! if(initconf(configfile) == -1) { --- 855,861 ---- initclass(); ! #ifdef TOYS ! init_chef(); /* siwwy wabbit, ewmew wont wowk widout initiawizing it fiwst! - tux */ ! #endif if(initconf(configfile) == -1) { Index: m_shun.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_shun.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** m_shun.c 27 Jun 2005 03:02:32 -0000 1.1.1.1 --- m_shun.c 26 Dec 2005 05:21:38 -0000 1.2 *************** *** 163,170 **** send_globops("Shun added for (%s@%s) by %s, expires in %d seconds (Reason: %s)", user, host, parv[0], shun_time, buffer); ! sendto_serv_butone(NULL, ":%s SHUN %d %s@%s :%s", me.name, shun_time, user, host, buffer); } else ! sendto_serv_butone(cptr, ":%s SHUN %d %s@%s :%s", me.name, shun_time, user, host, buffer); return 0; --- 163,170 ---- send_globops("Shun added for (%s@%s) by %s, expires in %d seconds (Reason: %s)", user, host, parv[0], shun_time, buffer); ! sendto_serv_butone(NULL, ":%s SHUN %d %s@%s :%s", parv[0], shun_time, user, host, buffer); } else ! sendto_serv_butone(cptr, ":%s SHUN %d %s@%s :%s", parv[0], shun_time, user, host, buffer); return 0; *************** *** 247,254 **** { send_globops("Shun for [%s@%s] removed by %s.", user, host, parv[0]); ! sendto_serv_butone(NULL, ":%s UNSHUN %s@%s", me.name, user, host); } else ! sendto_serv_butone(cptr, ":%s UNSHUN %s@%s", me.name, user, host); --- 247,254 ---- { send_globops("Shun for [%s@%s] removed by %s.", user, host, parv[0]); ! sendto_serv_butone(NULL, ":%s UNSHUN %s@%s", parv[0], user, host); } else ! sendto_serv_butone(cptr, ":%s UNSHUN %s@%s", parv[0], user, host); |
From: Juan B. <tu...@us...> - 2005-12-26 05:21:46
|
Update of /cvsroot/solidircd/solidircd-stable/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29183/include Modified Files: config.h patchlevel.h Log Message: Read CHANGES log Index: config.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** config.h 4 Dec 2005 14:40:45 -0000 1.14 --- config.h 26 Dec 2005 05:21:38 -0000 1.15 *************** *** 225,229 **** */ ! #undef TOYS /* File names --- 225,229 ---- */ ! #define TOYS /* File names Index: patchlevel.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/patchlevel.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** patchlevel.h 27 Jun 2005 03:02:52 -0000 1.1.1.1 --- patchlevel.h 26 Dec 2005 05:21:38 -0000 1.2 *************** *** 32,36 **** #define MAJOR 3 #define MINOR 4 ! #define PATCH 7 #define PATCHES "stable" --- 32,36 ---- #define MAJOR 3 #define MINOR 4 ! #define PATCH 8 #define PATCHES "stable" |
From: Juan B. <tu...@us...> - 2005-12-26 05:21:46
|
Update of /cvsroot/solidircd/solidircd-stable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29183 Modified Files: CHANGES Log Message: Read CHANGES log Index: CHANGES =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/CHANGES,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CHANGES 4 Sep 2005 06:48:20 -0000 1.8 --- CHANGES 26 Dec 2005 05:21:37 -0000 1.9 *************** *** 15,18 **** --- 15,23 ---- Changes from Tux --------------- + 25/12/2005 - Fixed elmer issue. + 25/12/2005 - Fixed g-line message issue. + 25/12/2005 - Fixed g-line not being sent to other servers. + 25/12/2005 - Fixed shun not being sent to other servers either. + 25/12/2005 - Fixed a nasty code in userban_sweep. 09/07/2005 - Fixed 'free_func' FreeBSD compilation error. 09/07/2005 - Fixed rquit. |
From: Juan B. <tu...@us...> - 2005-12-26 05:21:46
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29183/zlib Modified Files: Makefile zconf.h Log Message: Read CHANGES log Index: zconf.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/zconf.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** zconf.h 4 Dec 2005 15:13:20 -0000 1.11 --- zconf.h 26 Dec 2005 05:21:38 -0000 1.12 *************** *** 276,280 **** #endif ! #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ # include <sys/types.h> /* for off_t */ # include <unistd.h> /* for SEEK_* and off_t */ --- 276,280 ---- #endif ! #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */ # include <sys/types.h> /* for off_t */ # include <unistd.h> /* for SEEK_* and off_t */ Index: Makefile =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 9 Jul 2005 23:30:03 -0000 1.3 --- Makefile 26 Dec 2005 05:21:38 -0000 1.4 *************** *** 17,23 **** # make install prefix=$HOME ! CC=cc ! CFLAGS=-O #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG --- 17,23 ---- # make install prefix=$HOME ! CC=gcc ! CFLAGS=-O3 -DUSE_MMAP #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG *************** *** 25,31 **** # -Wstrict-prototypes -Wmissing-prototypes ! LDFLAGS=libz.a ! LDSHARED=$(CC) ! CPP=$(CC) -E LIBS=libz.a --- 25,31 ---- # -Wstrict-prototypes -Wmissing-prototypes ! LDFLAGS=-L. libz.a ! LDSHARED=gcc ! CPP=gcc -E LIBS=libz.a *************** *** 40,48 **** EXE= ! prefix = /usr/local ! exec_prefix = ${prefix} ! libdir = ${exec_prefix}/lib ! includedir = ${prefix}/include ! mandir = ${prefix}/share/man man3dir = ${mandir}/man3 --- 40,48 ---- EXE= ! prefix =/usr/local ! exec_prefix =${prefix} ! libdir =${exec_prefix}/lib ! includedir =${prefix}/include ! mandir =${prefix}/share/man man3dir = ${mandir}/man3 |
From: Gabriel B. <sh...@us...> - 2005-12-04 16:22:23
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19088/src Modified Files: s_serv.c userban.c Log Message: more updates. Index: userban.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/userban.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** userban.c 4 Dec 2005 14:40:45 -0000 1.8 --- userban.c 4 Dec 2005 16:22:15 -0000 1.9 *************** *** 1666,1669 **** --- 1666,1672 ---- sendto_ops("%s active for %s", btext, get_client_name(acptr, FALSE)); + //Send the information to servers. + sendto_serv_butone("%s active for %s", btext, + get_client_name(acptr, FALSE)); exit_client(acptr, acptr, &me, rbuf); i--; Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** s_serv.c 4 Dec 2005 15:13:20 -0000 1.12 --- s_serv.c 4 Dec 2005 16:22:15 -0000 1.13 *************** *** 2729,2733 **** // We need to send glines information to servers ? -Sheik ! sendto_serv_butone(cptr, ":%s GLINE %s@%s %l :%s",parv[0], user, host, reason); sendto_realops("%s added G-Line for [%s@%s] [%s]", --- 2729,2733 ---- // We need to send glines information to servers ? -Sheik ! sendto_serv_butone(cptr, ":%s GLINE %s@%s %l :%s", parv[0], user, host, reason); sendto_realops("%s added G-Line for [%s@%s] [%s]", |
From: Gabriel B. <sh...@us...> - 2005-12-04 15:13:53
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9201/src Modified Files: m_server.c s_serv.c Log Message: more gline reference need to make gline to broadcast glines across servers. Index: m_server.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_server.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** m_server.c 9 Jul 2005 23:30:03 -0000 1.4 --- m_server.c 4 Dec 2005 15:13:20 -0000 1.5 *************** *** 235,238 **** --- 235,243 ---- send_simbans(cptr, SBAN_GCOS|SBAN_NETWORK); + /* We need to send our gline list when we link! + + send_glines(cptr, UBAN_GLINE); + + */ /* Send out fake server list and other 'fake' stuff */ fakeserver_sendserver(cptr); Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** s_serv.c 4 Dec 2005 08:43:13 -0000 1.11 --- s_serv.c 4 Dec 2005 15:13:20 -0000 1.12 *************** *** 2728,2733 **** --- 2728,2737 ---- "configfile", me.name, parv[0], user, host); + // We need to send glines information to servers ? -Sheik + sendto_serv_butone(cptr, ":%s GLINE %s@%s %l :%s",parv[0], user, host, reason); + sendto_realops("%s added G-Line for [%s@%s] [%s]", parv[0], user, host, reason); + #if defined(LOCKFILE) *************** *** 2900,2903 **** --- 2904,2910 ---- sendto_one(sptr, ":%s NOTICE %s :G-Line for [%s@%s] is removed", me.name, parv[0], user, host); + // We need to send glines info to servers ? -Sheik + sendto_serv_butone(cptr, ":%s GLINE - %s@%s %l :%s", parv[0], user, host, 1); + sendto_ops("%s has removed the G-Line for: [%s@%s] (%d matches)", parv[0], user, host, 1); |
From: Gabriel B. <sh...@us...> - 2005-12-04 15:13:53
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9201/zlib Modified Files: zconf.h Log Message: more gline reference need to make gline to broadcast glines across servers. |
From: Gabriel B. <sh...@us...> - 2005-12-04 14:41:09
|
Update of /cvsroot/solidircd/solidircd-stable/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2900/include Modified Files: config.h Log Message: added stats for gline. Index: config.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** config.h 4 Dec 2005 07:14:07 -0000 1.13 --- config.h 4 Dec 2005 14:40:45 -0000 1.14 *************** *** 613,617 **** */ #define NO_USER_SERVERKILLS ! /* #undef NO_USER_OPERKILLS */ /* #undef NO_USER_STATS */ --- 613,617 ---- */ #define NO_USER_SERVERKILLS ! #define NO_USER_OPERKILLS /* #undef NO_USER_STATS */ *************** *** 621,627 **** /* #undef NO_USER_OPERTARGETED_COMMANDS */ /* #undef HIDE_NUMERIC_SOURCE */ ! /* #undef HIDE_KILL_ORIGINS */ /* #undef HIDE_SPLIT_SERVERS */ ! /* #undef HIDE_SERVERMODE_ORIGINS */ /***********************/ --- 621,627 ---- /* #undef NO_USER_OPERTARGETED_COMMANDS */ /* #undef HIDE_NUMERIC_SOURCE */ ! #define HIDE_KILL_ORIGINS /* #undef HIDE_SPLIT_SERVERS */ ! #define HIDE_SERVERMODE_ORIGINS /***********************/ |
From: Gabriel B. <sh...@us...> - 2005-12-04 14:41:09
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2900/zlib Modified Files: zconf.h Log Message: added stats for gline. |
From: Gabriel B. <sh...@us...> - 2005-12-04 14:41:09
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2900/src Modified Files: m_stats.c userban.c Log Message: added stats for gline. Index: userban.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/userban.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** userban.c 4 Dec 2005 07:39:03 -0000 1.7 --- userban.c 4 Dec 2005 14:40:45 -0000 1.8 *************** *** 1620,1636 **** char *btext; char *ntext; int clientonly = 1; int i; ! if (ban->flags & UBAN_NETWORK) { btext = NETWORK_BANNED_NAME; ntext = NETWORK_BAN_NAME; } ! else { ! btext = LOCAL_BANNED_NAME; ntext = LOCAL_BAN_NAME; ! } --- 1620,1645 ---- char *btext; char *ntext; + //char *gtext; + //char *stext; int clientonly = 1; int i; ! //if (ban->flags & UBAN_NETWORK) ! if (ban->flags & (UBAN_NETWORK|UBAN_LOCAL|UBAN_GLINE)) { btext = NETWORK_BANNED_NAME; ntext = NETWORK_BAN_NAME; } ! ! else { ! btext = LOCAL_BANNED_NAME; ntext = LOCAL_BAN_NAME; ! ! btext = NETWORK_GLINNED_NAME; ! ntext = NETWORK_GLINE_NAME; ! } ! ! Index: m_stats.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/m_stats.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** m_stats.c 5 Jul 2005 03:17:53 -0000 1.3 --- m_stats.c 4 Dec 2005 14:40:45 -0000 1.4 *************** *** 764,767 **** --- 764,775 ---- break; + /* Added G-line Stats -Sheik 04-DEC-2005 */ + case 'b': + if (IsAnOper(sptr)) + report_userbans_match_flags(sptr, UBAN_GLINE, UBAN_TEMPORARY); + else + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + break; + case 'A': case 'a': |
From: Gabriel B. <sh...@us...> - 2005-12-04 08:43:27
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3445/zlib Modified Files: zconf.h Log Message: added rehash to clean up temp glines. |
From: Gabriel B. <sh...@us...> - 2005-12-04 08:43:27
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3445/src Modified Files: s_err.c s_serv.c s_user.c Log Message: added rehash to clean up temp glines. Index: s_user.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_user.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** s_user.c 4 Dec 2005 07:39:03 -0000 1.15 --- s_user.c 4 Dec 2005 08:43:13 -0000 1.16 *************** *** 1315,1318 **** --- 1315,1320 ---- "htm", "zip", + "rar", + "sit", NULL }; *************** *** 2965,2970 **** #endif #ifdef ALL_OPERS_HIDDEN ! sptr->umode |= UMODE_W; ! sendto_serv_butone(cptr, ":%s MODE %s :+W", parv[0], parv[0]); #endif Count.oper++; --- 2967,2972 ---- #endif #ifdef ALL_OPERS_HIDDEN ! sptr->umode |= UMODE_H; ! sendto_serv_butone(cptr, ":%s MODE %s :+H", parv[0], parv[0]); #endif Count.oper++; Index: s_err.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_err.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** s_err.c 27 Jun 2005 03:02:04 -0000 1.1.1.1 --- s_err.c 4 Dec 2005 08:43:13 -0000 1.2 *************** *** 350,354 **** /* 318 RPL_ENDOFWHOIS */ ":%s 318 %s %s :End of /WHOIS list.", /* 319 RPL_WHOISCHANNELS */ ":%s 319 %s %s :%s", ! /* 320 RPL_WHOISMODES */ ":%s 320 %s %s is using umodes [%s]", /* 321 RPL_LISTSTART */ ":%s 321 %s Channel :Users Name", /* 322 RPL_LIST */ ":%s 322 %s %s %d :%s", --- 350,354 ---- /* 318 RPL_ENDOFWHOIS */ ":%s 318 %s %s :End of /WHOIS list.", /* 319 RPL_WHOISCHANNELS */ ":%s 319 %s %s :%s", ! /* 320 RPL_WHOISMODES */ ":%s 320 %s %s is using modes [%s]", /* 321 RPL_LISTSTART */ ":%s 321 %s Channel :Users Name", /* 322 RPL_LIST */ ":%s 322 %s %s %d :%s", Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** s_serv.c 4 Dec 2005 07:39:03 -0000 1.10 --- s_serv.c 4 Dec 2005 08:43:13 -0000 1.11 *************** *** 93,96 **** --- 93,97 ---- /* Shadowfax's lockfile code */ void do_pending_klines(void); + void do_pending_glines(void); struct pkl *************** *** 103,106 **** --- 104,117 ---- time_t pending_kline_time = 0; + + struct pgl + { + char *comment; /* Kline Comment */ + char *gline; /* Actual Kline */ + struct pgl *next; /* Next Pending Kline */ + } *pending_glines = NULL; + + gtime_t pending_gline_time = 0; + #endif /* LOCKFILE */ *************** *** 2479,2483 **** struct userBan *ban, *oban; #if defined (LOCKFILE) ! struct pkl *k; #else int out; --- 2490,2494 ---- struct userBan *ban, *oban; #if defined (LOCKFILE) ! struct pgl *g; #else int out; *************** *** 2527,2531 **** temporary_gline_time_seconds = ! (time_t) temporary_gline_time *(time_t) 60; /* turn it into minutes */ --- 2538,2542 ---- temporary_gline_time_seconds = ! (gtime_t) temporary_gline_time *(gtime_t) 60; /* turn it into minutes */ *************** *** 2606,2613 **** argv = parv[2]; ! #ifdef DEFAULT_KLINE_TIME if (time_specified == 0) { ! temporary_gline_time = DEFAULT_KLINE_TIME; temporary_gline_time_seconds = (time_t) temporary_gline_time *(time_t) 60; --- 2617,2624 ---- argv = parv[2]; ! #ifdef DEFAULT_GLINE_TIME if (time_specified == 0) { ! temporary_gline_time = DEFAULT_GLINE_TIME; temporary_gline_time_seconds = (time_t) temporary_gline_time *(time_t) 60; *************** *** 2671,2675 **** } ! current_date = smalldate((time_t) 0); ircsprintf(buffer, "%s (%s)", reason, current_date); --- 2682,2686 ---- } ! current_date = smalldate((gtime_t) 0); ircsprintf(buffer, "%s (%s)", reason, current_date); *************** *** 2721,2725 **** #if defined(LOCKFILE) ! if ((k = (struct pkl *) malloc(sizeof(struct pkl))) == NULL) { sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", --- 2732,2736 ---- #if defined(LOCKFILE) ! if ((g = (struct pgl *) malloc(sizeof(struct pgl))) == NULL) { sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", *************** *** 2733,2737 **** sptr->user->host, user, host, current_date); ! if ((k->comment = strdup(buffer)) == NULL) { free(k); --- 2744,2748 ---- sptr->user->host, user, host, current_date); ! if ((g->comment = strdup(buffer)) == NULL) { free(k); *************** *** 2747,2751 **** user, host, reason); ! if ((k->kline = strdup(buffer)) == NULL) { free(k->comment); --- 2758,2762 ---- user, host, reason); ! if ((g->gline = strdup(buffer)) == NULL) { free(k->comment); *************** *** 2755,2760 **** return (0); } ! k->next = pending_glines; ! pending_glines = k; do_pending_glines(); --- 2766,2771 ---- return (0); } ! g->next = pending_glines; ! pending_glines = g; do_pending_glines(); *************** *** 2933,2936 **** --- 2944,2958 ---- return 0; } + /* Rehash & remove Temporary Glines - Sheik 03-DEC-2005 */ + + else if (mycmp(parv[1], "TGLINES") == 0) + { + sendto_one(sptr, rpl_str(RPL_REHASHING), me.name, parv[0], + "temp glines"); + remove_userbans_match_flags(UBAN_GLINE|UBAN_TEMPORARY, 0); + sendto_ops("%s is clearing temp glines while whistling innocently", + parv[0]); + return 0; + } else if (mycmp(parv[1], "GC") == 0) { |
From: Gabriel B. <sh...@us...> - 2005-12-04 07:39:13
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1242/src Modified Files: s_serv.c s_user.c userban.c Log Message: minor updates. Index: userban.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/userban.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** userban.c 4 Dec 2005 07:14:07 -0000 1.6 --- userban.c 4 Dec 2005 07:39:03 -0000 1.7 *************** *** 1633,1636 **** --- 1633,1637 ---- ntext = LOCAL_BAN_NAME; } + if (!(reason = ban->reason)) Index: s_user.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_user.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** s_user.c 4 Dec 2005 07:14:07 -0000 1.14 --- s_user.c 4 Dec 2005 07:39:03 -0000 1.15 *************** *** 944,948 **** char *reason, *ktype; int local; ! /* char *gtype; int global; --- 944,948 ---- char *reason, *ktype; int local; ! char *gtype; int global; *************** *** 951,955 **** gtype = global ? NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; reason = ban->reason ? ban->reason : gtype; ! */ local = (ban->flags & UBAN_LOCAL) ? 1 : 0; --- 951,955 ---- gtype = global ? NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; reason = ban->reason ? ban->reason : gtype; ! local = (ban->flags & UBAN_LOCAL) ? 1 : 0; Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** s_serv.c 4 Dec 2005 07:14:07 -0000 1.9 --- s_serv.c 4 Dec 2005 07:39:03 -0000 1.10 *************** *** 2628,2632 **** !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) { ! sendto_one(sptr, ":%s NOTICE %s :Can't K-Line *@*", me.name, parv[0]); return 0; --- 2628,2632 ---- !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) { ! sendto_one(sptr, ":%s NOTICE %s :Can't G-Line *@*", me.name, parv[0]); return 0; *************** *** 2661,2665 **** { char *gtype = (oban->flags & UBAN_GLINE) ? ! NETWORK_GLINE_NAME : NETWORK_GLINNE_NAME; sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", --- 2661,2665 ---- { char *gtype = (oban->flags & UBAN_GLINE) ? ! NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", *************** *** 2710,2714 **** } ! /* from here on, we're dealing with a perm kline */ filename = configfile; --- 2710,2714 ---- } ! /* from here on, we're dealing with a perm gline */ filename = configfile; |
From: Gabriel B. <sh...@us...> - 2005-12-04 07:39:13
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1242/zlib Modified Files: zconf.h Log Message: minor updates. |
From: Gabriel B. <sh...@us...> - 2005-12-04 07:14:17
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30793/src Modified Files: Makefile.in s_conf.c s_serv.c s_user.c userban.c Added Files: glines.c Log Message: minor updates, currently working on gline implementation. Index: Makefile.in =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.in 4 Sep 2005 18:57:33 -0000 1.6 --- Makefile.in 4 Dec 2005 07:14:07 -0000 1.7 *************** *** 20,24 **** SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ ! fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c klines.c list.c \ m_shun.c m_nick.c m_rwho.c m_server.c m_services.c m_stats.c m_who.c match.c \ memcount.c modules.c packet.c parse.c pcre.c probability.c res.c \ --- 20,24 ---- SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ ! fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c klines.c glines.c list.c \ m_shun.c m_nick.c m_rwho.c m_server.c m_services.c m_stats.c m_who.c match.c \ memcount.c modules.c packet.c parse.c pcre.c probability.c res.c \ *************** *** 141,144 **** --- 141,149 ---- ../include/fdlist.h ../include/ircsprintf.h ../include/find.h \ ../include/userban.h ../include/numeric.h + glines.o: glines.c ../include/struct.h ../include/config.h \ + ../include/setup.h ../include/defs.h ../include/sys.h ../include/hash.h \ + ../include/sbuf.h ../include/common.h ../include/h.h ../include/send.h \ + ../include/fdlist.h ../include/ircsprintf.h ../include/find.h \ + ../include/userban.h ../include/numeric.h list.o: list.c ../include/struct.h ../include/config.h ../include/setup.h \ ../include/defs.h ../include/sys.h ../include/hash.h ../include/sbuf.h \ Index: s_conf.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_conf.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** s_conf.c 4 Sep 2005 05:24:13 -0000 1.9 --- s_conf.c 4 Dec 2005 07:14:07 -0000 1.10 *************** *** 1539,1564 **** return lnum; /* this isnt a parser problem - dont pull out */ ! ban->flags |= (UBAN_LOCAL|UBAN_CONF); DupString(ban->reason, ub_r); ban->timeset = NOW; add_hostbased_userban(ban); - /* Check local users against it */ - for (i = 0; i <= highest_fd; i++) - { - if (!(ub_acptr = local[i]) || IsMe(ub_acptr) || - IsLog(ub_acptr)) - continue; - - if (IsPerson(ub_acptr) && user_match_ban(ub_acptr, ban)) - { - sendto_ops(LOCAL_BAN_NAME " active for %s", - get_client_name(ub_acptr, FALSE)); - ircsprintf(fbuf, LOCAL_BANNED_NAME ": %s", ub_r); - exit_client(ub_acptr, ub_acptr, &me, fbuf); - i--; - } - } return lnum; } --- 1539,1549 ---- return lnum; /* this isnt a parser problem - dont pull out */ ! ban->flags |= (UBAN_LOCAL|UBAN_CONF); DupString(ban->reason, ub_r); ban->timeset = NOW; add_hostbased_userban(ban); + userban_sweep(ban); return lnum; } Index: s_user.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_user.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** s_user.c 4 Sep 2005 05:24:13 -0000 1.13 --- s_user.c 4 Dec 2005 07:14:07 -0000 1.14 *************** *** 938,941 **** --- 938,942 ---- get_client_name(sptr, FALSE)); } + else { *************** *** 943,946 **** --- 944,955 ---- char *reason, *ktype; int local; + /* + char *gtype; + int global; + + global = (ban->flags & UBAN_GLINE) ? 1 : 0; + gtype = global ? NETWORK_GLINE_NAME : NETWORK_GLINNED_NAME; + reason = ban->reason ? ban->reason : gtype; + */ local = (ban->flags & UBAN_LOCAL) ? 1 : 0; *************** *** 948,951 **** --- 957,962 ---- reason = ban->reason ? ban->reason : ktype; + + sendto_one(sptr, err_str(ERR_YOUREBANNEDCREEP), me.name, sptr->name, ktype); *************** *** 971,974 **** --- 982,987 ---- return exit_client(cptr, sptr, &me, reason); } + + } --- NEW FILE: glines.c --- /* * glines.c - gline interface and storage * Copyright (C) 2005 Trevor Talbot and * the DALnet coding team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* $Id: glines.c,v 1.1 2005/12/04 07:14:07 sheik Exp $ */ /* * This is a simple K-Line journal implementation. When a K-Line with a * duration greater than gline_MIN_STORE_TIME is added, it is written to the * journal file (.glines): * + expireTS usermask hostmask reason * * When a K-Line is manually removed, it also results in a journal entry: * - usermask hostmask * * This allows K-Lines to be saved across restarts and rehashes. * * To keep the journal from getting larger than it needs to be, it is * periodically compacted: all active K-Lines are dumped into a new file, which * then replaces the active journal. This is done on startup as well as every * gline_STORE_COMPACT_THRESH journal entries. */ #include "struct.h" #include "common.h" #include "sys.h" #include "h.h" #include <fcntl.h> #include "userban.h" #include "numeric.h" static int journal = -1; static char journalfilename[512]; static int journalcount; void glinestore_add(struct userBan *); void glinestore_remove(struct userBan *); /* ircd.c */ extern int forked; /* s_misc.c */ extern char *smalldate(time_t); /* * m_gline * Add a local user@host ban. * * parv[0] = sender * parv[1] = duration (optional) * parv[2] = nick or user@host mask * parv[3] = reason (optional) */ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { char rbuf[512]; char *target; char *user; char *host; char *reason = "<no reason>"; int tgminutes = DEFAULT_GLINE_TIME; int tgseconds; long lval; struct userBan *ban; struct userBan *existing; if (!OPCanGline(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); return 0; } if (parc < 2) { sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "gline"); return 0; } lval = strtol(parv[1], &target, 10); if (*target != 0) { target = parv[1]; if (parc > 2) reason = parv[2]; } else { /* valid expiration time */ tgminutes = lval; if (parc < 3) { sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "Gline"); return 0; } target = parv[2]; if (parc > 3) reason = parv[3]; } /* negative times, or times greater than a year, are permanent */ if (tgminutes < 0 || tgminutes > (365 * 24 * 60)) tgminutes = 0; tgseconds = tgminutes * 60; if ((host = strchr(target, '@'))) { *host++ = 0; user = target; } else { user = "*"; host = target; } if (!match(user, "akjhfkahfasfjd") && !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s mask is too wide", me.name, parv[0], user, host); return 0; } /* * XXX: nick target support to be re-added */ if (!(ban = make_hostbased_ban(user, host))) { sendto_one(sptr, ":%s NOTICE %s :gline: invalid ban mask %s@%s", me.name, parv[0], user, host); return 0; } ban->flags |= UBAN_GLINE; /* only looks for duplicate glines, not akills */ if ((existing = find_userban_exact(ban, UBAN_GLINE))) { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s is already %s: %s", me.name, parv[0], user, host, NETWORK_GLINE_NAME, existing->reason ? existing->reason : "<no reason>"); userban_free(ban); return 0; } if (user_match_ban(sptr, ban)) { sendto_one(sptr, ":%s NOTICE %s :gline: %s@%s matches you, rejected", me.name, parv[0], user, host); userban_free(ban); return 0; } ircsnprintf(rbuf, sizeof(rbuf), "%s (%s)", reason, smalldate(0)); ban->reason = MyMalloc(strlen(rbuf) + 1); strcpy(ban->reason, rbuf); if (tgseconds) { ban->flags |= UBAN_TEMPORARY; ban->timeset = NOW; ban->duration = tgseconds; } add_hostbased_userban(ban); if (!tgminutes || tgminutes >= GLINE_MIN_STORE_TIME) glinestore_add(ban); userban_sweep(ban); host = get_userban_host(ban, rbuf, sizeof(rbuf)); if (tgminutes) sendto_realops("%s added temporary %d min. "NETWORK_GLINE_NAME" for" " [%s@%s] [%s]", parv[0], tgminutes, user, host, reason); else sendto_realops("%s added "NETWORK_GLINE_NAME" for [%s@%s] [%s]", parv[0], user, host, reason); return 0; } /* * m_ungline * Remove a local user@host ban. * * parv[0] = sender * parv[1] = user@host mask */ int m_ungline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { char hbuf[512]; char *user; char *host; struct userBan *ban; struct userBan *existing; if (!OPCanUNGline(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); return 0; } if (parc < 2) { sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "UNGline"); return 0; } if ((host = strchr(parv[1], '@'))) { *host++ = 0; user = parv[1]; } else { user = "*"; host = parv[1]; } if (!(ban = make_hostbased_ban(user, host))) { sendto_one(sptr, ":%s NOTICE %s :UNGline: No such ban %s@%s", me.name, parv[0], user, host); return 0; } ban->flags |= UBAN_GLINE; existing = find_userban_exact(ban, UBAN_GLINE); host = get_userban_host(ban, hbuf, sizeof(hbuf)); userban_free(ban); if (!existing) { sendto_one(sptr, ":%s NOTICE %s :UNGLINE: No such ban %s@%s", me.name, parv[0], user, host); return 0; } if (existing->flags & UBAN_CONF) { sendto_one(sptr, ":%s NOTICE %s :UNGline: %s@%s is specified in the" " configuration file and cannot be removed online", me.name, parv[0], user, host); return 0; } remove_userban(existing); glinestore_remove(existing); userban_free(existing); sendto_ops("%s has removed the G-Line for: [%s@%s]", parv[0], user, host); return 0; } static void gs_error(char *msg) { if (!forked) puts(msg); else sendto_ops("%s", msg); } /* * Writes a G-Line to the appropriate file. */ void gs_write(int f, char type, struct userBan *ub) { char outbuf[1024]; char cidr[4] = ""; time_t expiretime = 0; char *user = "*"; char *reason = ""; char *host = ub->h; int len; /* userban.c */ unsigned int netmask_to_cidr(unsigned int); if (ub->flags & UBAN_TEMPORARY) expiretime = ub->timeset + ub->duration; if (ub->u) user = ub->u; if (ub->reason) reason = ub->reason; if (ub->flags & (UBAN_CIDR4|UBAN_CIDR4BIG)) { host = inetntoa((char *)&ub->cidr4ip); ircsprintf(cidr, "/%d", netmask_to_cidr(ntohl(ub->cidr4mask))); } if (type == '+') len = ircsprintf(outbuf, "%c %d %s %s%s %s\n", type, (int)expiretime, user, host, cidr, reason); else len = ircsprintf(outbuf, "%c %s %s%s\n", type, user, host, cidr); write(f, outbuf, len); } /* * Parses a G-Line entry from a storage journal line. * Returns 0 on invalid input, 1 otherwise. */ static int gs_read(char *s) { char type; time_t duration = 0; char *user; char *host; char *reason = ""; struct userBan *ban; struct userBan *existing; type = *s++; /* bad type */ if (type != '+' && type != '-') return 0; /* malformed */ if (*s++ != ' ') return 0; if (type == '+') { duration = strtol(s, &s, 0); if (duration) { /* already expired */ if (NOW >= duration) return 1; duration -= NOW; } /* malformed */ if (*s++ != ' ') return 0; } /* usermask */ user = s; while (*s && *s != ' ') s++; /* malformed */ if (*s != ' ') return 0; /* mark end of user mask */ *s++ = 0; /* hostmask */ host = s; while (*s && *s != ' ') s++; if (type == '+') { /* malformed */ if (*s != ' ') return 0; /* mark end of host mask */ *s++ = 0; /* reason is the only thing left */ reason = s; } ban = make_hostbased_ban(user, host); if (!ban) return 0; ban->flags |= UBAN_GLINE; if (type == '+') { if (duration) { ban->flags |= UBAN_TEMPORARY; ban->timeset = NOW; ban->duration = duration; } if (*reason) DupString(ban->reason, reason); add_hostbased_userban(ban); } else { existing = find_userban_exact(ban, UBAN_GLINE|UBAN_CONF); userban_free(ban); /* add may have been skipped due to being expired, so not an error */ if (!existing) return 1; remove_userban(existing); userban_free(existing); } return 1; } /* * Compact G-Line store: dump active glines to a new file and remove the * current journal. * Returns 1 on success, 0 on failure. */ int glinestore_compact(void) { char buf1[512]; int newfile; /* userban.c */ extern void gs_dumpglines(int); if (forked) sendto_ops_lev(DEBUG_LEV, "Compacting G-Line store..."); journalcount = 0; /* open a compaction file to dump all active glines to */ ircsnprintf(buf1, sizeof(buf1), "%s/.glines_c", dpath); newfile = open(buf1, O_WRONLY|O_CREAT|O_TRUNC, 0700); if (newfile < 0) { ircsnprintf(buf1, sizeof(buf1), "ERROR: Unable to create G-Line" " compaction file .glines_c: %s", strerror(errno)); gs_error(buf1); return 0; } /* do the dump */ gs_dumpglines(newfile); close(newfile); /* close active storage file, rename compaction file, and reopen */ if (journal >= 0) { close(journal); journal = -1; } if (rename(buf1, journalfilename) < 0) { ircsnprintf(buf1, sizeof(buf1), "ERROR: Unable to rename G-Line" " compaction file .glines_c to .glines: %s", strerror(errno)); gs_error(buf1); return 0; } journal = open(journalfilename, O_WRONLY|O_APPEND, 0700); if (journal < 0) { ircsnprintf(buf1, sizeof(buf1), "ERROR: Unable to reopen G-Line" " storage file .glines: %s", strerror(errno)); gs_error(buf1); return 0; } return 1; } /* * Add a G-Line to the active store. */ void glinestore_add(struct userBan *ban) { if (journal >= 0) gs_write(journal, '+', ban); if (++journalcount > GLINE_STORE_COMPACT_THRESH) glinestore_compact(); } /* * Remove a G-Line from the active store. */ void glinestore_remove(struct userBan *ban) { if (journal >= 0) gs_write(journal, '-', ban); if (++journalcount > GLINE_STORE_COMPACT_THRESH) glinestore_compact(); } /* * Initialize G-Line storage. Pass 1 when glines don't need to be reloaded. * Returns 0 on failure, 1 otherwise. */ int glinestore_init(int noreload) { char buf1[1024]; FILE *jf; ircsnprintf(journalfilename, sizeof(journalfilename), "%s/.glines", dpath); if (journal >= 0) { if (noreload) return 1; close(journal); journal = -1; } /* "a+" to create if it doesn't exist */ jf = fopen(journalfilename, "a+"); if (!jf) { ircsnprintf(buf1, sizeof(buf1), "ERROR: Unable to open G-Line storage" " file .glines: %s", strerror(errno)); gs_error(buf1); return 0; } rewind(jf); /* replay journal */ while (fgets(buf1, sizeof(buf1), jf)) { char *s = strchr(buf1, '\n'); /* no newline, consider it malformed and stop here */ if (!s) break; *s = 0; if (!gs_read(buf1)) break; } fclose(jf); /* this will reopen the journal for appending */ return glinestore_compact(); } Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** s_serv.c 4 Sep 2005 18:57:33 -0000 1.8 --- s_serv.c 4 Dec 2005 07:14:07 -0000 1.9 *************** *** 2224,2241 **** /* Check local users against it */ ! for (i = 0; i <= highest_fd; i++) ! { ! if (!(acptr = local[i]) || IsMe(acptr) || IsLog(acptr)) ! continue; ! ! if (IsPerson(acptr) && user_match_ban(acptr, ban)) ! { ! sendto_ops(LOCAL_BAN_NAME" active for %s", ! get_client_name(acptr, FALSE)); ! ircsprintf(fbuf, LOCAL_BANNED_NAME": %s", reason); ! exit_client(acptr, acptr, &me, fbuf); ! i--; ! } ! } host = get_userban_host(ban, fbuf, 512); --- 2224,2229 ---- /* Check local users against it */ ! ! userban_sweep(ban); host = get_userban_host(ban, fbuf, 512); *************** *** 2486,2504 **** #endif /* UNKLINE */ ! ! /* ! * m_gline ! * ----- client parameters ----- ! * parv[0] = ! * parv[1] = ! * parv[2] = ! * parv[3] = ! */ ! ! int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { struct userBan *ban, *oban; char buffer[1024]; char *user, *host; char *reason; --- 2474,2490 ---- #endif /* UNKLINE */ ! #if 0 int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { struct userBan *ban, *oban; + #if defined (LOCKFILE) + struct pkl *k; + #else + int out; + #endif + char buffer[1024]; + + char *filename; /* filename to use for kline */ char *user, *host; char *reason; *************** *** 2507,2511 **** char tempuser[USERLEN + 2]; char temphost[HOSTLEN + 1]; ! int temporary_gline_time = 0; /* -Dianora */ time_t temporary_gline_time_seconds = 0; int time_specified = 0; --- 2493,2497 ---- char tempuser[USERLEN + 2]; char temphost[HOSTLEN + 1]; ! int temporary_gline_time = 0; /* -Dianora */ time_t temporary_gline_time_seconds = 0; int time_specified = 0; *************** *** 2514,2531 **** char fbuf[512]; ! ! ! ! if (!IsAnOper(sptr) && !IsServer(sptr)) { ! sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); ! return 0; } if (parc < 2) { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), ! me.name, parv[0], "GLINE"); ! return 0; } --- 2500,2514 ---- char fbuf[512]; ! if (!MyClient(sptr) || !IsAnOper(sptr) || !OPCanGline(sptr)) { ! sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); ! return 0; } if (parc < 2) { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), ! me.name, parv[0], "GLINE"); ! return 0; } *************** *** 2534,2565 **** if ((temporary_gline_time = isnumber(argv)) >= 0) { ! if (parc < 3) ! { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), ! me.name, parv[0], "GLINE"); ! return 0; ! } ! if (temporary_gline_time > 1080000) ! temporary_gline_time = 1080000; ! ! temporary_gline_time_seconds = (time_t) temporary_gline_time; ! argv = parv[2]; ! parc--; ! time_specified = 1; } else { ! temporary_gline_time = 0; } if(strchr(argv, ' ')) { ! sendto_one(sptr, ! ":%s NOTICE %s :Poorly formatted hostname " ! "(contains spaces). Be sure you are using the form: " ! "/quote GLINE [time] <user@host/nick> :<reason>", ! me.name, parv[0]); ! return 0; } --- 2517,2549 ---- if ((temporary_gline_time = isnumber(argv)) >= 0) { ! if (parc < 3) ! { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), ! me.name, parv[0], "GLINE"); ! return 0; ! } ! if (temporary_gline_time > (24 * 60 * 7)) ! temporary_gline_time = (24 * 60 * 7); /* Max it at 1 week */ ! temporary_gline_time_seconds = ! (time_t) temporary_gline_time *(time_t) 60; ! ! /* turn it into minutes */ ! argv = parv[2]; ! parc--; ! time_specified = 1; } else { ! temporary_gline_time = 0; /* -1 minute klines are bad... :) - lucas */ } if(strchr(argv, ' ')) { ! sendto_one(sptr, ":%s NOTICE %s :Poorly formatted hostname " ! "(contains spaces). Be sure you are using the form: " ! "/quote GLINE [time] <user@host/nick> :<reason>", ! me.name, parv[0]); ! return 0; } *************** *** 2567,2659 **** if ((host = strchr(argv, '@')) || *argv == '*') { ! if (host) ! { ! user = argv; ! *(host++) = '\0'; ! } ! else ! { ! user = "*"; ! host = argv; ! } ! ! if (!*host) ! host = "*"; ! ! strncpyzt(tempuser, user, USERLEN + 2); ! strncpyzt(temphost, host, HOSTLEN); ! user = tempuser; ! host = temphost; } else { ! ! if (!(acptr = find_chasing(sptr, argv, NULL))) ! return 0; ! if (!acptr->user) ! return 0; ! if (IsServer(acptr)) ! { ! sendto_one(sptr, ":%s NOTICE %s :Can't GLINE a server, use @'s " ! "where appropriate", me.name, parv[0]); ! return 0; ! } ! tempuser[0] = '*'; ! if (*acptr->user->username == '~') ! strcpy(tempuser + 1, (char *) acptr->user->username + 1); ! ! else ! strcpy(tempuser + 1, acptr->user->username); ! user = tempuser; ! host = cluster(acptr->user->host); } if (time_specified) ! argv = parv[3]; else ! argv = parv[2]; - /* FIXME: Shouldnt we use our hown DEFAULT_GLINE_TIME? - Tux`*/ #ifdef DEFAULT_KLINE_TIME ! if (time_specified <= 0) { ! temporary_gline_time = 30; ! temporary_gline_time_seconds = (time_t) temporary_gline_time *(time_t) 60; } #endif if (parc > 2) { ! if (*argv) ! reason = argv; ! else ! reason = "No reason"; } else ! reason = "No reason"; if (!match(user, "akjhfkahfasfjd") && ! !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) { ! sendto_one(sptr, ":%s NOTICE %s :Can't G-Line *@*", me.name, ! parv[0]); ! return 0; } if (temporary_gline_time == 0 && strchr(reason, ':')) { ! sendto_one(sptr, ! ":%s NOTICE %s :Invalid character ':' in comment", ! me.name, parv[0]); ! return 0; } if (temporary_gline_time == 0 && strchr(reason, '#')) { ! sendto_one(sptr,":%s NOTICE %s :Invalid character '#' in comment", ! me.name, parv[0]); ! return 0; } --- 2551,2651 ---- if ((host = strchr(argv, '@')) || *argv == '*') { + /* Explicit user@host mask given */ ! if (host) /* Found user@host */ ! { ! user = argv; /* here is user part */ ! *(host++) = '\0'; /* and now here is host */ ! } ! else ! { ! user = "*"; /* no @ found, assume its *@somehost */ ! host = argv; ! } ! ! if (!*host) /* duh. no host found, assume its '*' host */ ! host = "*"; ! strncpyzt(tempuser, user, USERLEN + 2); /* allow for '*' in front */ ! strncpyzt(temphost, host, HOSTLEN); ! user = tempuser; ! host = temphost; } else { ! /* Try to find user@host mask from nick */ ! ! if (!(acptr = find_chasing(sptr, argv, NULL))) ! return 0; ! if (!acptr->user) ! return 0; ! if (IsServer(acptr)) ! { ! sendto_one(sptr, ":%s NOTICE %s :Can't GLINE a server, use @'s " ! "where appropriate", me.name, parv[0]); ! return 0; ! } ! /* ! * turn the "user" bit into "*user", blow away '~' if found in ! * original user name (non-idented) ! */ ! ! tempuser[0] = '*'; ! if (*acptr->user->username == '~') ! strcpy(tempuser + 1, (char *) acptr->user->username + 1); ! else ! strcpy(tempuser + 1, acptr->user->username); ! user = tempuser; ! host = cluster(acptr->user->host); } if (time_specified) ! argv = parv[3]; else ! argv = parv[2]; #ifdef DEFAULT_KLINE_TIME ! if (time_specified == 0) { ! temporary_gline_time = DEFAULT_KLINE_TIME; ! temporary_gline_time_seconds = ! (time_t) temporary_gline_time *(time_t) 60; } #endif + if (parc > 2) { ! if (*argv) ! reason = argv; ! else ! reason = "No reason"; } else ! reason = "No reason"; if (!match(user, "akjhfkahfasfjd") && ! !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) { ! sendto_one(sptr, ":%s NOTICE %s :Can't K-Line *@*", me.name, ! parv[0]); ! return 0; } + /* we can put whatever we want in temp K: lines */ if (temporary_gline_time == 0 && strchr(reason, ':')) { ! sendto_one(sptr, ! ":%s NOTICE %s :Invalid character ':' in comment", ! me.name, parv[0]); ! return 0; } if (temporary_gline_time == 0 && strchr(reason, '#')) { ! sendto_one(sptr, ! ":%s NOTICE %s :Invalid character '#' in comment", ! me.name, parv[0]); ! return 0; } *************** *** 2661,2715 **** if(!ban) { ! sendto_one(sptr, ":%s NOTICE %s :Malformed ban %s@%s", me.name, parv[0], ! user, host); ! return 0; } - - if ((oban = find_userban_exact(ban, 0))) { ! if (oban->flags & UBAN_GLINE) ! { ! if (MyClient(sptr)) ! { ! sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", ! me.name, parv[0], user, host, NETWORK_GLINNED_NAME, ! oban->reason ? oban->reason : "<No Reason>"); ! } ! else ! { ! /* The G-Line does not exist, and sptr is not our client. ! * However, we should still send it... - Tux` */ ! host = get_userban_host(ban, fbuf, 512); ! sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", ! parv[0], temporary_gline_time_seconds, user, host, reason); ! ! } ! userban_free(ban); ! return 0; ! } } current_date = smalldate((time_t) 0); ! ban->flags |= temporary_gline_time ? (UBAN_GLINE|UBAN_TEMPORARY) : (UBAN_GLINE); ! if (IsServer(sptr)) ! ircsprintf(buffer, "%s", reason); ! ircsprintf(buffer, "%s (%s)", reason, current_date); ban->reason = (char *) MyMalloc(strlen(buffer) + 1); strcpy(ban->reason, buffer); ! ban->timeset = timeofday; ! ban->duration = temporary_gline_time_seconds; ! ! if(user_match_ban(sptr, ban)) { ! sendto_one(sptr, ":%s NOTICE %s :You attempted to add a gline [%s@%s] " ! "which would affect yourself. Aborted.", ! me.name, parv[0], user, host); ! userban_free(ban); ! return 0; } --- 2653,2695 ---- if(!ban) { ! sendto_one(sptr, ":%s NOTICE %s :Malformed ban %s@%s", me.name, parv[0], ! user, host); ! return 0; } if ((oban = find_userban_exact(ban, 0))) { ! char *gtype = (oban->flags & UBAN_GLINE) ? ! NETWORK_GLINE_NAME : NETWORK_GLINNE_NAME; ! ! sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", ! me.name, parv[0], user, host, gtype, ! oban->reason ? oban->reason : "<No Reason>"); ! ! userban_free(ban); ! return 0; } current_date = smalldate((time_t) 0); ! ircsprintf(buffer, "%s (%s)", reason, current_date); ! ! ban->flags |= UBAN_GLINE; ban->reason = (char *) MyMalloc(strlen(buffer) + 1); strcpy(ban->reason, buffer); ! if (temporary_gline_time) ! { ! ban->flags |= UBAN_TEMPORARY; ! ban->timeset = timeofday; ! ban->duration = temporary_gline_time_seconds; ! } if(user_match_ban(sptr, ban)) { ! sendto_one(sptr, ":%s NOTICE %s :You attempted to add a ban [%s@%s]" ! " which would affect yourself. Aborted.", ! me.name, parv[0], user, host); ! userban_free(ban); ! return 0; } *************** *** 2717,2823 **** /* Check local users against it */ ! for (i = 0; i <= highest_fd; i++) { ! if (!(acptr = local[i]) || IsMe(acptr) || IsLog(acptr)) ! continue; ! if (IsPerson(acptr) && user_match_ban(acptr, ban)) ! { ! sendto_ops(NETWORK_GLINE_NAME" active for %s", ! get_client_name(acptr, FALSE)); ! sendto_serv_butone(sptr, ":%s GLOBOPS :%s active for %s", ! NETWORK_GLINE_NAME, me.name, get_client_name(acptr, FALSE)); ! ircsprintf(fbuf, NETWORK_GLINNED_NAME": %s", reason); ! exit_client(acptr, acptr, &me, fbuf); ! i--; ! } } ! host = get_userban_host(ban, fbuf, 512); ! if(temporary_gline_time) ! { ! sendto_realops("%s added a temporary %d sec(s) "NETWORK_GLINE_NAME" for [%s@%s] [%s]", ! parv[0], temporary_gline_time, user, host, reason); ! sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", ! parv[0], temporary_gline_time_seconds, user, host, reason); ! return 0; } ! sendto_realops("%s added a permanent gline for [%s@%s] [%s]", ! parv[0], user, host, reason); ! sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", ! parv[0], temporary_gline_time_seconds, user, host, reason); return 0; } ! int m_ungline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { struct userBan *ban; ! char *user, *host; ! ! if (!IsAnOper(sptr)) { ! sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); ! return 0; } ! ! if(parc<2) { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0],"UNGLINE"); ! return 0; } ! if ((host = strchr(parv[1], '@')) || *parv[1] == '*') { ! if (host) { ! user = parv[1]; ! *(host++) = '\0'; ! } else { ! user = "*"; ! host = parv[1]; ! } ! } else { ! sendto_one(sptr, ":%s NOTICE %s :Invalid parameters",me.name, parv[0]); ! return 0; } ! if ((user[0] == '*') && (user[1] == '\0') && ! (host[0] == '*') && (host[1] == '\0')) { ! sendto_one(sptr, ":%s NOTICE %s :Cannot ungline everyone",me.name, parv[0]); ! return 0; } ban = make_hostbased_ban(user, host); ! if(ban) { ! struct userBan *oban; ! ban->flags |= (UBAN_GLINE|UBAN_TEMPORARY); ! if((oban = find_userban_exact(ban, UBAN_GLINE))) { ! char tmp[512]; ! host = get_userban_host(oban, tmp, 512); ! remove_userban(oban); ! userban_free(oban); ! userban_free(ban); ! ! if (MyClient(sptr)) ! sendto_one(sptr, ":%s NOTICE %s :G-line for [%s@%s] is removed", ! me.name, parv[0], user, host); ! sendto_ops("%s has removed the G-line for: [%s@%s] (%d matches)", ! parv[0], user, host, 1); ! sendto_serv_butone(cptr, ":%s UNGLINE %s@%s", sptr->name, user, host); ! return 0; ! } ! userban_free(ban); ! } ! if (MyClient(sptr)) ! sendto_one(sptr, ":%s NOTICE %s :No g-line for %s@%s was found", ! me.name, parv[0], user, host); ! return 0; ! } /* m_rehash */ --- 2697,2905 ---- /* Check local users against it */ ! ! userban_sweep(ban); ! ! host = get_userban_host(ban, fbuf, 512); ! ! if(temporary_gline_time) ! { ! sendto_realops("%s added temporary %d min. "NETWORK_GLINE_NAME" for" ! " [%s@%s] [%s]", parv[0], temporary_gline_time, user, ! host, reason); ! return 0; ! } ! ! /* from here on, we're dealing with a perm kline */ ! ! filename = configfile; ! ! sendto_one(sptr, ":%s NOTICE %s :Added G-Line [%s@%s] to server " ! "configfile", me.name, parv[0], user, host); ! ! sendto_realops("%s added G-Line for [%s@%s] [%s]", ! parv[0], user, host, reason); ! ! #if defined(LOCKFILE) ! if ((k = (struct pkl *) malloc(sizeof(struct pkl))) == NULL) { ! sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", ! me.name, parv[0]); ! return (0); ! } ! ircsprintf(buffer, "/* %s!%s@%s Added kill for: %s@%s\n" ! " * at %s */\n", ! sptr->name, sptr->user->username, ! sptr->user->host, user, host, current_date); ! if ((k->comment = strdup(buffer)) == NULL) ! { ! free(k); ! sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", ! me.name, parv[0]); ! return (0); } ! ircsprintf(buffer, "kill {\n" ! " mask \"%s@%s\";\n" ! " reason \"%s\";\n" ! "};\n\n", ! user, host, reason); ! if ((k->kline = strdup(buffer)) == NULL) ! { ! free(k->comment); ! free(k); ! sendto_one(sptr, ":%s NOTICE %s :Problem allocating memory", ! me.name, parv[0]); ! return (0); } + k->next = pending_glines; + pending_glines = k; ! do_pending_glines(); ! return (0); ! ! #else /* LOCKFILE - MDP */ ! ! if ((out = open(filename, O_RDWR | O_APPEND | O_CREAT)) == -1) ! { ! sendto_one(sptr, ":%s NOTICE %s :Problem opening %s ", ! me.name, parv[0], filename); ! return 0; ! } ! ! ircsprintf(buffer, "/* %s!%s@%s Added kill for: %s@%s\n" ! " * at %s */\n", ! sptr->name, sptr->user->username, ! sptr->user->host, user, host, current_date); ! ! if (write(out, buffer, strlen(buffer)) <= 0) ! { ! sendto_one(sptr, ":%s NOTICE %s :Problem writing to %s", ! me.name, parv[0], filename); ! close(out); ! return 0; ! } ! ! ircsprintf(buffer, "kill {\n" ! " mask \"%s@%s\";\n" ! " reason \"%s\";\n" ! "};\n\n", ! user, host, reason); ! ! if (write(out, buffer, strlen(buffer)) <= 0) ! { ! sendto_one(sptr, ":%s NOTICE %s :Problem writing to %s", ! me.name, parv[0], filename); ! close(out); ! return 0; ! } ! ! close(out); ! ! #ifdef USE_SYSLOG ! syslog(LOG_NOTICE, "%s added G-Line for [%s@%s] [%s]", parv[0], ! user, host, reason); ! #endif return 0; + #endif /* LOCKFILE */ } + #endif ! ! #if 0 ! /* ! * * m_ungline ! * Added Aug 31, 1997 ! * common (Keith Fralick) fr...@ga... ! * ! * parv[0] = sender ! * parv[1] = address to remove ! * ! * re-worked and cleanedup for use in hybrid-5 -Dianora ! * ! */ ! int m_ungline(aClient *cptr, aClient *sptr, int parc, char *parv[]) { struct userBan *ban; ! char *user, *host; ! ! if (!IsAnOper(sptr) || !OPCanUnGline(sptr)) { ! sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); ! return 0; } ! ! if (parc < 2) { ! sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), ! me.name, parv[0], "UNGLINE"); ! return 0; } ! if ((host = strchr(parv[1], '@')) || *parv[1] == '*') ! { ! /* Explicit user@host mask given */ ! ! if (host) /* Found user@host */ ! { ! user = parv[1]; /* here is user part */ ! *(host++) = '\0'; /* and now here is host */ ! } ! else ! { ! user = "*"; /* no @ found, assume its *@somehost */ ! host = parv[1]; ! } } ! else ! { ! sendto_one(sptr, ":%s NOTICE %s :Invalid parameters", ! me.name, parv[0]); ! return 0; ! } ! ! if ((user[0] == '*') && (user[1] == '\0') && (host[0] == '*') && ! (host[1] == '\0')) ! { ! sendto_one(sptr, ":%s NOTICE %s :Cannot UNG-Line everyone", ! me.name, parv[0]); ! return 0; } ban = make_hostbased_ban(user, host); ! if(ban) ! { ! struct userBan *oban; ! ban->flags |= (UBAN_GLINE|UBAN_TEMPORARY); ! if((oban = find_userban_exact(ban, UBAN_GLINE|UBAN_TEMPORARY))) ! { ! char tmp[512]; ! host = get_userban_host(oban, tmp, 512); + remove_userban(oban); + glinestore_remove(oban); + userban_free(oban); + userban_free(ban); + + sendto_one(sptr, ":%s NOTICE %s :G-Line for [%s@%s] is removed", + me.name, parv[0], user, host); + sendto_ops("%s has removed the G-Line for: [%s@%s] (%d matches)", + parv[0], user, host, 1); + return 0; + } + userban_free(ban); + } + sendto_one(sptr, ":%s NOTICE %s :No Gline matches [%s@%s]", + me.name, parv[0], user, host); + return 0; + } + #endif /* UNGLINE */ /* m_rehash */ Index: userban.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/userban.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** userban.c 4 Sep 2005 05:24:13 -0000 1.5 --- userban.c 4 Dec 2005 07:14:07 -0000 1.6 *************** *** 1619,1630 **** char *reason; char *btext; int clientonly = 1; int i; ! if (ban->flags & UBAN_NETWORK) ! btext = NETWORK_BANNED_NAME; ! else ! btext = LOCAL_BANNED_NAME; ! if (!(reason = ban->reason)) reason = "<no reason>"; --- 1619,1637 ---- char *reason; char *btext; + char *ntext; int clientonly = 1; int i; ! if (ban->flags & UBAN_NETWORK) ! { ! btext = NETWORK_BANNED_NAME; ! ntext = NETWORK_BAN_NAME; ! } ! else ! { ! btext = LOCAL_BANNED_NAME; ! ntext = LOCAL_BAN_NAME; ! } ! if (!(reason = ban->reason)) reason = "<no reason>"; *************** *** 1707,1710 **** --- 1714,1772 ---- } + /* gline.c */ + + + + /* + * gs_dumpklines() helper + */ + static void + gs_dumplist(int f, uBanEnt *be) + { + struct userBan *ub; + + /* glines.c */ + extern void gs_write(int, char, struct userBan *); + + for (; be; be = LIST_NEXT(be, lp)) + { + ub = be->ban; + + /* must be local and not from conf */ + if ((ub->flags & (UBAN_GLINE|UBAN_CONF)) != UBAN_GLINE) + continue; + + /* must be over the storage threshold duration */ + if ((ub->flags & UBAN_TEMPORARY) + && ub->duration < (GLINE_MIN_STORE_TIME * 60)) + continue; + + gs_write(f, '+', ub); + } + } + + /* + * Called from glines.c during a storage GC. + */ + void + gs_dumpglines(int f) + { + int i, j; + + for (i = 0; i < 256; i++) + for (j = 0; j < 256; j++) + gs_dumplist(f, LIST_FIRST(&CIDR4_bans[i][j])); + + gs_dumplist(f, LIST_FIRST(&CIDR4BIG_bans)); + gs_dumplist(f, LIST_FIRST(&host_bans.wild_list)); + gs_dumplist(f, LIST_FIRST(&ip_bans.wild_list)); + + for (i = 0; i < HASH_SIZE; i++) + { + gs_dumplist(f, LIST_FIRST(&host_bans.hash_list[i])); + gs_dumplist(f, LIST_FIRST(&ip_bans.hash_list[i])); + } + } + static void |
From: Gabriel B. <sh...@us...> - 2005-12-04 07:14:17
|
Update of /cvsroot/solidircd/solidircd-stable/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30793/include Modified Files: config.h struct.h Log Message: minor updates, currently working on gline implementation. Index: config.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** config.h 4 Sep 2005 18:57:33 -0000 1.12 --- config.h 4 Dec 2005 07:14:07 -0000 1.13 *************** *** 131,137 **** /* * STRICT_LIST ! * Define is if you want only registered users & ircops to be able to see ! * the channel list, It is recommend to be defined to prevent spambots from ! * retrieving our channel list. -Sheik 16/04/2005 * */ --- 131,138 ---- /* * STRICT_LIST ! * This function is enabled by default it prevents it prevents unregistered ! * users from viewing channels using /list they're notified to use /qlist instead ! * this helps prevent spambots. ! * -Sheik 16/04/2005 * */ *************** *** 140,148 **** - /* * IRCOP_LIST ! * Define this if you want to enable the /ircops command ! * this command will show all the ircops online. * Added by Sheik on 22/04/2005 * --- 141,149 ---- /* * IRCOP_LIST ! * Define this if you want to enable the /ircops ! * This command will allow users to view the online opers, if ! * an ircop has +H it will not display them on this list. * Added by Sheik on 22/04/2005 * *************** *** 152,164 **** ! /* This option will not allow users to unset themselves +v ! * If you want users to be able to unset +v then undefine this ! * option. * */ ! ! #undef STRICT_HOSTMASK ! /* --- 153,163 ---- ! /* STRICT_HOSTMASK * + * This function prevents users from unsetting +v + * This is used to prevent users from evading bans by unsetting their hostmaks. */ ! #define STRICT_HOSTMASK /* *************** *** 179,184 **** * & NO_USER_STATS only do this if you want normal users to be able to use /stats */ - #define STATS_P_OPERONLY --- 178,183 ---- * & NO_USER_STATS only do this if you want normal users to be able to use /stats */ + #define STATS_P_OPERONLY *************** *** 186,193 **** * Warn +R users that their target will not be able to reply. */ - #define PLUS_R_TO_NONREG_WARN - --- 185,191 ---- * Warn +R users that their target will not be able to reply. */ + #undef PLUS_R_TO_NONREG_WARN *************** *** 200,206 **** * enabled. */ #define HIDEULINEDSERVS 1 ! #undef THROTTLE_ENABLE /* enable throttling, see below */ /* --- 198,205 ---- * enabled. */ + #define HIDEULINEDSERVS 1 ! #undef THROTTLE_ENABLE /* *************** *** 225,229 **** * Enable this at your own risk currently elmer is not working but silly works. - Sheik 1/7/2005 */ ! #define TOYS /* File names --- 224,229 ---- * Enable this at your own risk currently elmer is not working but silly works. - Sheik 1/7/2005 */ ! ! #undef TOYS /* File names *************** *** 378,381 **** --- 378,382 ---- * ignore the first character */ + #define IGNORE_FIRST_CHAR Index: struct.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/struct.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** struct.h 4 Sep 2005 05:24:13 -0000 1.6 --- struct.h 4 Dec 2005 07:14:07 -0000 1.7 *************** *** 224,233 **** #define FLAGS_HAVERECVQ 0x000040 /* Client has full commands in their recvq */ #define FLAGS_DOINGDNS 0x000080 /* client is waiting for a DNS response */ ! #define FLAGS_AUTH 0x000100 /* client is waiting on rfc931 response */ #define FLAGS_WRAUTH 0x000200 /* set if we havent writen to ident server */ ! #define FLAGS_LOCAL 0x000400 /* set for local clients */ ! #define FLAGS_GOTID 0x000800 /* successful ident lookup achieved */ ! #define FLAGS_DOID 0x001000 /* I-lines say must use ident return */ ! #define FLAGS_NONL 0x002000 /* No \n in buffer */ #define FLAGS_NORMALEX 0x004000 /* Client exited normally */ #define FLAGS_SENDQEX 0x008000 /* Sendq exceeded */ --- 224,233 ---- #define FLAGS_HAVERECVQ 0x000040 /* Client has full commands in their recvq */ #define FLAGS_DOINGDNS 0x000080 /* client is waiting for a DNS response */ ! #define FLAGS_AUTH 0x000100 /* client is waiting on rfc931 response */ #define FLAGS_WRAUTH 0x000200 /* set if we havent writen to ident server */ ! #define FLAGS_LOCAL 0x000400 /* set for local clients */ ! #define FLAGS_GOTID 0x000800 /* successful ident lookup achieved */ ! #define FLAGS_DOID 0x001000 /* I-lines say must use ident return */ ! #define FLAGS_NONL 0x002000 /* No \n in buffer */ #define FLAGS_NORMALEX 0x004000 /* Client exited normally */ #define FLAGS_SENDQEX 0x008000 /* Sendq exceeded */ *************** *** 246,250 **** #define FLAGS_MAP 0x10000000 #define FLAGS_SHUNNED 0x20000000 /* User is shunned */ ! #define FLAGS_GLINED 0x80000000 /* User is shunned */ #ifdef HAVE_SSL #define FLAGS_SSL 0x40000000 /* SSL */ --- 246,250 ---- #define FLAGS_MAP 0x10000000 #define FLAGS_SHUNNED 0x20000000 /* User is shunned */ ! #define FLAGS_GLINED 0x80000000 /* User is glined */ #ifdef HAVE_SSL #define FLAGS_SSL 0x40000000 /* SSL */ *************** *** 259,263 **** #define CAPAB_BURST 0x0010 /* server supports BURST command */ #define CAPAB_UNCONN 0x0020 /* server supports UNCONNECT */ ! #ifdef NOQUIT #define CAPAB_NOQUIT 0x0040 /* noquit support */ #endif --- 259,263 ---- #define CAPAB_BURST 0x0010 /* server supports BURST command */ #define CAPAB_UNCONN 0x0020 /* server supports UNCONNECT */ ! #ifdef NOQUIT #define CAPAB_NOQUIT 0x0040 /* noquit support */ #endif *************** *** 286,298 **** #endif - /* flag macros. */ #define IsULine(x) ((x)->flags & FLAGS_ULINE) - /* User Modes */ - - #define UMODE_a 0x00000001 /* umode +a - Services Admin */ #define UMODE_h 0x00000002 /* umode +h - Helper */ --- 286,294 ---- *************** *** 328,333 **** #define UMODE_R 0x80000000 /* umode +R - No non registered msgs */ - - /* for sendto_ops_lev */ --- 324,327 ---- *************** *** 576,585 **** #define OFLAG_UMODEb 0x00800000 /* Oper can set umode +b : chatops */ #define OFLAG_UMODEF 0x01000000 /* Oper can set umode +F : no flood throttling */ #define OFLAG_LOCAL (OFLAG_REHASH|OFLAG_HELPOP|OFLAG_GLOBOP|OFLAG_WALLOP|\ OFLAG_LOCOP|OFLAG_LROUTE|OFLAG_LKILL|OFLAG_KLINE|\ OFLAG_UNKLINE|OFLAG_LNOTICE|OFLAG_UMODEc|OFLAG_UMODEf|OFLAG_UMODEd|\ OFLAG_UMODEb|OFLAG_UMODEy) ! #define OFLAG_GLOBAL (OFLAG_LOCAL|OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE) ! #define OFLAG_ISGLOBAL (OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE|OFLAG_SADMIN|OFLAG_UMODEF) #define OPCanZline(x) ((x)->oflag & OFLAG_SADMIN) #define OPCanRehash(x) ((x)->oflag & OFLAG_REHASH) --- 570,583 ---- #define OFLAG_UMODEb 0x00800000 /* Oper can set umode +b : chatops */ #define OFLAG_UMODEF 0x01000000 /* Oper can set umode +F : no flood throttling */ + #define OFLAG_UMODEC 0x02000000 /* Oper can set umode +C : Global connects */ + #define OFLAG_UMODEH 0x04000000 /* Oper can set umode +H : hides their /whois stats */ + #define OFLAG_GLINE 0x08000000 /* Oper can gline */ + #define OFLAG_UNGLINE 0x20000000 /* Oper can Ungline */ #define OFLAG_LOCAL (OFLAG_REHASH|OFLAG_HELPOP|OFLAG_GLOBOP|OFLAG_WALLOP|\ OFLAG_LOCOP|OFLAG_LROUTE|OFLAG_LKILL|OFLAG_KLINE|\ OFLAG_UNKLINE|OFLAG_LNOTICE|OFLAG_UMODEc|OFLAG_UMODEf|OFLAG_UMODEd|\ OFLAG_UMODEb|OFLAG_UMODEy) ! #define OFLAG_GLOBAL (OFLAG_LOCAL|OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE|OFLAG_GLINE|OFLAG_UNGLINE) ! #define OFLAG_ISGLOBAL (OFLAG_GROUTE|OFLAG_GKILL|OFLAG_GNOTICE|OFLAG_SADMIN|OFLAG_UMODEF|OFLAG_GLINE|OFLAG_UNGLINE) #define OPCanZline(x) ((x)->oflag & OFLAG_SADMIN) #define OPCanRehash(x) ((x)->oflag & OFLAG_REHASH) *************** *** 596,599 **** --- 594,600 ---- #define OPCanKline(x) ((x)->oflag & OFLAG_KLINE) #define OPCanUnKline(x) ((x)->oflag & OFLAG_UNKLINE) + #define OPCanGline(x) ((x)->oflag & OFLAG_GLINE) + #define OPCanUNGline(x) ((x)->oflag & OFLAG_UNGLINE) + #define OPCanLNotice(x) ((x)->oflag & OFLAG_LNOTICE) #define OPCanGNotice(x) ((x)->oflag & OFLAG_GNOTICE) *************** *** 605,608 **** --- 606,611 ---- #define OPCanUModed(x) ((x)->oflag & OFLAG_UMODEd) #define OPCanUModeb(x) ((x)->oflag & OFLAG_UMODEb) + #define OPCanUModeC(x) ((x)->oflag & OFLAG_UMODEC) + #define OPCanUModeH(x) ((x)->oflag & OFLAG_UMODEH) #define OPCanUModeF(x) ((x)->oflag & OFLAG_UMODEF) #define OPClearRehash(x) ((x)->oflag &= ~OFLAG_REHASH) *************** *** 628,631 **** --- 631,636 ---- #define OPClearUModed(x) ((x)->oflag &= ~OFLAG_UMODEd) #define OPClearUModeb(x) ((x)->oflag &= ~OFLAG_UMODEb) + #define OPClearUModeC(x) ((x)->oflag &= ~OFLAG_UMODEC) + #define OPClearUModeH(x) ((x)->oflag &= ~OFLAG_UMODEH) #define OPClearZLine(x) ((x)->oflag &= ~OFLAG_ZLINE) #define OPClearUModeF(x) ((x)->oflag &= ~OFLAG_UMODEF) |
From: Gabriel B. <sh...@us...> - 2005-12-04 07:14:17
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30793/zlib Modified Files: zconf.h Log Message: minor updates, currently working on gline implementation. |
From: Gabriel B. <sh...@us...> - 2005-09-04 18:57:44
|
Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4862/zlib Modified Files: zconf.h Log Message: bleh |
From: Gabriel B. <sh...@us...> - 2005-09-04 18:57:42
|
Update of /cvsroot/solidircd/solidircd-stable/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4862/include Modified Files: config.h Log Message: bleh Index: config.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/include/config.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** config.h 4 Sep 2005 05:24:13 -0000 1.11 --- config.h 4 Sep 2005 18:57:33 -0000 1.12 *************** *** 322,325 **** --- 322,355 ---- #define KLINE_STORE_COMPACT_THRESH 1000 + + + /* + * DEFAULT_GLINE_TIME + * + * Define this to the default time for a gline (in minutes) for glines with + * unspecified times. A time of 0 will create a permanent gline. + */ + #define DEFAULT_GLINE_TIME 30 + + + /* + * GLINE_MIN_STORE_TIME + * + * The minimum duration (in minutes) a gline must be before it will be stored + * in the on-disk journal. + */ + + #define GLINE_MIN_STORE_TIME 180 + + /* + * GLINE_STORE_COMPACT_THRESH + * + * The maximum number of entries to write to the active gline storage journal + * before compacting it. This threshold prevents the journal from growing + * indefinitely while glines are added and removed on a running server. + */ + + #define GLINE_STORE_COMPACT_THRESH 1000 + /* * Pretty self explanatory: These are shown in server notices and to the |
From: Gabriel B. <sh...@us...> - 2005-09-04 18:57:41
|
Update of /cvsroot/solidircd/solidircd-stable/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4862/doc Modified Files: template.conf Log Message: bleh Index: template.conf =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/doc/template.conf,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** template.conf 4 Sep 2005 05:24:13 -0000 1.6 --- template.conf 4 Sep 2005 18:57:33 -0000 1.7 *************** *** 100,104 **** auto_umode_v; # Will automaticly set the hostmaskin mode for users. bot_class bot; # Search bots class exception. ! }; --- 100,104 ---- auto_umode_v; # Will automaticly set the hostmaskin mode for users. bot_class bot; # Search bots class exception. ! rquit; }; |
From: Gabriel B. <sh...@us...> - 2005-09-04 18:57:41
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4862/src Modified Files: Makefile.in channel.c s_serv.c Log Message: bleh Index: channel.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/channel.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** channel.c 10 Jul 2005 21:13:33 -0000 1.9 --- channel.c 4 Sep 2005 18:57:33 -0000 1.10 *************** *** 2414,2419 **** if(errors & SM_ERR_RSL) ! sendto_one(sptr,":%s NOTICE %s :*** Notice -- Permission denied you may not set (+D) or join a (+D) channel since you have been marked" ! "has an unresolved client.", me.name, sptr->name); } --- 2414,2419 ---- if(errors & SM_ERR_RSL) ! sendto_one(sptr,":%s NOTICE %s :*** Notice -- Permission denied you may not set (+D) or join a (+D)" ! "channel since you have been marked has an unresolved client.", me.name, sptr->name); } Index: Makefile.in =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 4 Sep 2005 06:31:10 -0000 1.5 --- Makefile.in 4 Sep 2005 18:57:33 -0000 1.6 *************** *** 20,27 **** SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ ! fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c \ ! klines.c list.c m_shun.c m_nick.c m_rwho.c m_server.c m_services.c \ ! m_stats.c m_who.c match.c memcount.c modules.c packet.c parse.c pcre.c\ ! probability.c res.c s_auth.c s_bsd.c s_conf.c s_debug.c s_err.c s_misc.c s_numeric.c \ s_serv.c s_user.c sbuf.c scache.c send.c ssl.c struct.c support.c \ toys.c throttle.c userban.c whowas.c zlink.c \ --- 20,27 ---- SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ ! fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c klines.c list.c \ ! m_shun.c m_nick.c m_rwho.c m_server.c m_services.c m_stats.c m_who.c match.c \ ! memcount.c modules.c packet.c parse.c pcre.c probability.c res.c \ ! s_auth.c s_bsd.c s_conf.c s_debug.c s_err.c s_misc.c s_numeric.c \ s_serv.c s_user.c sbuf.c scache.c send.c ssl.c struct.c support.c \ toys.c throttle.c userban.c whowas.c zlink.c \ Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** s_serv.c 4 Sep 2005 06:48:20 -0000 1.7 --- s_serv.c 4 Sep 2005 18:57:33 -0000 1.8 *************** *** 2666,2669 **** --- 2666,2671 ---- } + + if ((oban = find_userban_exact(ban, 0))) { |
From: Gabriel B. <sh...@us...> - 2005-09-04 06:49:31
|
Update of /cvsroot/solidircd/solidircd-stable/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2516/doc Added Files: rehash Log Message: added rehash file. --- NEW FILE: rehash --- #!/bin/sh #file imported from ultimate-ircd. VERSION=3.4.7 IRCDPID="ircd.pid" echo "Checking to see if your ircd is running...." if [ ! -r $IRCDPID ]; then #clear echo " error" echo " Possible problems:" echo "(1) $IRCDPID not found" echo "(2) The IRCd is not running" else PID=`cat $IRCDPID` kill -HUP $PID echo "successfully rehashed." echo "Process ID: $PID" fi |
From: Gabriel B. <sh...@us...> - 2005-09-04 06:48:35
|
Update of /cvsroot/solidircd/solidircd-stable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2375 Modified Files: CHANGES Log Message: added gline. Index: CHANGES =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/CHANGES,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CHANGES 4 Sep 2005 05:24:12 -0000 1.7 --- CHANGES 4 Sep 2005 06:48:20 -0000 1.8 *************** *** 31,34 **** --- 31,35 ---- Changes from Sheik ------------------------- + 03/09/2005 - Added g-line 03/09/2005 - Fixed misc conf parsing issues (from GeniusDex) 03/09/2005 - Fixed unknown connection reporting in LUSERS |
From: Gabriel B. <sh...@us...> - 2005-09-04 06:48:35
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2375/src Modified Files: s_serv.c Log Message: added gline. Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** s_serv.c 4 Sep 2005 06:31:10 -0000 1.6 --- s_serv.c 4 Sep 2005 06:48:20 -0000 1.7 *************** *** 2487,2490 **** --- 2487,2499 ---- + /* + * m_gline + * ----- client parameters ----- + * parv[0] = + * parv[1] = + * parv[2] = + * parv[3] = + */ + int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) |
From: Gabriel B. <sh...@us...> - 2005-09-04 06:31:19
|
Update of /cvsroot/solidircd/solidircd-stable/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32409/src Modified Files: Makefile.in s_serv.c toys.c Removed Files: m_gline.c Log Message: updates... Index: toys.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/toys.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** toys.c 27 Jun 2005 03:02:11 -0000 1.1.1.1 --- toys.c 4 Sep 2005 06:31:10 -0000 1.2 *************** *** 41,44 **** --- 41,46 ---- #endif + #undef CHECK + #define STATES_NUM 512 *************** *** 175,178 **** --- 177,183 ---- memset(state, 0, sizeof(state)); next_free_state = 1; + #ifdef CHECK + printf("states used: %d\n", next_free_state); + #endif } *************** *** 296,297 **** --- 301,316 ---- return 0; } + + /***************************************** + * End ELMER routines + *****************************************/ + #ifdef CHECK + void main(void) { + char buffer[256], buffer2[256]; + init_chef(); + printf("Text: "); + gets(buffer); + encode_chef(buffer, buffer2, 256); + printf("Translation: %s\n",buffer2); + } + #endif --- m_gline.c DELETED --- Index: Makefile.in =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 4 Sep 2005 05:24:13 -0000 1.4 --- Makefile.in 4 Sep 2005 06:31:10 -0000 1.5 *************** *** 21,25 **** SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c \ ! klines.c list.c m_gline.c m_shun.c m_nick.c m_rwho.c m_server.c m_services.c \ m_stats.c m_who.c match.c memcount.c modules.c packet.c parse.c pcre.c\ probability.c res.c s_auth.c s_bsd.c s_conf.c s_debug.c s_err.c s_misc.c s_numeric.c \ --- 21,25 ---- SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \ fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c \ ! klines.c list.c m_shun.c m_nick.c m_rwho.c m_server.c m_services.c \ m_stats.c m_who.c match.c memcount.c modules.c packet.c parse.c pcre.c\ probability.c res.c s_auth.c s_bsd.c s_conf.c s_debug.c s_err.c s_misc.c s_numeric.c \ *************** *** 148,156 **** ../include/zlink.h ../include/memcount.h ../include/throttle.h \ ../include/queue.h - m_gline.o: m_gline.c ../include/struct.h ../include/dbuf.h ../include/config.h \ - ../include/setup.h ../include/defs.h ../include/hash.h \ - ../include/h.h ../include/send.h ../include/common.h \ - ../include/ircsprintf.h ../include/msg.h ../include/sys.h \ - ../include/userban.h ../include/common.h m_shun.o: m_shun.c ../include/struct.h ../include/config.h \ ../include/setup.h ../include/defs.h ../include/hash.h \ --- 148,151 ---- Index: s_serv.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/src/s_serv.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** s_serv.c 4 Sep 2005 05:24:13 -0000 1.5 --- s_serv.c 4 Sep 2005 06:31:10 -0000 1.6 *************** *** 2486,2489 **** --- 2486,2813 ---- #endif /* UNKLINE */ + + + int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[]) + { + struct userBan *ban, *oban; + char buffer[1024]; + char *user, *host; + char *reason; + char *current_date; + aClient *acptr; + char tempuser[USERLEN + 2]; + char temphost[HOSTLEN + 1]; + int temporary_gline_time = 0; /* -Dianora */ + time_t temporary_gline_time_seconds = 0; + int time_specified = 0; + char *argv; + int i; + char fbuf[512]; + + + + + if (!IsAnOper(sptr) && !IsServer(sptr)) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + if (parc < 2) + { + sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "GLINE"); + return 0; + } + + argv = parv[1]; + + if ((temporary_gline_time = isnumber(argv)) >= 0) + { + if (parc < 3) + { + sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "GLINE"); + return 0; + } + if (temporary_gline_time > 1080000) + temporary_gline_time = 1080000; + + temporary_gline_time_seconds = (time_t) temporary_gline_time; + + argv = parv[2]; + parc--; + time_specified = 1; + } + else + { + temporary_gline_time = 0; + } + + if(strchr(argv, ' ')) + { + sendto_one(sptr, + ":%s NOTICE %s :Poorly formatted hostname " + "(contains spaces). Be sure you are using the form: " + "/quote GLINE [time] <user@host/nick> :<reason>", + me.name, parv[0]); + return 0; + } + + + if ((host = strchr(argv, '@')) || *argv == '*') + { + + if (host) + { + user = argv; + *(host++) = '\0'; + } + else + { + user = "*"; + host = argv; + } + + if (!*host) + host = "*"; + + strncpyzt(tempuser, user, USERLEN + 2); + strncpyzt(temphost, host, HOSTLEN); + user = tempuser; + host = temphost; + } + else + { + + if (!(acptr = find_chasing(sptr, argv, NULL))) + return 0; + + if (!acptr->user) + return 0; + + if (IsServer(acptr)) + { + sendto_one(sptr, ":%s NOTICE %s :Can't GLINE a server, use @'s " + "where appropriate", me.name, parv[0]); + return 0; + } + tempuser[0] = '*'; + if (*acptr->user->username == '~') + strcpy(tempuser + 1, (char *) acptr->user->username + 1); + + else + strcpy(tempuser + 1, acptr->user->username); + user = tempuser; + host = cluster(acptr->user->host); + } + + if (time_specified) + argv = parv[3]; + else + argv = parv[2]; + + /* FIXME: Shouldnt we use our hown DEFAULT_GLINE_TIME? - Tux`*/ + #ifdef DEFAULT_KLINE_TIME + if (time_specified <= 0) + { + temporary_gline_time = 30; + temporary_gline_time_seconds = (time_t) temporary_gline_time *(time_t) 60; + } + #endif + if (parc > 2) + { + if (*argv) + reason = argv; + else + reason = "No reason"; + } + else + reason = "No reason"; + + if (!match(user, "akjhfkahfasfjd") && + !match(host, "ldksjfl.kss...kdjfd.jfklsjf")) + { + sendto_one(sptr, ":%s NOTICE %s :Can't G-Line *@*", me.name, + parv[0]); + return 0; + } + + if (temporary_gline_time == 0 && strchr(reason, ':')) + { + sendto_one(sptr, + ":%s NOTICE %s :Invalid character ':' in comment", + me.name, parv[0]); + return 0; + } + + if (temporary_gline_time == 0 && strchr(reason, '#')) + { + sendto_one(sptr,":%s NOTICE %s :Invalid character '#' in comment", + me.name, parv[0]); + return 0; + } + + ban = make_hostbased_ban(user, host); + if(!ban) + { + sendto_one(sptr, ":%s NOTICE %s :Malformed ban %s@%s", me.name, parv[0], + user, host); + return 0; + } + + if ((oban = find_userban_exact(ban, 0))) + { + if (oban->flags & UBAN_GLINE) + { + if (MyClient(sptr)) + { + sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already %s for %s", + me.name, parv[0], user, host, NETWORK_GLINNED_NAME, + oban->reason ? oban->reason : "<No Reason>"); + } + else + { + /* The G-Line does not exist, and sptr is not our client. + * However, we should still send it... - Tux` */ + host = get_userban_host(ban, fbuf, 512); + sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", + parv[0], temporary_gline_time_seconds, user, host, reason); + + } + userban_free(ban); + return 0; + } + } + + current_date = smalldate((time_t) 0); + ban->flags |= temporary_gline_time ? (UBAN_GLINE|UBAN_TEMPORARY) : (UBAN_GLINE); + if (IsServer(sptr)) + ircsprintf(buffer, "%s", reason); + ircsprintf(buffer, "%s (%s)", reason, current_date); + ban->reason = (char *) MyMalloc(strlen(buffer) + 1); + strcpy(ban->reason, buffer); + + ban->timeset = timeofday; + ban->duration = temporary_gline_time_seconds; + + + + if(user_match_ban(sptr, ban)) + { + sendto_one(sptr, ":%s NOTICE %s :You attempted to add a gline [%s@%s] " + "which would affect yourself. Aborted.", + me.name, parv[0], user, host); + userban_free(ban); + return 0; + } + + add_hostbased_userban(ban); + + /* Check local users against it */ + for (i = 0; i <= highest_fd; i++) + { + if (!(acptr = local[i]) || IsMe(acptr) || IsLog(acptr)) + continue; + + if (IsPerson(acptr) && user_match_ban(acptr, ban)) + { + sendto_ops(NETWORK_GLINE_NAME" active for %s", + get_client_name(acptr, FALSE)); + sendto_serv_butone(sptr, ":%s GLOBOPS :%s active for %s", + NETWORK_GLINE_NAME, me.name, get_client_name(acptr, FALSE)); + + ircsprintf(fbuf, NETWORK_GLINNED_NAME": %s", reason); + exit_client(acptr, acptr, &me, fbuf); + i--; + } + } + + host = get_userban_host(ban, fbuf, 512); + + if(temporary_gline_time) + { + sendto_realops("%s added a temporary %d sec(s) "NETWORK_GLINE_NAME" for [%s@%s] [%s]", + parv[0], temporary_gline_time, user, host, reason); + sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", + parv[0], temporary_gline_time_seconds, user, host, reason); + return 0; + } + + sendto_realops("%s added a permanent gline for [%s@%s] [%s]", + parv[0], user, host, reason); + sendto_serv_butone(sptr, ":%s GLINE %d %s@%s :%s", + parv[0], temporary_gline_time_seconds, user, host, reason); + + return 0; + } + + int m_ungline(aClient *cptr, aClient *sptr, int parc, char *parv[]) + { + struct userBan *ban; + char *user, *host; + + if (!IsAnOper(sptr)) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + if(parc<2) + { + sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0],"UNGLINE"); + return 0; + } + + if ((host = strchr(parv[1], '@')) || *parv[1] == '*') { + if (host) { + user = parv[1]; + *(host++) = '\0'; + } else { + user = "*"; + host = parv[1]; + } + } else { + sendto_one(sptr, ":%s NOTICE %s :Invalid parameters",me.name, parv[0]); + return 0; + } + if ((user[0] == '*') && (user[1] == '\0') && + (host[0] == '*') && (host[1] == '\0')) { + sendto_one(sptr, ":%s NOTICE %s :Cannot ungline everyone",me.name, parv[0]); + return 0; + } + + ban = make_hostbased_ban(user, host); + if(ban) { + struct userBan *oban; + ban->flags |= (UBAN_GLINE|UBAN_TEMPORARY); + + if((oban = find_userban_exact(ban, UBAN_GLINE))) { + char tmp[512]; + host = get_userban_host(oban, tmp, 512); + remove_userban(oban); + userban_free(oban); + userban_free(ban); + + if (MyClient(sptr)) + sendto_one(sptr, ":%s NOTICE %s :G-line for [%s@%s] is removed", + me.name, parv[0], user, host); + sendto_ops("%s has removed the G-line for: [%s@%s] (%d matches)", + parv[0], user, host, 1); + + sendto_serv_butone(cptr, ":%s UNGLINE %s@%s", sptr->name, user, host); + return 0; + } + userban_free(ban); + } + if (MyClient(sptr)) + sendto_one(sptr, ":%s NOTICE %s :No g-line for %s@%s was found", + me.name, parv[0], user, host); + return 0; + } + + + + /* m_rehash */ int |