X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_oper.c;h=c820fe95907c2573194b3026fb903c7bb2e7d92b;hb=refs%2Fheads%2Fupstream-ssl;hp=60e9997e66fcecea9151e53d45d9ab1b8d7cb235;hpb=be28fad14b46a9012bc2367b609daef19e7646eb;p=ircu2.10.12-pk.git diff --git a/ircd/m_oper.c b/ircd/m_oper.c index 60e9997..c820fe9 100644 --- a/ircd/m_oper.c +++ b/ircd/m_oper.c @@ -84,6 +84,7 @@ #include "client.h" #include "hash.h" #include "ircd.h" +#include "ircd_alloc.h" #include "ircd_features.h" #include "ircd_log.h" #include "ircd_reply.h" @@ -99,12 +100,14 @@ #include "s_misc.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include #include int oper_password_match(const char* to_match, const char* passwd) { + char *crypted; + int res; /* * use first two chars of the password they send in as salt * @@ -116,12 +119,13 @@ int oper_password_match(const char* to_match, const char* passwd) /* we no longer do a CRYPT_OPER_PASSWORD check because a clear text passwords just handled by a fallback mechanism called crypt_clear if it's enabled -- hikari */ - to_match = ircd_crypt(to_match, passwd); + crypted = ircd_crypt(to_match, passwd); - if (to_match == NULL) + if (!crypted) return 0; - else - return (0 == strcmp(to_match, passwd)); + res = strcmp(crypted, passwd); + MyFree(crypted); + return 0 == res; } /* @@ -142,11 +146,7 @@ int m_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (EmptyString(name) || EmptyString(password)) return need_more_params(sptr, "OPER"); - aconf = find_conf_exact(name, cli_username(sptr), cli_sockhost(sptr), CONF_OPERATOR); - if (!aconf) - aconf = find_conf_exact(name, cli_username(sptr), - ircd_ntoa(&cli_ip(cptr)), CONF_OPERATOR); - + aconf = find_conf_exact(name, sptr, CONF_OPERATOR); if (!aconf || IsIllegal(aconf)) { send_reply(sptr, ERR_NOOPERHOST);