diff -c -r irc2.8.21+CSr21/README.CS irc2.8.21+CSr22/README.CS *** irc2.8.21+CSr21/README.CS Thu Apr 4 21:12:49 1996 --- irc2.8.21+CSr22/README.CS Sat Apr 27 21:41:40 1996 *************** *** 1,6 **** --- 1,22 ---- NOTE: Please change values in comstud.h and dog3.h to your liking... The default values are probably less than ideal for you! + New in CSr22: + + 1) Fixed REJECT_BOTS stuff. This was broken starting with r20 or so. + The actual problem was just a missing closing comment (*/) in comstud.h + 2) Fixed K: lines that I broke in ircd.c in r21. I had an /* instead of */ + which basically commented out all the K: checking. + 3) Fixed the mode #chan +k bug. + 4) Added BETTER_MOTD which keeps the ircd.motd in RAM which saves a lot + of disk access on high-access client servers + If you change the /motd, just /rehash to "reload" it. + 5) Added BUFFERED_LOGS which doesn't write to users.log and clones.log + each time a client exits or is rejected for cloning. This should + save some disk access as well, tho using a bit more RAM :-/ + 6) Disabled channel TS stuff once again. + + New in CSr21: 1) Readded IDLE_CHECK, using ds2's idea of not allowing them to reconnect diff -c -r irc2.8.21+CSr21/include/comstud.h irc2.8.21+CSr22/include/comstud.h *** irc2.8.21+CSr21/include/comstud.h Thu Apr 4 19:58:46 1996 --- irc2.8.21+CSr22/include/comstud.h Sat Apr 27 21:58:46 1996 *************** *** 1,6 **** --- 1,20 ---- #ifndef COMSTUD_H #define COMSTUD_H + + /* BUFFERED_LOGS - define this to reduce disk IO when writing users.log + and clones.log + */ + + #define BUFFERED_LOGS + + + /* BETTER_MOTD - define this to keep the MOTD in ram to reduce disk + IO. /REHASH to reload the MOTD. + */ + + #define BETTER_MOTD + /* NO_NICK_FLOODS - define this to limit local users to 3 nick changes in 60 seconds */ *************** *** 171,176 **** --- 185,191 ---- which is trying to connect is a bot... If it is, it will be rejected from connecting. See BOTS_NOTICE + */ #define REJECT_BOTS *************** *** 205,211 **** want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr21/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c --- 220,226 ---- want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr22/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c *************** *** 295,301 **** and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr21/lib/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client --- 310,316 ---- and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr22/lib/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client diff -c -r irc2.8.21+CSr21/include/config.h irc2.8.21+CSr22/include/config.h *** irc2.8.21+CSr21/include/config.h Tue Jan 23 18:09:37 1996 --- irc2.8.21+CSr22/include/config.h Sat Apr 27 20:45:32 1996 *************** *** 108,115 **** * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr21/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr21/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ --- 108,115 ---- * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr22/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr22/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ *************** *** 123,130 **** * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr21/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr21/logs/opers.log" /* */ /* CHROOTDIR * --- 123,130 ---- * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr22/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr22/logs/opers.log" /* */ /* CHROOTDIR * diff -c -r irc2.8.21+CSr21/include/h.h irc2.8.21+CSr22/include/h.h *** irc2.8.21+CSr21/include/h.h Thu Apr 4 19:25:18 1996 --- irc2.8.21+CSr22/include/h.h Sat Apr 27 16:28:15 1996 *************** *** 30,35 **** --- 30,41 ---- extern void check_max_count(); #endif /* HIGHEST_CONNECTION */ + + #ifdef BETTER_MOTD + extern aMotd *motd; + extern struct tm *motd_tm; + #endif + extern int idlelimit; extern int s_count, c_count, ch_count, u_count, i_count; extern int o_count, m_clients, m_servers, m_invis; diff -c -r irc2.8.21+CSr21/include/patchlevel.h irc2.8.21+CSr22/include/patchlevel.h *** irc2.8.21+CSr21/include/patchlevel.h Tue Jan 23 18:09:23 1996 --- irc2.8.21+CSr22/include/patchlevel.h Fri Apr 5 20:24:03 1996 *************** *** 17,21 **** */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr21" #endif --- 17,21 ---- */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr22" #endif diff -c -r irc2.8.21+CSr21/include/struct.h irc2.8.21+CSr22/include/struct.h *** irc2.8.21+CSr21/include/struct.h Thu Apr 4 19:58:36 1996 --- irc2.8.21+CSr22/include/struct.h Sat Apr 27 15:49:56 1996 *************** *** 55,60 **** --- 55,61 ---- typedef struct IdleItem anIdle; typedef struct CloneItem aClone; + typedef struct MotdItem aMotd; #ifndef VMSP #include "class.h" *************** *** 255,260 **** --- 256,266 ---- long last; struct CloneItem *prev; struct CloneItem *next; + }; + + struct MotdItem { + char line[82]; + struct MotdItem *next; }; struct ConfItem { diff -c -r irc2.8.21+CSr21/ircd/channel.c irc2.8.21+CSr22/ircd/channel.c *** irc2.8.21+CSr21/ircd/channel.c Thu Apr 4 21:01:53 1996 --- irc2.8.21+CSr22/ircd/channel.c Sat Apr 27 21:28:36 1996 *************** *** 905,917 **** /* check now so we eat the parameter if present */ if (keychange) break; - *parv = check_string(*parv); { ! u_char *s; for (s = (u_char *)*parv; *s; s++) *s &= 0x7f; } if (MyClient(sptr) && opcnt >= MAXMODEPARAMS) break; if (!fm) --- 905,917 ---- /* check now so we eat the parameter if present */ if (keychange) break; { ! register u_char *s; for (s = (u_char *)*parv; *s; s++) *s &= 0x7f; } + *parv = check_string(*parv); if (MyClient(sptr) && opcnt >= MAXMODEPARAMS) break; if (!fm) *************** *** 2441,2447 **** oldmode = &chptr->mode; ! /* Enables TS */ if (newts == 0) if (haveops || !doesop) tstosend = oldts; --- 2441,2447 ---- oldmode = &chptr->mode; ! /* Enables TS if (newts == 0) if (haveops || !doesop) tstosend = oldts; *************** *** 2453,2464 **** else tstosend = 0; /* */ ! /* Disables TS: if (isnew) chptr->channelts = tstosend = newts; else if (newts == 0 || oldts == 0) chptr->channelts = tstosend = 0; ! */ else if (newts == oldts) tstosend = oldts; else if (newts < oldts) --- 2453,2464 ---- else tstosend = 0; /* */ ! /* Disables TS: */ if (isnew) chptr->channelts = tstosend = newts; else if (newts == 0 || oldts == 0) chptr->channelts = tstosend = 0; ! /* */ else if (newts == oldts) tstosend = oldts; else if (newts < oldts) diff -c -r irc2.8.21+CSr21/ircd/ircd.c irc2.8.21+CSr22/ircd/ircd.c *** irc2.8.21+CSr21/ircd/ircd.c Thu Apr 4 19:32:12 1996 --- irc2.8.21+CSr22/ircd/ircd.c Sat Apr 27 17:39:31 1996 *************** *** 37,42 **** --- 37,43 ---- #include "h.h" #include "dich_conf.h" + /* Lists to do K: line matching -Sol */ aConfList KList1 = { 0, NULL }; /* ordered */ aConfList KList2 = { 0, NULL }; /* ordered, reversed */ *************** *** 55,60 **** --- 56,66 ---- aConfList EList3 = { 0, NULL }; /* what we can't sort */ #endif /* E_LINES */ + #ifdef BETTER_MOTD + aMotd *motd; + struct tm *motd_tm; + #endif + int s_count = 1; /* All servers */ int c_count = 0; /* All clients */ int ch_count = 0; /* All channels */ *************** *** 390,396 **** continue; } #ifdef IDLE_CHECK - if (checkit2 && IsPerson(cptr)) idleflag = (checkit2 && IsPerson(cptr)) ? (idlelimit && !IsAnOper(cptr) && (currenttime-cptr->user->last > idlelimit) && !find_eline(cptr)) : 0; --- 396,401 ---- *************** *** 475,481 **** * on them - send a messgae to the user being killed * first. */ ! if (killflag) /* this is above: && IsPerson(cptr)) /* sendto_ops("Kill line active for %s", get_client_name(cptr, FALSE)); #ifdef IDLE_CHECK --- 480,486 ---- * on them - send a messgae to the user being killed * first. */ ! if (killflag) /* this is above: && IsPerson(cptr)) */ sendto_ops("Kill line active for %s", get_client_name(cptr, FALSE)); #ifdef IDLE_CHECK *************** *** 580,586 **** int portarg = 0; uid_t uid, euid; time_t delay = 0; ! #ifndef AIX struct rlimit r; #endif #ifdef DOG3 --- 585,591 ---- int portarg = 0; uid_t uid, euid; time_t delay = 0; ! #if !defined(AIX) && !defined(ULTRIX) struct rlimit r; #endif #ifdef DOG3 *************** *** 588,599 **** the main loop */ time_t nextfdlistcheck=0; /*end of priority code */ #endif - NOW = time(NULL); #ifdef DBUF_INIT dbuf_init(); /* set up some dbuf stuff to control paging */ #endif ! #ifndef AIX r.rlim_cur = MAXCONNECTIONS; r.rlim_max = MAXCONNECTIONS; setrlimit(RLIMIT_NOFILE, &r); --- 593,604 ---- the main loop */ time_t nextfdlistcheck=0; /*end of priority code */ #endif NOW = time(NULL); + read_motd(MOTD); #ifdef DBUF_INIT dbuf_init(); /* set up some dbuf stuff to control paging */ #endif ! #if !defined(AIX) && !defined(ULTRIX) r.rlim_cur = MAXCONNECTIONS; r.rlim_max = MAXCONNECTIONS; setrlimit(RLIMIT_NOFILE, &r); diff -c -r irc2.8.21+CSr21/ircd/s_conf.c irc2.8.21+CSr22/ircd/s_conf.c *** irc2.8.21+CSr21/ircd/s_conf.c Tue Jan 23 18:04:18 1996 --- irc2.8.21+CSr22/ircd/s_conf.c Sat Apr 27 20:49:39 1996 *************** *** 655,660 **** --- 655,667 ---- if (!tmp2->clients) free_conf(tmp2); } + #ifdef BETTER_MOTD + read_motd(MOTD); + #endif + #ifdef BUFFERED_LOGS + cs_buf_logs(1,"",0); + cs_buf_logs(2,"",0); + #endif rehashed = 1; return ret; } diff -c -r irc2.8.21+CSr21/ircd/s_misc.c irc2.8.21+CSr22/ircd/s_misc.c *** irc2.8.21+CSr21/ircd/s_misc.c Tue Jan 23 18:04:16 1996 --- irc2.8.21+CSr22/ircd/s_misc.c Sat Apr 27 21:09:26 1996 *************** *** 307,312 **** --- 307,361 ---- return namebuf; } + #ifdef BUFFERED_LOGS + + void cs_buf_logs(which, buf, len) + int which; + char *buf; + int len; + { + #define ULOGBUFFERLEN 4000 + #define CLOGBUFFERLEN 2000 + + static char userbuf[ULOGBUFFERLEN]; + static char clonebuf[CLOGBUFFERLEN]; + int userbuflen = 0, clonebuflen = 0, doit=0; + char *filename, *buffer; + int fd, *len2; + + switch(which) + { + case 1: + if (userbuflen+len >= ULOGBUFFERLEN-1) + doit++; + filename = FNAME_USERLOG; + buffer = userbuf; + len2 = &userbuflen; + break; + case 2: + if (clonebuflen+len >= CLOGBUFFERLEN-1) + doit++; + filename = FNAME_CLONELOG; + buffer = clonebuf; + len2 = &clonebuflen; + break; + } + if (!len || doit) + { + if ((fd = open(filename, O_WRONLY|O_APPEND)) != -1) + { + (void)write(fd, buffer, *len2); + close(fd); + } + *buffer = (char) 0; + *len2 = 0; + } + strcat(buffer, buf); + *len2 = *len2 + len; + } + + #endif + /* ** exit_client ** This is old "m_bye". Name changed, because this is not a *************** *** 340,346 **** { Reg1 aClient *acptr; Reg2 aClient *next; ! #ifdef FNAME_USERLOG time_t on_for; #endif char comment1[HOSTLEN + HOSTLEN + 2]; --- 389,395 ---- { Reg1 aClient *acptr; Reg2 aClient *next; ! #if defined(FNAME_USERLOG) || (defined(SYSLOG) && defined(SYSLOG_USERS)) time_t on_for; #endif char comment1[HOSTLEN + HOSTLEN + 2]; *************** *** 364,372 **** sptr->name, sptr->user->username, sptr->user->host); #endif ! #ifdef FNAME_USERLOG on_for = NOW - sptr->firsttime; ! # if defined(USE_SYSLOG) && defined(SYSLOG_USERS) if (IsPerson(sptr)) syslog(LOG_NOTICE, "%s (%3d:%02d:%02d): %s!%s@%s\n", myctime(sptr->firsttime), --- 413,422 ---- sptr->name, sptr->user->username, sptr->user->host); #endif ! #if defined(FNAME_USERLOG) || (defined(SYSLOG) && defined(SYSLOG_USERS)) on_for = NOW - sptr->firsttime; ! #endif ! #if defined(USE_SYSLOG) && defined(SYSLOG_USERS) if (IsPerson(sptr)) syslog(LOG_NOTICE, "%s (%3d:%02d:%02d): %s!%s@%s\n", myctime(sptr->firsttime), *************** *** 374,410 **** on_for % 60, sptr->name, sptr->user->username, sptr->user->host); ! # else { ! char linebuf[160]; ! int logfile; ! /* ! * This conditional makes the logfile active only after ! * it's been created - thus logging can be turned off by ! * removing the file. ! * ! * stop NFS hangs...most systems should be able to open a ! * file in 3 seconds. -avalon (curtesy of wumpus) ! */ ! if (IsPerson(sptr) && ! (logfile = open(FNAME_USERLOG, O_WRONLY|O_APPEND)) != -1) ! { ! (void)irc_sprintf(linebuf, ! "%s (%3d:%02d:%02d): %s!%s@%s [%s]\n", myctime(sptr->firsttime), on_for / 3600, (on_for % 3600)/60, on_for % 60, ! sptr->name, ! sptr->user->username, sptr->user->host, ! sptr->username); (void)write(logfile, linebuf, strlen(linebuf)); (void)close(logfile); } ! /* Modification by stealth@caen.engin.umich.edu */ } ! # endif ! #endif if (sptr->fd >= 0) { if (cptr != NULL && sptr != cptr) --- 424,457 ---- on_for % 60, sptr->name, sptr->user->username, sptr->user->host); ! #endif ! #ifdef FNAME_USERLOG { ! char linebuf[160]; ! int logfile, len; ! if (IsPerson(sptr)) ! { ! len = irc_sprintf(linebuf, ! "%s (%3d:%02d:%02d): %s!%s@%s [%s]\n", myctime(sptr->firsttime), on_for / 3600, (on_for % 3600)/60, on_for % 60, ! sptr->name, sptr->user->username, ! sptr->user->host, sptr->username); ! #ifdef BUFFERED_LOGS ! cs_buf_logs(1, linebuf, len); ! #else ! if ((logfile = open(FNAME_USERLOG, ! O_WRONLY|O_APPEND)) != -1) ! { (void)write(logfile, linebuf, strlen(linebuf)); (void)close(logfile); } ! #endif /* BUFFERED_LOGS */ ! } } ! #endif /* FNAME_OPERLOG */ if (sptr->fd >= 0) { if (cptr != NULL && sptr != cptr) diff -c -r irc2.8.21+CSr21/ircd/s_serv.c irc2.8.21+CSr22/ircd/s_serv.c *** irc2.8.21+CSr21/ircd/s_serv.c Thu Apr 4 20:37:40 1996 --- irc2.8.21+CSr22/ircd/s_serv.c Sat Apr 27 22:56:21 1996 *************** *** 51,72 **** #ifdef HIGHEST_CONNECTION int max_connection_count = 1, max_client_count = 1; #endif #ifdef HIGHEST_CONNECTION void check_max_count() { ! if (m_clients > max_client_count) ! max_client_count = m_clients; ! if ((m_clients + m_servers) > max_connection_count) ! { ! max_connection_count = m_clients + m_servers; ! if (max_connection_count % 10 == 0) ! sendto_flagops(1, ! "New highest connections: %d (%d clients)", ! max_connection_count, max_client_count); ! } } #endif /* HIGHEST_CONNECTION */ --- 51,76 ---- #ifdef HIGHEST_CONNECTION int max_connection_count = 1, max_client_count = 1; + time_t max_connection_time = 0; #endif #ifdef HIGHEST_CONNECTION void check_max_count() { ! if (!max_connection_time) ! max_connection_time = NOW; ! if (m_clients > max_client_count) ! max_client_count = m_clients; ! if ((m_clients + m_servers) > max_connection_count) ! { ! max_connection_count = m_clients + m_servers; ! max_connection_time = NOW; ! if (max_connection_count % 10 == 0) ! sendto_flagops(1, ! "New highest connections: %d (%d clients)", ! max_connection_count, max_client_count); ! } } #endif /* HIGHEST_CONNECTION */ *************** *** 1326,1331 **** --- 1330,1336 ---- Reg1 int i; int doall = 0, wilds = 0; char *name; + char *ptr; if (check_registered(sptr)) return 0; *************** *** 1443,1450 **** --- 1448,1458 ---- sendto_one(sptr, rpl_str(RPL_STATSUPTIME), me.name, parv[0], now/86400, (now/3600)%24, (now/60)%60, now%60); #ifdef HIGHEST_CONNECTION + ptr = ctime(&max_connection_time); sendto_one(sptr, rpl_str(RPL_STATSCONN), me.name, parv[0], max_connection_count, max_client_count); + sendto_one(sptr, ":%s %d %s :Highest connection reached at %s", + me.name, RPL_MOTD, parv[0], ptr); #endif break; } *************** *** 1580,1585 **** --- 1588,1594 ---- char *parv[]; { aClient *acptr; + char *ptr; if (check_registered_user(sptr)) return 0; *************** *** 1627,1634 **** --- 1636,1648 ---- sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, parv[0], m_cs, m_ss); #ifdef HIGHEST_CONNECTION + ptr = ctime(&max_connection_time); + if (strchr(ptr, '\n')) + *strchr(ptr, '\n') = (char) 0; sendto_one(sptr, rpl_str(RPL_STATSCONN), me.name, parv[0], max_connection_count, max_client_count); + sendto_one(sptr, ":%s %d %s :Highest connection reached at %s", + me.name, RPL_MOTD, parv[0], ptr); #endif return 0; } *************** *** 2149,2154 **** --- 2163,2172 ---- syslog(LOG_WARNING, "Server RESTART by %s\n", get_client_name(sptr,FALSE)); #endif + #ifdef BUFFERED_LOGS + cs_buf_logs(1,"",0); + cs_buf_logs(2,"",0); + #endif server_reboot(); return 0; } *************** *** 2343,2348 **** --- 2361,2411 ---- return 0; } + #ifdef BETTER_MOTD + + void read_motd(filename) + char *filename; + { + register aMotd *temp, *last; + struct stat sb; + char buffer[81], *blah; + FILE *st; + + while(motd) + { + temp = motd->next; + MyFree(motd); + motd = temp; + } + st = fopen(filename, "rt"); + if (!st) + return; + fstat(fileno(st), &sb); + motd_tm = localtime(&sb.st_mtime); + last = NULL; + while(!feof(st)) + { + fgets(buffer, 80, st); + if ((blah = strchr(buffer, '\n')) != NULL) + *blah = (char) 0; + if ((blah = strchr(buffer, '\r')) != NULL) + *blah = (char) 0; + temp = (aMotd *) MyMalloc(sizeof(aMotd)); + if (!temp) + outofmemory(); + strcpy(temp->line, buffer); + temp->next = NULL; + if (!motd) + motd = temp; + else + last->next = temp; + last = temp; + } + fclose(st); + } + + #endif + /* ** m_motd ** parv[0] = sender prefix *************** *** 2353,2373 **** int parc; char *parv[]; { int fd; char line[80]; Reg1 char *tmp; struct stat sb; struct tm *tm; if (check_registered(sptr)) return 0; if (hunt_server(cptr, sptr, ":%s MOTD :%s", 1,parc,parv)!=HUNTED_ISME) return 0; ! /* ! * stop NFS hangs...most systems should be able to open a file in ! * 3 seconds. -avalon (curtesy of wumpus) ! */ fd = open(MOTD, O_RDONLY); if (fd == -1) { --- 2416,2462 ---- int parc; char *parv[]; { + #ifdef BETTER_MOTD + register aMotd *temp; + struct tm *tm; + #else int fd; char line[80]; Reg1 char *tmp; struct stat sb; struct tm *tm; + #endif if (check_registered(sptr)) return 0; if (hunt_server(cptr, sptr, ":%s MOTD :%s", 1,parc,parv)!=HUNTED_ISME) return 0; ! ! #ifdef BETTER_MOTD ! tm = motd_tm; ! if (motd == NULL) ! { ! sendto_one(sptr, err_str(ERR_NOMOTD), me.name, parv[0]); ! return 0; ! } ! sendto_one(sptr, rpl_str(RPL_MOTDSTART), me.name, parv[0], me.name); ! sendto_one(sptr, ":%s %d %s :- %d/%d/%d %d:%02d", me.name, RPL_MOTD, ! parv[0], tm->tm_mday, tm->tm_mon+1, 1900+tm->tm_year, ! tm->tm_hour, tm->tm_min); ! temp=motd; ! while(temp) ! { ! sendto_one(sptr, rpl_str(RPL_MOTD), me.name, parv[0], temp->line); ! temp=temp->next; ! } ! sendto_one(sptr, rpl_str(RPL_ENDOFMOTD), me.name, parv[0]); ! return 0; ! #else ! ! /* Here's old MOTD way of opening and reading on every client connect ! and /MOTD. Pretty dumb if you ask me... */ ! fd = open(MOTD, O_RDONLY); if (fd == -1) { *************** *** 2393,2398 **** --- 2482,2488 ---- sendto_one(sptr, rpl_str(RPL_ENDOFMOTD), me.name, parv[0]); (void)close(fd); return 0; + #endif } /* *************** *** 2478,2483 **** --- 2568,2577 ---- sendto_one(acptr, ":%s ERROR :Terminated by %s", me.name, get_client_name(sptr, TRUE)); } + #ifdef BUFFERED_LOGS + cs_buf_logs(1,"",0); + cs_buf_logs(2,"",0); + #endif (void)s_die(); return 0; } diff -c -r irc2.8.21+CSr21/ircd/s_user.c irc2.8.21+CSr22/ircd/s_user.c *** irc2.8.21+CSr21/ircd/s_user.c Fri Apr 5 00:33:22 1996 --- irc2.8.21+CSr22/ircd/s_user.c Sat Apr 27 20:41:09 1996 *************** *** 618,637 **** sendto_flagops(1, "CloneBot protection activated against %s", user->host); if (clone->num >= NUM_CLONES) { - int logfile; #ifdef FNAME_CLONELOG ! if ((logfile = open(FNAME_CLONELOG, O_WRONLY|O_APPEND)) != -1) ! { ! (void)irc_sprintf(buf, ! "%s: Clonebot rejected: %s!%s@%s\n", ! myctime(NOW), parv[0], ! sptr->user->username, ! sptr->user->host); ! (void)write(logfile, buf, strlen(buf)); ! (void)close(logfile); ! } ! #endif sendto_flagops(1, "Rejecting clonebot: %s [%s@%s]", nick, username, user->host); #ifdef KILL_CLONES --- 618,641 ---- sendto_flagops(1, "CloneBot protection activated against %s", user->host); if (clone->num >= NUM_CLONES) { #ifdef FNAME_CLONELOG ! int logfile; ! int len; ! ! len = irc_sprintf(buf, "%s: Clonebot rejected: %s!%s@%s\n", ! myctime(NOW), parv[0], sptr->user->username, ! sptr->user->host); ! #ifdef BUFFERED_LOGS ! cs_buf_logs(2, buf, len); ! #else ! if ((logfile = open(FNAME_CLONELOG, O_WRONLY|O_APPEND)) != -1) ! { ! (void)write(logfile, buf, strlen(buf)); ! (void)close(logfile); ! } ! #endif /* BUFFERED_LOGS */ ! #endif /* FNAME_CLONELOG */ sendto_flagops(1, "Rejecting clonebot: %s [%s@%s]", nick, username, user->host); #ifdef KILL_CLONES *************** *** 2334,2347 **** #ifdef FNAME_OPERLOG { int logfile; ! /* * This conditional makes the logfile active only after * it's been created - thus logging can be turned off by * removing the file. - * - * stop NFS hangs...most systems should be able to open a - * file in 3 seconds. -avalon (curtesy of wumpus) */ if (IsPerson(sptr) && (logfile = open(FNAME_OPERLOG, O_WRONLY|O_APPEND)) != -1) --- 2338,2348 ---- #ifdef FNAME_OPERLOG { int logfile; ! /* * This conditional makes the logfile active only after * it's been created - thus logging can be turned off by * removing the file. */ if (IsPerson(sptr) && (logfile = open(FNAME_OPERLOG, O_WRONLY|O_APPEND)) != -1) *************** *** 2351,2362 **** parv[0], sptr->user->username, sptr->sockhost); (void)write(logfile, buf, strlen(buf)); - (void)close(logfile); } - /* Modification by pjg */ } ! #endif #ifdef USE_SERVICES check_services_butone(SERVICE_WANT_OPER, sptr, ":%s MODE %s :+o", parv[0], parv[0]); --- 2352,2361 ---- parv[0], sptr->user->username, sptr->sockhost); (void)write(logfile, buf, strlen(buf)); (void)close(logfile); } } ! #endif /* FNAME_OPERLOG */ #ifdef USE_SERVICES check_services_butone(SERVICE_WANT_OPER, sptr, ":%s MODE %s :+o", parv[0], parv[0]);