From a467564f2feb051dbabb4ce142eb8f420353bee7 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 11 Sep 2004 18:07:06 +0000 Subject: [PATCH] Add new feature FEAT_HIS_WHOIS_LOCALCHAN. Document it and other head-in-sand features. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1128 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 17 ++++++++++++++ doc/example.conf | 50 +++++++++++++++++++++++++++++++++++++++++ doc/readme.features | 9 +++++++- include/ircd_features.h | 1 + ircd/ircd.c | 6 ++--- ircd/ircd_features.c | 1 + ircd/m_whois.c | 13 ++++++++--- 7 files changed, 90 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index cad64ac..4a5664a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2004-09-11 Michael Poole + + * doc/example.conf: Add examples for FEAT_HIS_* features. + +2003-06-08 Matthias Crauwels + [Feature renamed to FEAT_HIS_WHOIS_LOCALCHAN by Michael Poole.] + + * include/ircd_features.h: new feature FEAT_HIS_LOCAL_CHAN_WHOIS + + * ircd/ircd_features.c: new feature FEAT_HIS_LOCAL_CHAN_WHOIS + + * ircd/m_whois.c: hide local channels in local WHOIS, this breaks HIS + + * doc/readme.features: documented FEAT_HIS_LOCAL_CHAN_WHOIS + + * doc/ircd.conf.sample: default value for FEAT_HIS_LOCAL_CHAN_WHOIS + 2004-09-11 Michael Poole * ircd/ircd_relay.c (server_relay_channel_message, diff --git a/doc/example.conf b/doc/example.conf index 232e5d3..8ca6cb9 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -817,6 +817,56 @@ features # "OPLEVELS" = "TRUE"; # "LOCAL_CHANNELS" = "TRUE"; # "ANNOUNCE_INVITES" = "FALSE"; +# These were introduced by Undernet CFV-165 to add "Head-In-Sand" (HIS) +# behavior to hide most network topology from users. +# "HIS_SNOTICES" = "TRUE"; +# "HIS_SNOTICES_OPER_ONLY" = "TRUE"; +# "HIS_DEBUG_OPER_ONLY" = "TRUE"; +# "HIS_WALLOPS" = "TRUE"; +# "HIS_MAP" = "TRUE"; +# "HIS_LINKS" = "TRUE"; +# "HIS_TRACE" = "TRUE"; +# "HIS_STATS_a" = "TRUE"; +# "HIS_STATS_c" = "TRUE"; +# "HIS_STATS_d" = "TRUE"; +# "HIS_STATS_e" = "TRUE"; +# "HIS_STATS_f" = "TRUE"; +# "HIS_STATS_g" = "TRUE"; +# "HIS_STATS_h" = "TRUE"; +# "HIS_STATS_i" = "TRUE"; +# "HIS_STATS_j" = "TRUE"; +# "HIS_STATS_k" = "TRUE"; +# "HIS_STATS_l" = "TRUE"; +# "HIS_STATS_L" = "TRUE"; +# "HIS_STATS_m" = "TRUE"; +# "HIS_STATS_M" = "TRUE"; +# "HIS_STATS_o" = "TRUE"; +# "HIS_STATS_p" = "TRUE"; +# "HIS_STATS_q" = "TRUE"; +# "HIS_STATS_r" = "TRUE"; +# "HIS_STATS_R" = "TRUE"; +# "HIS_STATS_t" = "TRUE"; +# "HIS_STATS_T" = "TRUE"; +# "HIS_STATS_u" = "FALSE"; +# "HIS_STATS_U" = "TRUE"; +# "HIS_STATS_v" = "TRUE"; +# "HIS_STATS_w" = "TRUE"; +# "HIS_STATS_x" = "TRUE"; +# "HIS_STATS_y" = "TRUE"; +# "HIS_STATS_z" = "TRUE"; +# "HIS_WHOIS_SERVERNAME" = "TRUE"; +# "HIS_WHOIS_IDLETIME" = "TRUE"; +# "HIS_WHOIS_LOCALCHAN" = "TRUE"; +# "HIS_WHO_SERVERNAME" = "TRUE"; +# "HIS_WHO_HOPCOUNT" = "TRUE"; +# "HIS_BANWHO" = "TRUE"; +# "HIS_KILLWHO" = "TRUE"; +# "HIS_REWRITE" = "TRUE"; +# "HIS_REMOTE" = "TRUE"; +# "HIS_NETSPLIT" = "TRUE"; +# "HIS_SERVERNAME" = "*.undernet.org"; +# "HIS_SERVERINFO" = "The Undernet Underworld"; +# "HIS_URLSERVERS" = "http://www.undernet.org/servers.php"; }; # Well, you have now reached the end of this sample configuration diff --git a/doc/readme.features b/doc/readme.features index 2bad879..698e4db 100644 --- a/doc/readme.features +++ b/doc/readme.features @@ -674,7 +674,8 @@ HIS_WHO_HOPCOUNT * Type: boolean * Default: TRUE -As per UnderNet CFV-165, this replaces hopcount to a static 3 in replies to /WHO. +As per UnderNet CFV-165, this replaces hopcount to a static 3 in +replies to /WHO. HIS_BANWHO * Type: boolean @@ -708,6 +709,12 @@ HIS_NETSPLIT As per UnderNet CFV-165, this removes server names in net break sign-offs. +HIS_WHOIS_LOCALCHAN + * Type: boolean + * Default: TRUE + +As per UnderNet CFV-165, this removes local channels in replies to /WHOIS. + HIS_SERVERNAME * Type: string * Default: "*.undernet.org" diff --git a/include/ircd_features.h b/include/ircd_features.h index dd72b3e..e513587 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -129,6 +129,7 @@ enum Feature { FEAT_HIS_STATS_z, FEAT_HIS_WHOIS_SERVERNAME, FEAT_HIS_WHOIS_IDLETIME, + FEAT_HIS_WHOIS_LOCALCHAN, FEAT_HIS_WHO_SERVERNAME, FEAT_HIS_WHO_HOPCOUNT, FEAT_HIS_BANWHO, diff --git a/ircd/ircd.c b/ircd/ircd.c index 5fb4cf9..7cb126e 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -160,7 +160,7 @@ void server_restart(const char *message) log_close(); - close_connections(!(thisServer.bootopt & (BOOT_TTY | BOOT_DEBUG))); + close_connections(!(thisServer.bootopt & (BOOT_TTY | BOOT_DEBUG | BOOT_CHKCONF))); execv(SPATH, thisServer.argv); @@ -641,7 +641,7 @@ int main(int argc, char **argv) { if (!init_connection_limits()) return 9; - close_connections(!(thisServer.bootopt & (BOOT_DEBUG | BOOT_TTY))); + close_connections(!(thisServer.bootopt & (BOOT_DEBUG | BOOT_TTY | BOOT_CHKCONF))); event_init(MAXCONNECTIONS); @@ -678,7 +678,7 @@ int main(int argc, char **argv) { } if(thisServer.bootopt & BOOT_CHKCONF) { - fprintf(stdout, "Configuration file checked okay.\n"); + fprintf(stderr, "Configuration file checked okay.\n"); return 0; } diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index 6756a90..6a8f31b 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -335,6 +335,7 @@ static struct FeatureDesc { F_B(HIS_STATS_z, 0, 1, 0), F_B(HIS_WHOIS_SERVERNAME, 0, 1, 0), F_B(HIS_WHOIS_IDLETIME, 0, 1, 0), + F_B(HIS_WHOIS_LOCALCHAN, 0, 1, 0), F_B(HIS_WHO_SERVERNAME, 0, 1, 0), F_B(HIS_WHO_HOPCOUNT, 0, 1, 0), F_B(HIS_BANWHO, 0, 1, 0), diff --git a/ircd/m_whois.c b/ircd/m_whois.c index 5660ba6..343ca82 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -155,11 +155,18 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc) if (!ShowChannel(sptr, chptr) && !(IsOper(sptr) && IsLocalChannel(chptr->chname))) continue; - + if (acptr != sptr && IsZombie(chan)) continue; - - if (len+strlen(chptr->chname) + mlen > BUFSIZE - 5) + + /* Don't show local channels when HIS is defined, unless it's a + * remote WHOIS --ULtimaTe_ + */ + if (IsLocalChannel(chptr->chname) && (acptr != sptr) && (parc == 2) + && feature_bool(FEAT_HIS_WHOIS_LOCALCHAN) && !IsAnOper(sptr)) + continue; + + if (len+strlen(chptr->chname) + mlen > BUFSIZE - 5) { send_reply(sptr, SND_EXPLICIT | RPL_WHOISCHANNELS, "%s :%s", name, buf); *buf = '\0'; -- 2.20.1