diff --git a/Changes b/Changes index a88ef2be4..6a7af4743 100644 --- a/Changes +++ b/Changes @@ -702,3 +702,5 @@ seen. gmtime warning still there - Made it so unreal searches harder for SSL headers and libraries - Fixed possible bug with allowing :'s in +k/+L .. - Added a credit +- Fixed a typo in /stats and a /chatops bug found by Cas +- Made oper {} (and vhost {}) allow you to enter an IP even if your host resolves by request of Cas diff --git a/src/s_extra.c b/src/s_extra.c index ff467500a..77c3d5e8b 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -333,7 +333,7 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[]) { ConfigItem_vhost *vhost; ConfigItem_oper_from *from; - char *user, *pwd, *host; + char *user, *pwd, *host, *host2; if (parc < 3) { @@ -360,8 +360,9 @@ int m_vhost(aClient *cptr, aClient *sptr, int parc, char *parv[]) return 0; } host = make_user_host(sptr->user->username, sptr->user->realhost); + host2 = make_user_host(sptr->user->username, (char *)inet_ntoa(sptr->ip)); for (from = (ConfigItem_oper_from *)vhost->from; from; from = (ConfigItem_oper_from *)from->next) { - if (!match(from->name, host)) + if (!match(from->name, host) || !match(from->name, host2)) break; } if (!from) { diff --git a/src/s_serv.c b/src/s_serv.c index f0fe7069b..7befe555b 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -2925,7 +2925,7 @@ int m_stats(cptr, sptr, parc, parv) sendto_one(sptr, rpl_str(RPL_STATSHELP), me.name, parv[0], "E - Send the except ban block list"); sendto_one(sptr, rpl_str(RPL_STATSHELP), me.name, parv[0], - "F - Send the deny dcc block list list"); + "F - Send the deny dcc block list"); sendto_one(sptr, rpl_str(RPL_STATSHELP), me.name, parv[0], "G - Report TKL information (G:lines/Shuns)"); sendto_one(sptr, rpl_str(RPL_STATSHELP), me.name, parv[0], @@ -3667,23 +3667,11 @@ int m_chatops(cptr, sptr, parc, parv) me.name, parv[0], "CHATOPS"); return 0; } - if (ALLOW_CHATOPS == 1) + if (MyClient(sptr)) { - if (MyClient(sptr) && !IsAnOper(sptr)) - { - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, - parv[0]); - return 0; - } - } - else - { - if (MyClient(sptr)) - { - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, - parv[0]); - return 0; - } + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, + parv[0]); + return 0; } sendto_serv_butone_token(IsServer(cptr) ? cptr : NULL, parv[0], MSG_CHATOPS, TOK_CHATOPS, ":%s", message); diff --git a/src/s_user.c b/src/s_user.c index 27f611bbd..7d4befebe 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -3653,7 +3653,7 @@ int m_oper(cptr, sptr, parc, parv) { ConfigItem_oper *aconf; ConfigItem_oper_from *oper_from; - char *name, *password, *encr, *nuhhost; + char *name, *password, *encr, *nuhhost, *nuhhost2; #ifdef CRYPT_OPER_PASSWORD char salt[3]; extern char *crypt(); @@ -3709,9 +3709,10 @@ int m_oper(cptr, sptr, parc, parv) return 0; } nuhhost = make_user_host(sptr->user->username, sptr->user->realhost); + nuhhost2 = make_user_host(sptr->user->username, (char *)inet_ntoa(sptr->ip)); for (oper_from = (ConfigItem_oper_from *) aconf->from; oper_from; oper_from = (ConfigItem_oper_from *) oper_from->next) - if (!match(oper_from->name, nuhhost)) + if (!match(oper_from->name, nuhhost) || !match(oper_from->name, nuhhost2)) break; if (!oper_from) {