X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_connect.c;h=d30151d6e3dabb110a4a295be59cbda700ff50b0;hb=86c7c44bf12024a47fac109fac01c7dbde88fd0d;hp=72edaaa6ac090141e500efa824d6c56cebef0974;hpb=dd339ee3f84171935b3d0b10a5fade3d73503d7c;p=ircu2.10.12-pk.git diff --git a/ircd/m_connect.c b/ircd/m_connect.c index 72edaaa..d30151d 100644 --- a/ircd/m_connect.c +++ b/ircd/m_connect.c @@ -120,7 +120,7 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { unsigned short port; unsigned short tmpport; - const char* crule_name; + const char* rule; struct ConfItem* aconf; struct Client* acptr; struct Jupe* ajupe; @@ -168,9 +168,8 @@ int ms_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * are ored together. Oper connects are effected only by D * lines (CRULEALL) not d lines (CRULEAUTO). */ - if ((crule_name = conf_eval_crule(aconf))) { - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Disallowed by rule: %s", - sptr, crule_name); + if ((rule = conf_eval_crule(aconf->name, CRULE_ALL))) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Disallowed by rule: %s", sptr, rule); return 0; } /* @@ -230,7 +229,7 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { unsigned short port; unsigned short tmpport; - const char* crule_name; + const char* rule; struct ConfItem* aconf; struct Client* acptr; struct Jupe* ajupe; @@ -300,9 +299,8 @@ int mo_connect(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * are ored together. Oper connects are effected only by D * lines (CRULEALL) not d lines (CRULEAUTO). */ - if ((crule_name = conf_eval_crule(aconf))) { - sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Disallowed by rule: %s", - sptr, crule_name); + if ((rule = conf_eval_crule(aconf->name, CRULE_ALL))) { + sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Connect: Disallowed by rule: %s", sptr, rule); return 0; } /* @@ -368,6 +366,7 @@ int m_connect(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) struct ConfItem* cconf; struct Client* acptr; struct Jupe* ajupe; + const char* rule; if (!IsPrivileged(sptr)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); /* XXX DEAD */ @@ -471,19 +470,14 @@ int m_connect(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) * are ored together. Oper connects are effected only by D * lines (CRULEALL) not d lines (CRULEAUTO). */ - for (cconf = GlobalConfList; cconf; cconf = cconf->next) { - if ((CONF_CRULEALL == cconf->status) && - (0 == match(cconf->host, aconf->name))) { - if (crule_eval(cconf->passwd)) { - if (MyUser(sptr)) - sendto_one(sptr, ":%s NOTICE %s :Connect: Disallowed by rule: %s", /* XXX DEAD */ - me.name, parv[0], cconf->name); - else - sendto_one(sptr, "%s NOTICE %s%s :Connect: Disallowed by rule: %s", /* XXX DEAD */ - NumServ(&me), NumNick(sptr), cconf->name); - return 0; - } - } + if ((rule = conf_eval_crule(aconf->name, CRULE_ALL))) { + if (MyUser(sptr)) + sendto_one(sptr, ":%s NOTICE %s :Connect: Disallowed by rule: %s", /* XXX DEAD */ + me.name, parv[0], cconf->name); + else + sendto_one(sptr, "%s NOTICE %s%s :Connect: Disallowed by rule: %s", /* XXX DEAD */ + NumServ(&me), NumNick(sptr), cconf->name); + return 0; } /* * Check to see if the server is juped; if it is, disallow the connect