/[svn]/ircd-hybrid-7.2/modules/m_challenge.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/modules/m_challenge.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 816 by lusky, Sun Oct 2 21:05:51 2005 UTC revision 817 by michael, Sun Sep 10 17:45:31 2006 UTC
# Line 74  static void Line 74  static void
74  m_challenge(struct Client *client_p, struct Client *source_p,  m_challenge(struct Client *client_p, struct Client *source_p,
75              int parc, char *parv[])              int parc, char *parv[])
76  {  {
77    char *challenge;    char *challenge = NULL;
78    struct ConfItem *conf=NULL;    struct ConfItem *conf = NULL;
79    struct AccessItem *aconf=NULL;    struct AccessItem *aconf = NULL;
   
   assert(source_p->localClient);  
80    
81    /* if theyre an oper, reprint oper motd and ignore */    /* if theyre an oper, reprint oper motd and ignore */
82    if (IsOper(source_p))    if (IsOper(source_p))
# Line 91  m_challenge(struct Client *client_p, str Line 89  m_challenge(struct Client *client_p, str
89    if (*parv[1] == '+')    if (*parv[1] == '+')
90    {    {
91      /* Ignore it if we aren't expecting this... -A1kmm */      /* Ignore it if we aren't expecting this... -A1kmm */
92      if (!source_p->localClient->response)      if (source_p->localClient->response == NULL)
93        return;        return;
94    
95      if (irccmp(source_p->localClient->response, ++parv[1]))      if (irccmp(source_p->localClient->response, ++parv[1]))
# Line 102  m_challenge(struct Client *client_p, str Line 100  m_challenge(struct Client *client_p, str
100                                "challenge failed");                                "challenge failed");
101        return;        return;
102      }      }
103            
104      if ((conf = find_exact_name_conf(OPER_TYPE,      conf = find_exact_name_conf(OPER_TYPE,
105                                       source_p->localClient->auth_oper,                                  source_p->localClient->auth_oper,
106                                       source_p->username, source_p->host                                  source_p->username, source_p->host);
107                                     )) == NULL)      if (conf == NULL)
108          conf = find_exact_name_conf(OPER_TYPE,
109                                      source_p->localClient->auth_oper,
110                                      source_p->username, source_p->sockhost);
111        if (conf == NULL)
112      {      {
113        sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, parv[0]);        sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, parv[0]);
114        log_oper_action(LOG_FAILED_OPER_TYPE, source_p, "%s\n",        log_oper_action(LOG_FAILED_OPER_TYPE, source_p, "%s\n",
# Line 147  m_challenge(struct Client *client_p, str Line 149  m_challenge(struct Client *client_p, str
149    if ((conf = find_conf_exact(OPER_TYPE,    if ((conf = find_conf_exact(OPER_TYPE,
150                                parv[1], source_p->username, source_p->host                                parv[1], source_p->username, source_p->host
151                                )) != NULL)                                )) != NULL)
152    {      aconf = map_to_conf(conf);
     aconf = (struct AccessItem *)map_to_conf(conf);  
   }  
153    else if ((conf = find_conf_exact(OPER_TYPE,    else if ((conf = find_conf_exact(OPER_TYPE,
154                                     parv[1], source_p->username,                                     parv[1], source_p->username,
155                                     source_p->sockhost)) != NULL)                                     source_p->sockhost)) != NULL)
156    {      aconf = map_to_conf(conf);
     aconf = (struct AccessItem *)map_to_conf(conf);  
   }  
157    
158    if(aconf == NULL)    if (aconf == NULL)
159    {    {
160      sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, parv[0]);      sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, parv[0]);
161      conf = find_exact_name_conf(OPER_TYPE, parv[1], NULL, NULL);      conf = find_exact_name_conf(OPER_TYPE, parv[1], NULL, NULL);

Legend:
Removed from v.816  
changed lines
  Added in v.817

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26