diff -c -N -r irc2.8.21+CSr7/common/irc_sprintf.c irc2.8.21+CSr8/common/irc_sprintf.c *** irc2.8.21+CSr7/common/irc_sprintf.c Mon Jun 19 07:12:25 1995 --- irc2.8.21+CSr8/common/irc_sprintf.c Mon Jul 31 19:23:34 1995 *************** *** 4,89 **** #include "common.h" #include "sys.h" ! /* ! * By Mika ! */ ! int irc_sprintf(outp, formp, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10) ! char *outp; ! char *formp; ! char *i0, *i1, *i2, *i3, *i4, *i5, *i6, *i7, *i8, *i9, *i10; { ! /* rp for Reading, wp for Writing, fp for the Format string */ ! /* we could hack this if we know the format of the stack */ ! char *inp[11]; ! Reg1 char *rp, *fp, *wp, **pp = inp; ! Reg1 char f; ! Reg1 int myi; ! int i; ! ! inp[0] = i0; ! inp[1] = i1; ! inp[2] = i2; ! inp[3] = i3; ! inp[4] = i4; ! inp[5] = i5; ! inp[6] = i6; ! inp[7] = i7; ! inp[8] = i8; ! inp[9] = i9; ! inp[10] = i10; ! ! /* ! * just scan the format string and puke out whatever is necessary ! * along the way... ! */ ! ! for (i = 0, wp = outp, fp = formp; (f = *fp++); ) ! if (f != '%') ! *wp++ = f; ! else ! switch (*fp++) ! { ! /* put the most common case at the top */ ! /* copy a string */ ! case 's': ! for (rp = *pp++; (*wp++ = *rp++); ) ! ; ! --wp; ! /* get the next parameter */ ! break; ! /* ! * reject range for params to this mean that the ! * param must be within 100-999 and this +ve int ! */ ! case 'd': ! case 'u': ! myi = (int)*pp++; ! if ((myi < 100) || (myi > 999)) ! { ! (void)sprintf(outp, formp, i0, i1, i2, ! i3, i4, i5, i6, i7, i8, ! i9, i10); ! return -1; ! } ! ! *wp++ = (char)(myi / 100 + (int) '0'); ! myi %= 100; ! *wp++ = (char)(myi / 10 + (int) '0'); ! myi %= 10; ! *wp++ = (char)(myi + (int) '0'); ! break; ! case 'c': ! *wp++ = (char)*pp++; ! break; ! case '%': ! *wp++ = '%'; ! break; ! default : ! (void)sprintf(outp, formp, i0, i1, i2, i3, i4, ! i5, i6, i7, i8, i9, i10); ! return -1; ! } ! *wp = '\0'; ! return wp - outp; ! } --- 4,97 ---- #include "common.h" #include "sys.h" ! /* the return value is the size of the string */ ! int irc_sprintf(outp,formp,in0p,in1p,in2p,in3p,in4p,in5p,in6p,in7p,in8p,in9p, ! in10p) ! char *outp; ! char *formp; ! char *in0p,*in1p,*in2p,*in3p,*in4p,*in5p,*in6p,*in7p,*in8p,*in9p,*in10p; { ! /* rp for Reading, wp for Writing, fp for the Format string */ ! char *inp[11]; /* we could hack this if we know the format of the stack */ ! register char *rp,*fp,*wp; ! register char f; ! register int i=0; ! ! inp[0]=in0p; inp[1]=in1p; inp[2]=in2p; inp[3]=in3p; inp[4]=in4p; ! inp[5]=in5p; inp[6]=in6p; inp[7]=in7p; inp[8]=in8p; inp[9]=in9p; ! inp[10]=in10p; ! ! fp = formp; ! wp = outp; ! ! rp = inp[i]; /* start with the first input string */ ! ! /* just scan the format string and puke out whatever is necessary ! along the way... */ + while (f = *(fp++)) { + + if (f!= '%') *(wp++) = f; + else + switch (*(fp++)) { + register char g; + + case 's': /* put the most common case at the top */ + while (g = *(rp++)) *(wp++) = g; /* copy a string */ + rp = inp[++i]; /* get the next parameter */ + break; + case 'd': + { + register int myint,quotient; + register int write=0; + myint = (int)rp; + + if (myint > 999 || myint < 0) goto barf; + if(quotient=myint/100) { + *(wp++) = (char) (quotient + (int) '0'); + myint %=100; + *(wp++) = (char) (myint/10 + (int) '0'); + } + else { + myint %=100; + if (quotient = myint/10) + *(wp++) = (char) (quotient + (int)'0'); + } + myint %=10; + *(wp++) = (char) ((myint) + (int) '0'); + + rp = inp[++i]; + } + break; + case 'u': + { + register unsigned int myuint; + myuint = (unsigned int)rp; + + if (myuint < 100 || myuint > 999) goto barf; + + *(wp++) = (char) ((myuint / 100) + (unsigned int) '0'); + myuint %=100; + *(wp++) = (char) ((myuint / 10) + (unsigned int) '0'); + myuint %=10; + *(wp++) = (char) ((myuint) + (unsigned int) '0'); + + rp = inp[++i]; + } + break; + case '%': + *(wp++) = '%'; + break; + default: + /* oh shit */ + goto barf; + break; + } + } + *wp = '\0'; /* leaves wp pointing to the terminating NULL in the string */ + return strlen(outp); + barf: + sprintf(outp,formp,in0p,in1p,in2p,in3p,in4p,in5p,in6p,in7p,in8p, + in9p,in10p); + return strlen(outp); + } diff -c -N -r irc2.8.21+CSr7/include/comstud.h irc2.8.21+CSr8/include/comstud.h *** irc2.8.21+CSr7/include/comstud.h Sat Aug 12 11:52:18 1995 --- irc2.8.21+CSr8/include/comstud.h Sat Aug 12 11:55:12 1995 *************** *** 158,164 **** want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr7/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c --- 158,164 ---- want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr8/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c *************** *** 242,248 **** and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr7/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client --- 242,248 ---- and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr8/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client diff -c -N -r irc2.8.21+CSr7/include/config.h irc2.8.21+CSr8/include/config.h *** irc2.8.21+CSr7/include/config.h Sat Aug 12 11:52:51 1995 --- irc2.8.21+CSr8/include/config.h Mon Jul 31 16:20:52 1995 *************** *** 102,109 **** * 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+CSr7/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr7/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 */ --- 102,109 ---- * 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+CSr8/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr8/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 */ *************** *** 117,124 **** * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr7/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr7/logs/opers.log" /* */ /* CHROOTDIR * --- 117,124 ---- * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr8/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr8/logs/opers.log" /* */ /* CHROOTDIR * diff -c -N -r irc2.8.21+CSr7/include/patchlevel.h irc2.8.21+CSr8/include/patchlevel.h *** irc2.8.21+CSr7/include/patchlevel.h Sat Aug 12 11:50:39 1995 --- irc2.8.21+CSr8/include/patchlevel.h Mon Jul 31 16:20:52 1995 *************** *** 17,21 **** */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr7" #endif --- 17,21 ---- */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr8" #endif diff -c -N -r irc2.8.21+CSr7/ircd/ircd.c irc2.8.21+CSr8/ircd/ircd.c *** irc2.8.21+CSr7/ircd/ircd.c Sat Aug 12 11:50:39 1995 --- irc2.8.21+CSr8/ircd/ircd.c Thu Aug 10 23:21:17 1995 *************** *** 389,394 **** --- 389,395 ---- #endif else (void)exit_client(cptr, cptr, &me, "Ping timeout"); + i = 0; continue; } else if (IsRegistered(cptr) && *************** *** 434,439 **** --- 435,443 ---- } #endif /* CLONE_CHECK */ } /* must end the for loop */ + #if defined(CLONE_CHECK) && defined(KILL_CLONES) + *clonekillhost = (char) 0; + #endif if (!oldest || oldest < currenttime) oldest = currenttime + PINGFREQUENCY; Debug((DEBUG_NOTICE,"Next check_ping() call at: %s, %d %d %d", diff -c -N -r irc2.8.21+CSr7/ircd/s_serv.c irc2.8.21+CSr8/ircd/s_serv.c *** irc2.8.21+CSr7/ircd/s_serv.c Sat Aug 12 11:50:39 1995 --- irc2.8.21+CSr8/ircd/s_serv.c Mon Jul 31 16:20:52 1995 *************** *** 1795,1812 **** sendto_one(sptr, ":%s NOTICE %s :Problem opening server configfile", me.name, parv[0]); return 0; } ! if (parv[2] && *parv[2]) { ! irc_sprintf(buffer, "#%s!%s@%s K'd: %s@%s: %s\n", ! sptr->name, sptr->user->username, ! sptr->user->host, ! user, host, parv[2]); ! if (write(out, buffer, strlen(buffer)) <= 0) ! { ! sendto_one(sptr, ":%s NOTICE %s :Problem writing to the configfile", me.name, parv[0]); ! close(out); ! return 0; ! } } irc_sprintf(buffer, "K:%s::%s\n", host, user); if (write(out, buffer, strlen(buffer)) <= 0) --- 1795,1809 ---- sendto_one(sptr, ":%s NOTICE %s :Problem opening server configfile", me.name, parv[0]); return 0; } ! irc_sprintf(buffer, "#%s!%s@%s K'd: %s@%s: %s\n", ! sptr->name, sptr->user->username, ! sptr->user->host, user, host, ! (parv[2] && *parv[2]) ? parv[2] : "No reason"); ! if (write(out, buffer, strlen(buffer)) <= 0) { ! sendto_one(sptr, ":%s NOTICE %s :Problem writing to the configfile", me.name, parv[0]); ! close(out); ! return 0; } irc_sprintf(buffer, "K:%s::%s\n", host, user); if (write(out, buffer, strlen(buffer)) <= 0) diff -c -N -r irc2.8.21+CSr7/ircd/s_user.c irc2.8.21+CSr8/ircd/s_user.c *** irc2.8.21+CSr7/ircd/s_user.c Sat Aug 12 11:50:25 1995 --- irc2.8.21+CSr8/ircd/s_user.c Mon Jul 31 16:20:52 1995 *************** *** 329,334 **** --- 329,335 ---- short oldstatus = sptr->status; anUser *user = sptr->user; int i; + int nullhost; /* Moved this to make_user user->last = time(NULL); -- CS *************** *** 338,343 **** --- 339,345 ---- if (MyConnect(sptr)) { + nullhost = (strcmp(user->host, "null") == 0); if (sptr->flags & FLAGS_GOTID) temp = sptr->username; else *************** *** 360,365 **** --- 362,373 ---- aconf = sptr->confs->value.aconf; if (sptr->flags & FLAGS_DOID && !(sptr->flags & FLAGS_GOTID)) { + char temp[USERLEN+1]; + + strncpyzt(temp, username, USERLEN+1); + *user->username = '~'; + (void)strncpy(&user->username[1], temp, USERLEN); + user->username[USERLEN] = '\0'; #ifdef IDENTD_ONLY ircstp->is_ref++; sendto_one(sptr, ":%s NOTICE %s :This server will not allow connections from sites that don't run RFC1413 (pidentd). You may obtain a version for UNIX/VAX/VMX from \"ftp.eskimo.com:/security/pidentd-2.5.1.tar.gz\" via anonymous FTP.", me.name, parv[0]); *************** *** 368,380 **** sendto_one(sptr, ":%s NOTICE %s : ", me.name, parv[0]); sendto_one(sptr, ":%s NOTICE %s :Users may wish to subscribe to a new mailing list 'identd-l'. This list is intended to help users install identd on their Unix, PC, Mac, and other machines.. Send email to majordomo@eskimo.com with the body of the message containing 'subscribe identd-l your@email.address'. Do NOT put anything in the subject line! It will be ignored.", me.name, parv[0]); return exit_client(cptr, sptr, &me, "Install identd"); - #else - char temp[USERLEN+1]; - - strncpyzt(temp, username, USERLEN+1); - *user->username = '~'; - (void)strncpy(&user->username[1], temp, USERLEN); - user->username[USERLEN] = '\0'; #endif } else if (sptr->flags & FLAGS_GOTID) --- 376,381 ---- *************** *** 420,432 **** { #endif #ifdef REJECT_BOTS if (!matches("*bot*", nick)||!matches("*Serv*", nick)|| !matches("*help*", nick)) { ircstp->is_ref++; sendto_flagops(1,"Rejecting bot: [%s!%s@%s]", nick, user->username, user->host); ! return exit_client(cptr, sptr, &me, "No bots outside of *eskimo.com allowed"); } #endif /* REJECT_BOTS */ #ifdef CLONE_CHECK --- 421,447 ---- { #endif #ifdef REJECT_BOTS + if (nullhost) + { + ircstp->is_ref++; + sendto_flagops(1,"Rejecting joh/com bot: [%s!%s@%s]", + nick, user->username, user->host); + return exit_client(cptr, sptr, &me, "No bots allowed"); + } + if (strstr(nick, "LameHelp")) + { + ircstp->is_ref++; + sendto_flagops(1,"Rejecting eggdrop bot: [%s!%s@%s]", + nick, user->username, user->host); + return exit_client(cptr, sptr, &me, "No bots allowed"); + } if (!matches("*bot*", nick)||!matches("*Serv*", nick)|| !matches("*help*", nick)) { ircstp->is_ref++; sendto_flagops(1,"Rejecting bot: [%s!%s@%s]", nick, user->username, user->host); ! return exit_client(cptr, sptr, &me, "No bots allowed"); } #endif /* REJECT_BOTS */ #ifdef CLONE_CHECK