Changeset 1684

Show
Ignore:
Timestamp:
02/22/10 12:25:48 (7 months ago)
Author:
swalsh
Message:

Add the beginnings of the event system rewrite, and also more importantly fix a bug in the processing of auto-auth; oh and while we're at it [MERGE] (r1683) fix crash bug in nickname changing

Location:
trunk
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo set to /branches/oftc-ircservices-1.3:1683
  • trunk/modules/nickserv.c

    r1682 r1684  
    17761776    else if(client != NULL) 
    17771777    { 
    1778       if((target = find_client(nickname_get_nick(client->nickname))) != NULL) 
     1778      if((target = find_client(nickname_get_nick(user->release_name))) != NULL) 
    17791779      { 
    17801780        if(target != client) 
     
    20432043ns_on_auth_requested(va_list args) 
    20442044{ 
     2045  char *use_cert = va_arg(args, char *); 
    20452046  char *user    = va_arg(args, char *); 
    20462047  char *n       = va_arg(args, char *); 
     
    20712072    else 
    20722073    { 
    2073       if(!nickname_cert_check(nick, certfp, NULL)) 
     2074      if(*use_cert == '1') 
     2075      { 
     2076        if(!nickname_cert_check(nick, certfp, NULL)) 
     2077          send_auth_reply(nickserv, user, n, 0, "Authentication Failed"); 
     2078        else 
     2079          send_auth_reply(nickserv, user, n, 1, "Success"); 
     2080      } 
     2081      else 
    20742082      { 
    20752083        if(!check_nick_pass(NULL, nick, certfp)) 
     
    20782086          send_auth_reply(nickserv, user, n, 1, "Success"); 
    20792087      } 
    2080       else 
    2081         send_auth_reply(nickserv, user, n, 1, "Success"); 
    2082      
    20832088      nickname_free(nick); 
    20842089    } 
    2085  
    2086   } 
    2087    
     2090  } 
    20882091  return pass_callback(ns_on_auth_req_hook, user); 
    20892092} 
  • trunk/modules/oftc.c

    r1681 r1684  
    308308} 
    309309 
     310/* irc.example.com AUTH 1|0 account nick cert|pass */ 
    310311static void 
    311312m_auth(struct Client *client, struct Client *source, int parc, char *parv[]) 
    312313{ 
    313   ilog(L_DEBUG, "AUTH request for %s[%s] certfp %s from %s", parv[1],  
    314       parv[2], parv[3], parv[0]); 
    315  
    316   execute_callback(on_auth_request_cb, parv[1], parv[2], parv[3]); 
     314  ilog(L_DEBUG, "AUTH request for %s[%s] %s %s from %s", parv[2],  
     315      parv[3], *parv[1] == '1' ? "CERT" : "PASS", parv[4], parv[0]); 
     316 
     317  execute_callback(on_auth_request_cb, parv[1], parv[2], parv[3], parv[4]); 
    317318} 
    318319 
  • trunk/src/Makefile.am

    r1561 r1684  
    2121                                                                        dbm.c                                   \ 
    2222                                                                        dbmail.c                              \ 
     23                                                                        event.c                                                 \ 
    2324                  group.c             \ 
    2425                  groupaccess.c       \ 
     
    3839 
    3940services_LDADD=conf/libconf.a $(top_srcdir)/libio/libio.a @LIBLTDL@ 
    40 services_LDFLAGS= 
     41services_LDFLAGS=-levent 
    4142if USE_RUBY 
    4243services_LDFLAGS+=@RUBY_LDFLAGS@ 
  • trunk/src/services.c

    r1442 r1684  
    3939#include "mqueue.h" 
    4040#include "send.h" 
     41#include "events.h" 
    4142 
    4243#include <signal.h> 
     
    209210  memset(&me, 0, sizeof(me)); 
    210211 
     212  init_events(); 
    211213  libio_init(!ServicesState.foreground); 
    212214  iorecv_cb = register_callback("iorecv", iorecv_default);