diff -crN irc2.11.1p1/common/bsd.c irc2.11.1p1+jp8.1beta2/common/bsd.c *** irc2.11.1p1/common/bsd.c Wed Nov 17 01:39:46 2004 --- irc2.11.1p1+jp8.1beta2/common/bsd.c Sun Jun 12 03:29:38 2005 *************** *** 91,96 **** --- 91,102 ---- writecalls++; #endif retval = send(cptr->fd, str, len, 0); + + #ifdef JAPANESE + if (retval < 0) + retval = -errno; + #endif + /* ** Convert WOULDBLOCK to a return of "0 bytes moved". This ** should occur only if socket was non-blocking. Note, that diff -crN irc2.11.1p1/common/send.c irc2.11.1p1+jp8.1beta2/common/send.c *** irc2.11.1p1/common/send.c Wed Feb 23 01:34:02 2005 --- irc2.11.1p1+jp8.1beta2/common/send.c Sun Jun 12 11:59:28 2005 *************** *** 783,790 **** --- 783,795 ---- { if (*chptr->chname == '&') return; + #ifdef JAPANESE + if ((mask = get_channelmask(chptr->chname))) + mask++; + #else if ((mask = (char *)rindex(chptr->chname, ':'))) mask++; + #endif } else mask = (char *)NULL; *************** *** 796,801 **** --- 801,810 ---- continue; if (!BadPtr(mask) && match(mask, cptr->name)) continue; + #ifdef JAPANESE + if (!valid_channel(cptr, chptr, 0)) + continue; + #endif if (!len) { va_list va; *************** *** 818,825 **** --- 827,840 ---- { if (*chptr->chname == '&') return 0; + #ifdef JAPANESE + if ((mask = get_channelmask(chptr->chname))) + mask++; + #else if ((mask = (char *)rindex(chptr->chname, ':'))) mask++; + #endif + } else mask = (char *)NULL; *************** *** 831,836 **** --- 846,856 ---- continue; if (!BadPtr(mask) && match(mask, cptr->name)) continue; + #ifdef JAPANESE + if (!valid_channel(cptr, chptr, 0)) + continue; + #endif + #if 0 /* We're not using it for now, so just save some cpu. ** Revive once we need it --B. */ *************** *** 866,873 **** --- 886,898 ---- { if (*chptr->chname == '&') return 0; + #ifdef JAPANESE + if ((mask = get_channelmask(chptr->chname))) + mask++; + #else if ((mask = (char *)rindex(chptr->chname, ':'))) mask++; + #endif } else mask = (char *)NULL; *************** *** 879,884 **** --- 904,915 ---- continue; if (!BadPtr(mask) && match(mask, cptr->name)) continue; + + #ifdef JAPANESE + if (!valid_channel(cptr, chptr, 0)) + continue; + #endif + if ((ver & cptr->serv->version) != 0) { rc = 1; diff -crN irc2.11.1p1/common/struct_def.h irc2.11.1p1+jp8.1beta2/common/struct_def.h *** irc2.11.1p1/common/struct_def.h Wed Mar 30 08:23:49 2005 --- irc2.11.1p1+jp8.1beta2/common/struct_def.h Sun Jun 12 03:29:38 2005 *************** *** 175,180 **** --- 175,183 ---- ** a SQUIT. */ #define FLAGS_EOB 0x4000000 /* EOB received */ #define FLAGS_LISTENINACTIVE 0x8000000 /* Listener does not listen() */ + #ifdef JAPANESE + #define FLAGS_JP 0x10000000 /* jp version */ + #endif #define FLAGS_OPER 0x0001 /* operator */ #define FLAGS_LOCOP 0x0002 /* local operator -- SRB */ *************** *** 675,680 **** --- 678,686 ---- Link *clist; /* list of local! connections which are members */ time_t history; /* channel history (aka channel delay) */ time_t reop; /* server reop stamp for !channels */ + #ifdef JAPANESE + int flags; + #endif char chname[1]; }; diff -crN irc2.11.1p1/common/support.c irc2.11.1p1+jp8.1beta2/common/support.c *** irc2.11.1p1/common/support.c Sat Feb 5 03:08:48 2005 --- irc2.11.1p1+jp8.1beta2/common/support.c Sun Jun 12 03:29:38 2005 *************** *** 54,59 **** --- 54,65 ---- { char *pos = *save; /* keep last position across calls */ Reg char *tmp; + #ifdef JAPANESE + int flag = 0; + + if (fs[0] == ',' && fs[1] == '\0' ) + flag=1; + #endif if (str) pos = str; /* new string scan */ *************** *** 66,74 **** --- 72,101 ---- tmp = pos; /* now, keep position of the token */ + #ifdef JAPANESE + if (flag) { + flag = 0; + while (*pos) { + if (!flag && *pos == ',') { + break; + } else if (pos[0] == '\033' && pos[1] == '$' && pos[2] == 'B') { + pos += 3; + flag = 1; + } else if (pos[0] == '\033' && pos[1] == '(' && pos[2] == 'B') { + pos += 3; + flag = 0; + } else { + pos++; + } + } + } else { + #endif while (*pos && index(fs, *pos) == NULL) pos++; /* skip content of the token */ + #ifdef JAPANESE + } + #endif if (*pos) *pos++ = '\0'; /* remove first sep after the token */ else *************** *** 742,748 **** --- 769,779 ---- char *make_version(void) { int ve, re, mi, dv, pl; + #ifdef JAPANESE + char ver[20]; + #else char ver[15]; + #endif sscanf(PATCHLEVEL, "%2d%2d%2d%2d%2d", &ve, &re, &mi, &dv, &pl); /* version & revision */ *************** *** 754,759 **** --- 785,793 ---- sprintf(ver + strlen(ver), "%c%d", DEVLEVEL, dv); if (pl) /* patchlevel */ sprintf(ver + strlen(ver), "p%d", pl); + #ifdef JAPANESE + strcat(ver,"+jp8"); + #endif return mystrdup(ver); } diff -crN irc2.11.1p1/doc/README-jp irc2.11.1p1+jp8.1beta2/doc/README-jp *** irc2.11.1p1/doc/README-jp Thu Jan 1 09:00:00 1970 --- irc2.11.1p1+jp8.1beta2/doc/README-jp Sun Jun 12 03:29:38 2005 *************** *** 0 **** --- 1,101 ---- + IRC server jp-patched version (2005/01/07 irc2.11.0-irc2.11.0+jp8.patch) + + このjp-patched versionは、IRC server (ftp://ftp.irc.org/irc/server/) に + 対して主に以下のような機能を付加したものです。 + + ・日本語対応IRCクライアントの多くが持っている不備を補うため、 + 多くのケースでユーザが不便な状態になるのを防ぐための機能。 + (最終的には、各クライアントの実装で解決するべき部分。) + ・IRCサーバの元々の仕様のために日本語を用いる上でユーザの利便性が + 失われている面を部分的に解決するための機能。 + + 最新のjp6版においては、いままではチャネル名に使用することができなかった、 + あるいは、使用において制限されていた、ISO-2022-JPにおける数百文字の漢字を + チャネル名の中ですべて使用することができるように対応しています。(いわゆる + #がが 問題への対応、および、#ずず 問題への対応。) この機能はjp6版以降の + 対応サーバ間でのみ有効となりますが、該当するチャネルはちょうどマスク付 + チャネル(例えば、#abc:*.jpなど)と同じ位置付けになるため、同じIRC網内に + 非対応サーバとの接続があっても相互接続上のプロトコルに影響がないように + 実装されています。 + + 今後も、本体の irc2.x と矛盾なく実現可能な機能について可能な限り実装を + 行なっていく予定です。要望や改善案などがありましたらよろしくお願いします。 + また、bug情報および不具合や問題点なども可能な限り対応したいと思いますので、 + それらについてもみなさまからの情報をお待ちしております。 + + 変更履歴 + + jp8 ← jp7 + irc2.11.0対応 + + jp7 ← jp6 + irc2.10.3p3対応 + + jp6 ← jp5 + irc2.10.3対応 + ircd/s_user.cにおけるチャネル名正規化洩れをfix + split時に発生するチャネルマスク関係の伝播洩れbugをfix + GOOD_USERNAMEを A-Z,a-z,0-9,_,-,. へと増加 + いわゆる #がが 問題に対応して利用可能へ + いわゆる #ずず 問題に対応して利用可能へ + + jp5 ← jp4 + ircd/channel.cにおけるチャネル名正規化bugをfix + + jp4 ← jp3 + irc2.9.5対応 + common/send.cにおけるdeliver_it()でのエラー時にエラー情報を返すため、 + common/bsd.cでのdeliver_it()の戻り値を-1ではなく-errnoを返すようにした。 + + jp3 ← jp2 + irc2.9.4対応 + GOOD_USERNAMEでのjp2y1b版に合わせた。 + A-Z,a-z,0-9,_,- の任意の組み合わせでOKと緩和 + + 注意事項 + + 入手先: http://www.ircnet.jp/dist/server/jp-patch/ + 告知先: http://www.ircnet.jp/ + 連絡先: mailto:jp-patch@ircnet.jp + + このjp-patched版は 菊地高広 が作成管理しています。 + 不具合などがありましたら jp-patch@ircnet.jp までお願いします。 + 今後の情報などは http://www.ircnet.jp/ で告知する予定です。 + + 本体及びpatchともにGPLに従います。詳しくはdoc/の下の文書類をどうぞ。 + ただし、このpatchを利用したものを改変して再配布する場合は、この文書を + そのまま付けるとともに jp-patch@kyoto.wide.ad.jp まで連絡をいただける + と幸いです。改変なくそのまま再配布する場合は自由にしてくださって結構です。 + + その他の関連情報 + + JIRCC (Japan Internet-Relay-Chat Club) + JIRCCは日本におけるIRCの普及とIRCer間の交流ををはかるために + 1990年3月にできたIRCのユーザ会です。メーリングリストがあり、 + IRCに関する種々の情報交換や議論や告知が行なわれてきています。 + + jircc mailing list + IRC全般に関するメーリングリストです。 + jircc-request@irc.kyoto-u.ac.jp へメールを送ると参加方法が + 自動返送されてきます。メールの内容はあっても空でも大丈夫です。 + + jircc-oper mailing list + IRC運用に関するメーリングリストです。 + jircc-oper-request@irc.kyoto-u.ac.jp へメールを送ると参加方法が + 自動返送されてきます。メールの内容はあっても空でも大丈夫です。 + なお、jircc-operメーリングリストは jirccメーリングリストの + サブリスト的な位置付けとなっており特にサーバや網の運用を扱います。 + 内容に応じて jirccメーリングリスト本体へ戻って行なうことがあり + ますので、jirccメーリングリストのほうへも参加をしておいて下さい。 + + http://www.ircnet.jp/ + (旧) http://irc.kyoto-u.ac.jp/ + IRCに関する情報を集めたページです。 + + 謝辞 + + 本patchの開発及びdebuggingにおいて、開発環境や多くの便宜を与えてくれた + 情報技術開発株式会社京都ネットワーク技術研究所 http://www.rcac.tdi.co.jp/ + 及び、その皆様方に感謝の意を表わしたいと思います。また、動作確認など + 実運用に際して利用させていただいたIRCnet、及び、その多くのユーザの皆様方に + 対し、ここに感謝の意を表わしたいと思います。 diff -crN irc2.11.1p1/ircd/channel.c irc2.11.1p1+jp8.1beta2/ircd/channel.c *** irc2.11.1p1/ircd/channel.c Sat May 28 01:56:42 2005 --- irc2.11.1p1+jp8.1beta2/ircd/channel.c Mon Jun 13 03:48:36 2005 *************** *** 53,58 **** --- 53,63 ---- static int can_join (aClient *, aChannel *, char *); void channel_modes (aClient *, char *, char *, aChannel *); static int check_channelmask (aClient *, aClient *, char *); + + #ifdef JAPANESE + static int special_channel __P((char *)); + #endif + static aChannel *get_channel (aClient *, char *, int); static int set_mode (aClient *, aClient *, aChannel *, int *, int, char **); *************** *** 618,623 **** --- 623,705 ---- return 0; } + #ifdef JAPANESE + char *get_channelmask(chname) + char *chname; + { + char *mask; + + mask = rindex(chname, ':'); + if (mask && !index(mask, '\033')) + return mask; + + return NULL; + } + + int special_channel(chname) + char *chname; + { + char *mask; + char *cn; + int flag=0; + mask = rindex(chname, ':'); + if (mask && index(mask, '\033')) + return 1; + if (index(chname, ',')) + return 1; + + cn=chname; + while (*cn) + { + switch (*cn) + { + case '\033': + if (cn[1] == '$' && cn[2] == 'B') { + cn += 3; + flag = 1; + break; + } else if (cn[1] == '(' && cn[2] == 'B') { + cn += 3; + flag = 0; + break; + }else{ + cn++; break; + } + /* Never Reach Here */ + + case '{': + case '}': + case '~': + case '\\': + if (flag ==1){ + return 1; + }else{ + cn++; + break; + } + /* Never Reach Here */ + + default: + cn++; break; + } + } + return 0; + } + + int valid_channel(cptr, chptr, chname) + aClient *cptr; + aChannel *chptr; + char *chname; + { + if (((chptr && (chptr->flags & FLAGS_JP)) || + (chname && special_channel(chname))) && + (!cptr || (IsServer(cptr) && !(cptr->flags & FLAGS_JP)))) + return 0; + + return 1; + } + #endif + aChannel *find_channel(char *chname, aChannel *chptr) { aChannel *achptr = chptr; *************** *** 843,848 **** --- 925,934 ---- if (check_channelmask(&me, cptr, chptr->chname)) return; + #ifdef JAPANESE + if (!valid_channel (cptr, chptr, 0)) + return; + #endif *modebuf = *parabuf = '\0'; channel_modes(cptr, modebuf, parabuf, chptr); *************** *** 885,890 **** --- 971,980 ---- if (check_channelmask(&me, cptr, chptr->chname) == -1) return; + #ifdef JAPANESE + if (!valid_channel(cptr, chptr, 0)) + return; + #endif sprintf(buf, ":%s NJOIN %s :", me2, chptr->chname); len = strlen(buf); *************** *** 975,982 **** --- 1065,1077 ---- *modebuf = *parabuf = '\0'; modebuf[1] = '\0'; channel_modes(sptr, modebuf, parabuf, chptr); + #ifdef JAPANESE + sendto_one(sptr, replies[RPL_CHANNELMODEIS], ME, BadTo(parv[0]), + chptr->chname, modebuf, parabuf); + #else sendto_one(sptr, replies[RPL_CHANNELMODEIS], ME, BadTo(parv[0]), name, modebuf, parabuf); + #endif penalty += 1; } else /* Check parameters for the channel */ *************** *** 1934,1945 **** --- 2029,2062 ---- void clean_channelname(char *cn) { + #ifdef JAPANESE + int flag = 0; + + while (*cn) { + if (*cn == '\007' || *cn == ' ') { + *cn = '\0'; + return; + } else if (!flag && *cn == ',') { + *cn = '\0'; + return; + } else if (cn[0] == '\033' && cn[1] == '$' && cn[2] == 'B') { + cn += 3; + flag = 1; + } else if (cn[0] == '\033' && cn[1] == '(' && cn[2] == 'B') { + cn += 3; + flag = 0; + } else { + cn++; + } + } + #else for (; *cn; cn++) if (*cn == '\007' || *cn == ' ' || *cn == ',') { *cn = '\0'; return; } + #endif } /* *************** *** 1951,1957 **** --- 2068,2079 ---- if (*chname == '&' && IsServer(cptr)) return -1; + #ifdef JAPANESE + s = get_channelmask(chname); + #else s = rindex(chname, ':'); + #endif + if (!s) return 0; s++; *************** *** 1959,1966 **** || match(s, ME) || (IsServer(cptr) && match(s, cptr->name))) { if (MyClient(sptr)) ! sendto_one(sptr, replies[ERR_BADCHANMASK], ME, ! BadTo(sptr->name), chname); return -1; } return 0; --- 2081,2088 ---- || match(s, ME) || (IsServer(cptr) && match(s, cptr->name))) { if (MyClient(sptr)) ! sendto_one(sptr, replies[ERR_BADCHANMASK], ME, ! BadTo(sptr->name), chname); return -1; } return 0; *************** *** 1983,1988 **** --- 2105,2114 ---- { len = CHANNELLEN; *(chname+CHANNELLEN) = '\0'; + #ifdef JAPANESE + if (check_channelmask(cptr, cptr, chname) == -1) + return NULL; + #endif } if ((chptr = find_channel(chname, (aChannel *)NULL))) return (chptr); *************** *** 1996,2001 **** --- 2122,2132 ---- chptr->prevch = NULL; chptr->nextch = channel; chptr->history = 0; + #ifdef JAPANESE + chptr->flags = 0; + if (special_channel(chname)) + chptr->flags = FLAGS_JP; + #endif channel = chptr; (void)add_to_channel_hash_table(chname, chptr); } *************** *** 2097,2102 **** --- 2228,2234 ---- } } } + } /* *************** *** 2406,2428 **** --- 2538,2579 ---- /* Complete user entry to the new channel */ add_user_to_channel(chptr, sptr, flags); /* Notify all users on the channel */ + #ifdef JAPANESE + sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s", + parv[0], chptr->chname); + #else sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s", parv[0], name); + #endif del_invite(sptr, chptr); if (chptr->topic[0] != '\0') { + #ifdef JAPANESE + sendto_one(sptr, replies[RPL_TOPIC], ME, + BadTo(parv[0]), chptr->chname, chptr->topic); + #else sendto_one(sptr, replies[RPL_TOPIC], ME, BadTo(parv[0]), name, chptr->topic); + #endif #ifdef TOPIC_WHO_TIME if (chptr->topic_t > 0) { + #ifdef JAPANESE + sendto_one(sptr, replies[RPL_TOPIC_WHO_TIME], + ME, BadTo(parv[0]), + chptr->chname, IsAnonymous(chptr) ? + "anonymous!anonymous@anonymous." : + chptr->topic_nuh, + chptr->topic_t); + #else sendto_one(sptr, replies[RPL_TOPIC_WHO_TIME], ME, BadTo(parv[0]), name, IsAnonymous(chptr) ? "anonymous!anonymous@anonymous." : chptr->topic_nuh, chptr->topic_t); + #endif } #endif } *************** *** 2436,2442 **** --- 2587,2598 ---- /* ** notify other servers */ + #ifdef JAPANESE + if (!valid_channel(0,chptr, 0) || get_channelmask(name) + || *chptr->chname == '!') /* compat */ + #else if (index(name, ':') || *chptr->chname == '!') /* compat */ + #endif { sendto_match_servs_v(chptr, cptr, SV_UID, ":%s NJOIN %s :%s%s", me.serv->sid, name, *************** *** 2633,2640 **** --- 2789,2802 ---- ** join from netjoin. 2.10.x is using NJOIN only during ** burst, but 2.11 always. Hence we check for EOB from 2.11 ** to know what kind of NJOIN it is. --B. */ + #ifdef JAPANESE + sendto_channel_butserv(chptr, acptr, ":%s JOIN %s%s", acptr->name, + (IsServer(sptr) || IsBursting(sptr)) ? "" : ":", chptr->chname); + #else + sendto_channel_butserv(chptr, acptr, ":%s JOIN %s%s", acptr->name, IsBursting(sptr) ? "" : ":", parv[1]); + #endif /* build MODE for local users on channel, eventually send it */ if (*mbuf) { *************** *** 2664,2674 **** --- 2826,2845 ---- } break; case 2: + #ifdef JAPANESE + sendto_channel_butserv(chptr, &me, + ":%s MODE %s +%s%c %s %s", + sptr->name, + chptr->chname, + modebuf, mbuf[1], + parabuf, acptr->name); + #else sendto_channel_butserv(chptr, &me, ":%s MODE %s +%s%c %s %s", sptr->name, parv[1], modebuf, mbuf[1], parabuf, acptr->name); + #endif if (mbuf[2]) { strcpy(modebuf, mbuf+2); *************** *** 2681,2698 **** --- 2852,2883 ---- } if (cnt == MAXMODEPARAMS) { + #ifdef JAPANESE + sendto_channel_butserv(chptr, &me, + ":%s MODE %s +%s %s", + sptr->name, + chptr->chname, + modebuf, parabuf); + #else sendto_channel_butserv(chptr, &me, ":%s MODE %s +%s %s", sptr->name, parv[1], modebuf, parabuf); + #endif cnt = 0; } } } /* send eventual MODE leftover */ if (cnt) + #ifdef JAPANESE + sendto_channel_butserv(chptr, &me, ":%s MODE %s +%s %s", + sptr->name, chptr->chname, + modebuf, parabuf); + #else sendto_channel_butserv(chptr, &me, ":%s MODE %s +%s %s", sptr->name, parv[1], modebuf, parabuf); + #endif /* send NJOIN */ *u = '\0'; *************** *** 2754,2760 **** --- 2939,2950 ---- /* ** Remove user from the old channel (if any) */ + #ifdef JAPANESE + if (valid_channel(0, chptr, 0) + && !get_channelmask(name) && (*chptr->chname != '!')) + #else if (!index(name, ':') && (*chptr->chname != '!')) + #endif { /* channel:*.mask */ if (*name != '&') { *************** *** 2778,2785 **** --- 2968,2980 ---- else sendto_match_servs(chptr, cptr, PartFmt, sptr->user->uid, name, comment); + #ifdef JAPANESE + sendto_channel_butserv(chptr, sptr, PartFmt, + parv[0], chptr->chname, comment); + #else sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name, comment); + #endif remove_user_from_channel(sptr, chptr); } if (*buf) *************** *** 2883,2891 **** --- 3078,3093 ---- if (IsMember(who, chptr)) { /* Local clients. */ + #ifdef JAPANESE + sendto_channel_butserv(chptr, sptr, + ":%s KICK %s %s :%s", sptr->name, + chptr->chname, + who->name, comment); + #else sendto_channel_butserv(chptr, sptr, ":%s KICK %s %s :%s", sptr->name, name, who->name, comment); + #endif /* Nick buffer to kick out. */ /* as we need space for ",nick", we should add *************** *** 3071,3076 **** --- 3273,3286 ---- if (*parv[2] == '&' && !MyClient(acptr)) return 1; chptr = find_channel(parv[2], NullChn); + #ifdef JAPANESE + if(!valid_channel(acptr->from, chptr, parv[2])) + { + sendto_one(sptr, replies[ERR_BADCHANMASK], ME, + chptr ? chptr->chname : parv[2]); + return 1; + } + #endif if (!chptr && parv[2][0] == '!') { /* Try to find !channel using shortname */ *************** *** 3241,3249 **** --- 3451,3465 ---- chptr = find_channel(name, NullChn); if (chptr && ShowChannel(sptr, chptr) && sptr->user) { + #ifdef JAPANESE + rlen += sendto_one(sptr, replies[RPL_LIST], + ME, BadTo(parv[0]), chptr->chname, + chptr->users, chptr->topic); + #else rlen += sendto_one(sptr, replies[RPL_LIST], ME, BadTo(parv[0]), name, chptr->users, chptr->topic); + #endif if (!MyConnect(sptr) && rlen > CHREPLLEN) break; } diff -crN irc2.11.1p1/ircd/channel_ext.h irc2.11.1p1+jp8.1beta2/ircd/channel_ext.h *** irc2.11.1p1/ircd/channel_ext.h Sat Oct 18 06:28:18 2003 --- irc2.11.1p1+jp8.1beta2/ircd/channel_ext.h Sun Jun 12 03:29:38 2005 *************** *** 38,43 **** --- 38,49 ---- EXTERN int is_chan_op (aClient *cptr, aChannel *chptr); EXTERN int has_voice (aClient *cptr, aChannel *chptr); EXTERN int can_send (aClient *cptr, aChannel *chptr); + + #ifdef JAPANESE + EXTERN char *get_channelmask __P((char *)); + EXTERN int valid_channel __P((aClient *, aChannel *, char *)); + #endif + EXTERN aChannel *find_channel (Reg char *chname, Reg aChannel *chptr); EXTERN void setup_server_channels (aClient *mp); EXTERN void channel_modes (aClient *cptr, Reg char *mbuf, Reg char *pbuf, diff -crN irc2.11.1p1/ircd/s_bsd.c irc2.11.1p1+jp8.1beta2/ircd/s_bsd.c *** irc2.11.1p1/ircd/s_bsd.c Mon Feb 21 21:52:24 2005 --- irc2.11.1p1+jp8.1beta2/ircd/s_bsd.c Sun Jun 12 03:29:38 2005 *************** *** 1231,1244 **** --- 1231,1257 ---- } if (!BadPtr(aconf->passwd)) #ifndef ZIP_LINKS + #ifdef JAPANESE + sendto_one(cptr, "PASS %s %s IRC|%s %sj", aconf->passwd, + pass_version, serveropts, + (bootopt & BOOT_STRICTPROT) ? "P" : ""); + #else sendto_one(cptr, "PASS %s %s IRC|%s %s", aconf->passwd, pass_version, serveropts, (bootopt & BOOT_STRICTPROT) ? "P" : ""); + #endif + #else + #ifdef JAPANESE + sendto_one(cptr, "PASS %s %s IRC|%s %s%sj", aconf->passwd, + pass_version, serveropts, + (bootopt & BOOT_STRICTPROT) ? "P" : "", + (aconf->status == CONF_ZCONNECT_SERVER) ? "Z" : ""); #else sendto_one(cptr, "PASS %s %s IRC|%s %s%s", aconf->passwd, pass_version, serveropts, (bootopt & BOOT_STRICTPROT) ? "P" : "", (aconf->status == CONF_ZCONNECT_SERVER) ? "Z" : ""); + #endif #endif aconf = find_conf(cptr->confs, cptr->name, CONF_NOCONNECT_SERVER); diff -crN irc2.11.1p1/ircd/s_send.c irc2.11.1p1+jp8.1beta2/ircd/s_send.c *** irc2.11.1p1/ircd/s_send.c Tue Feb 8 10:49:05 2005 --- irc2.11.1p1+jp8.1beta2/ircd/s_send.c Sun Jun 12 03:29:38 2005 *************** *** 367,373 **** --- 367,377 ---- { return; } + #ifdef JAPANESE + if ((mask = get_channelmask(chptr->chname))) + #else if ((mask = rindex(chptr->chname, ':'))) + #endif { mask++; } diff -crN irc2.11.1p1/ircd/s_serv.c irc2.11.1p1+jp8.1beta2/ircd/s_serv.c *** irc2.11.1p1/ircd/s_serv.c Sun May 15 05:51:26 2005 --- irc2.11.1p1+jp8.1beta2/ircd/s_serv.c Sun Jun 12 03:29:38 2005 *************** *** 385,390 **** --- 385,395 ---- } } + #ifdef JAPANESE + if (link && strchr(link, 'j')) /* jp version */ + cptr->flags |= FLAGS_JP; + #endif + /* right now, I can't code anything good for this */ /* Stop whining, and do it! ;) */ if (link && strchr(link, 'Z')) /* Compression requested */ *************** *** 1027,1040 **** if (bconf->passwd[0]) #ifndef ZIP_LINKS ! sendto_one(cptr, "PASS %s %s IRC|%s %s", bconf->passwd, ! pass_version, serveropts, (bootopt & BOOT_STRICTPROT) ? "P" : ""); #else sendto_one(cptr, "PASS %s %s IRC|%s %s%s", bconf->passwd, pass_version, serveropts, (bconf->status == CONF_ZCONNECT_SERVER) ? "Z" : "", (bootopt & BOOT_STRICTPROT) ? "P" : ""); #endif /* ** Pass my info to the new server --- 1032,1058 ---- if (bconf->passwd[0]) #ifndef ZIP_LINKS ! #ifdef JAPANESE ! sendto_one(cptr, "PASS %s %s IRC|%s %sj", ! bconf->passwd, pass_version, serveropts, ! (bootopt & BOOT_STRICTPROT) ? "P" : ""); ! #else ! sendto_one(cptr, "PASS %s %s IRC|%s %s", ! bconf->passwd, pass_version, serveropts, ! (bootopt & BOOT_STRICTPROT) ? "P" : ""); ! #endif ! #else ! #ifdef JAPANESE ! sendto_one(cptr, "PASS %s %s IRC|%s %s%sj", ! bconf->passwd, pass_version, serveropts, ! (bconf->status == CONF_ZCONNECT_SERVER) ? "Z" : "", (bootopt & BOOT_STRICTPROT) ? "P" : ""); #else sendto_one(cptr, "PASS %s %s IRC|%s %s%s", bconf->passwd, pass_version, serveropts, (bconf->status == CONF_ZCONNECT_SERVER) ? "Z" : "", (bootopt & BOOT_STRICTPROT) ? "P" : ""); + #endif #endif /* ** Pass my info to the new server diff -crN irc2.11.1p1/ircd/s_user.c irc2.11.1p1+jp8.1beta2/ircd/s_user.c *** irc2.11.1p1/ircd/s_user.c Thu Apr 14 08:10:37 2005 --- irc2.11.1p1+jp8.1beta2/ircd/s_user.c Sun Jun 12 14:17:14 2005 *************** *** 583,591 **** --- 583,634 ---- XLINE_EXIT_REASON); } #endif + + #ifdef GOOD_USERNAME + for (i = 0; i < USERLEN; i++) + { + if (!user->username[i]) + break; + if (i == 0 && prefix) + continue; + if (!isalnum(user->username[i]) && + !strchr("-_.", user->username[i])) + { + sendto_flag(SCH_LOCAL, "Bad username %s@%s.", + user->username, sptr->sockhost); + ircstp->is_ref++; + sptr->exitc = EXITC_REF; + #if defined(USE_SYSLOG) && defined(SYSLOG_CONN) + syslog(LOG_NOTICE, "%s (%s): %s@%s [%s] %c\n", + myctime(sptr->firsttime), " Badname ", + user->username, user->host, + sptr->auth, '-'); + #endif + #ifdef FNAME_CONNLOG + sendto_flog(sptr, " Badname ", user->username, + user->host); + #endif + sprintf(buf, "Bad username: %s", + user->username); + return exit_client(cptr, sptr, &me, buf); + } + } + #endif + } else { + #ifdef GOOD_USERNAME + for (i = 0; i < USERLEN; i++) + { + if (!username[i]) + break; + if (!isalnum(username[i]) && + !strchr("^~+=-_.", username[i])) + username[i] = '.'; + } + #endif + /* Received from other server in UNICK */ strncpyzt(user->username, username, USERLEN+1); } diff -crN irc2.11.1p1/ircd/version.c.SH.in irc2.11.1p1+jp8.1beta2/ircd/version.c.SH.in *** irc2.11.1p1/ircd/version.c.SH.in Wed Dec 29 05:55:12 2004 --- irc2.11.1p1+jp8.1beta2/ircd/version.c.SH.in Sun Jun 12 03:29:38 2005 *************** *** 111,116 **** --- 111,121 ---- "Thanks also to those who provide the kind sys admins who let me and", "others continue to develop IRC.", "", + "This program is a jp-patched version. The jp-patch was written by", + "KIKUCHI Takahiro , and is ported to 2.11 by", + "MARUYAMA Shin . You can find it in", + "http://www.ircnet.jp/dist/server/jp-patch/.", + "", "[$sumsserv] [$sumchan] [$sumsbsd] [$sumsuser]", "[$sumhash] [$sumsmisc] [$sumircd]", 0, diff -crN irc2.11.1p1/support/Makefile.in irc2.11.1p1+jp8.1beta2/support/Makefile.in *** irc2.11.1p1/support/Makefile.in Thu Apr 14 08:18:57 2005 --- irc2.11.1p1+jp8.1beta2/support/Makefile.in Sun Jun 12 14:20:14 2005 *************** *** 29,35 **** # compiler program CC = @CC@ # compiler flags used for the server ! S_CFLAGS = @CFLAGS@ -I. -I../ircd -I../common @IRC_ZLIB_INCLUDE@ # compiler flags used for the authentication slave A_CFLAGS = @CFLAGS@ -I. -I../iauth -I../common @IRC_ZLIB_INCLUDE@ # compiler flags used for chkconfig --- 29,35 ---- # compiler program CC = @CC@ # compiler flags used for the server ! S_CFLAGS = @CFLAGS@ -I. -I../ircd -I../common @IRC_ZLIB_INCLUDE@ -DJAPANESE=1 # compiler flags used for the authentication slave A_CFLAGS = @CFLAGS@ -I. -I../iauth -I../common @IRC_ZLIB_INCLUDE@ # compiler flags used for chkconfig diff -crN irc2.11.1p1/support/config.h.dist irc2.11.1p1+jp8.1beta2/support/config.h.dist *** irc2.11.1p1/support/config.h.dist Thu Apr 14 08:16:49 2005 --- irc2.11.1p1+jp8.1beta2/support/config.h.dist Sun Jun 12 03:29:38 2005 *************** *** 716,721 **** --- 716,727 ---- */ #define LOCALNICKLEN 15 + /* + * Defining this will make the server accept a only good username. + * (isalnum(c) || strchr("-_.", c)) + */ + #define GOOD_USERNAME + /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */