/* * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * * Copyright (c) 2003-2014 ircd-hybrid development 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file m_xline.c * \brief Includes required functions for processing the XLINE/UNXLINE command. * \version $Id$ */ #include "stdinc.h" #include "list.h" #include "channel.h" #include "client.h" #include "irc_string.h" #include "ircd.h" #include "conf.h" #include "hostmask.h" #include "numeric.h" #include "fdlist.h" #include "s_bsd.h" #include "log.h" #include "s_misc.h" #include "send.h" #include "hash.h" #include "s_serv.h" #include "parse.h" #include "modules.h" #include "resv.h" #include "conf_db.h" #include "memory.h" static int valid_xline(struct Client *, char *, char *, int); static void write_xline(struct Client *, char *, char *, time_t); static void remove_xline(struct Client *, char *); static int remove_xline_match(const char *); static void relay_xline(struct Client *, char *[]); static void check_xline(struct MaskItem *conf) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, local_client_list.head) { struct Client *client_p = ptr->data; if (IsDead(client_p)) continue; if (!match(conf->name, client_p->username)) conf_try_ban(client_p, conf); } } /* mo_xline() * * inputs - pointer to server * - pointer to client * - parameter count * - parameter list * output - * side effects - x line is added * */ static int mo_xline(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { char *reason = NULL; char *gecos = NULL; struct MaskItem *conf = NULL; char *target_server = NULL; time_t tkline_time = 0; if (!HasOFlag(source_p, OPER_FLAG_XLINE)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "xline"); return 0; } /* * XLINE