+2005-07-14 Michael Poole <mdpoole@troilus.org>
+
+ * doc/example.conf (General): Update comment about vhost to match
+ the code change below.
+
+ * ircd/ircd_parser.y (generalvhost): Accept vhost="*"; as a
+ synonym for the default behavior (for backwards compatibility).
+ Spotted by Kev.
+
+ * ircd/channel.c (sub1_from_channel): Remove stale code and
+ comment, replacing with an up-to-date comment. Spotted by skx.
+
2005-07-11 Michael Poole <mdpoole@troilus.org>
* ircd/engine_select.c: Remove outdated comment about USE_POLL.
# be the address of a physical interface on the host. This address is
# used for outgoing connections if the Connect{} block does not
# override it. See Port{} for listener virtual hosting. If in doubt,
-# leave it out.
+# leave it out -- or use "*", which has the same meaning as no vhost.
#
# You may specify both an IPv4 virtual host and an IPv6 virtual host,
# to indicate which address should be used for outbound connections
chptr->users = 0;
- /*
- * Also channels without Apass set need to be kept alive,
- * otherwise Bad Guys(tm) would be able to takeover
- * existing channels too easily, and then set an Apass!
- * However, if a channel without Apass becomes empty
- * then we try to be kind to them and remove possible
- * limiting modes.
- */
- chptr->mode.mode &= ~MODE_INVITEONLY;
- chptr->mode.limit = 0;
- /*
- * We do NOT reset a possible key or bans because when
- * the 'channel owners' can't get in because of a key
- * or ban then apparently there was a fight/takeover
- * on the channel and we want them to contact IRC opers
- * who then will educate them on the use of Apass/upass.
+ /* There is a semantics problem here: Assuming no fragments across a
+ * split, a channel without Apass could be maliciously destroyed and
+ * recreated, and someone could set apass on the new instance.
+ *
+ * This could be fixed by preserving the empty non-Apass channel for
+ * the same time as if it had an Apass (but removing +i and +l), and
+ * reopping the first user to rejoin. However, preventing net rides
+ * requires a backwards-incompatible protocol change..
*/
-
if (!chptr->mode.apass[0]) /* If no Apass, destroy now. */
destruct_channel(chptr);
else if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */
MyFree($3);
};
-generalblock: GENERAL '{' generalitems '}' ';'
+generalblock: GENERAL
{
+ /* Zero out the vhost addresses, in case they were removed. */
+ memset(&VirtualHost_v4.addr, 0, sizeof(VirtualHost_v4.addr));
+ memset(&VirtualHost_v6.addr, 0, sizeof(VirtualHost_v6.addr));
+} '{' generalitems '}' ';' {
if (localConf.name == NULL)
parse_error("Your General block must contain a name.");
if (localConf.numeric == 0)
generalvhost: VHOST '=' QSTRING ';'
{
struct irc_in_addr addr;
- if (!ircd_aton(&addr, $3))
- parse_error("Invalid virtual host '%s'.", $3);
+ if (!strcmp($3, "*")) {
+ /* This traditionally meant bind to all interfaces and connect
+ * from the default. */
+ } else if (!ircd_aton(&addr, $3))
+ parse_error("Invalid virtual host '%s'.", $3);
else if (irc_in_addr_is_ipv4(&addr))
memcpy(&VirtualHost_v4.addr, &addr, sizeof(addr));
else