mirror of
https://github.com/osmarks/ngircd.git
synced 2025-12-25 15:06:04 +00:00
Compare commits
11 Commits
rel-20-rc1
...
rel-20-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0d57a6afd | ||
|
|
c6ae353756 | ||
|
|
12768e7a54 | ||
|
|
35e2dcff88 | ||
|
|
dc89e42ef5 | ||
|
|
4a2d74c9ab | ||
|
|
cd48b8128e | ||
|
|
301d4915bc | ||
|
|
8061056cec | ||
|
|
44926b7f9f | ||
|
|
d11a700589 |
14
ChangeLog
14
ChangeLog
@@ -11,6 +11,20 @@
|
||||
|
||||
ngIRCd
|
||||
|
||||
ngIRCd 20~rc2 (2012-12-02)
|
||||
- Rework cloaked hostname handling and implement the "METADATA cloakhost"
|
||||
subcommand: Now ngIRCd uses two fields internally, one to store the
|
||||
"real" hostname and one to save the "cloaked" hostname. This allows
|
||||
"foreign servers" (aka "IRC services") to alter the real and cloaked
|
||||
hostnames of clients without problems, even when the user itself issues
|
||||
additional "MODE +x" and "MODE -x" commands.
|
||||
- RPL_UMODEIS: send correct target name, even on server links.
|
||||
- Update platformtest.sh to follow autoconf changes and only generate
|
||||
the "configure" script when it is missing.
|
||||
- Fix the test suite to correctly execute test scripts even when stdout
|
||||
is redirected.
|
||||
- Fix some compiler warnings on NetBSD and OpenBSD.
|
||||
|
||||
ngIRCd 20~rc1 (2012-11-11)
|
||||
- Update doc/Services.txt: describe the upcoming version of Anope 1.9.8,
|
||||
then including a protocol module for ngIRCd. And remove our own patches
|
||||
|
||||
8
NEWS
8
NEWS
@@ -11,6 +11,14 @@
|
||||
|
||||
ngIRCd
|
||||
|
||||
ngIRCd 20~rc2 (2012-12-02)
|
||||
- Rework cloaked hostname handling and implement the "METADATA cloakhost"
|
||||
subcommand: Now ngIRCd uses two fields internally, one to store the
|
||||
"real" hostname and one to save the "cloaked" hostname. This allows
|
||||
"foreign servers" (aka "IRC services") to alter the real and cloaked
|
||||
hostnames of clients without problems, even when the user itself issues
|
||||
additional "MODE +x" and "MODE -x" commands.
|
||||
|
||||
ngIRCd 20~rc1 (2012-11-11)
|
||||
- Update doc/Services.txt: describe the upcoming version of Anope 1.9.8,
|
||||
then including a protocol module for ngIRCd. And remove our own patches
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
ngircd (20~rc2-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 2 for ngIRCd Release 20.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Sun, 02 Dec 2012 18:51:06 +0100
|
||||
|
||||
ngircd (20~rc1-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream" release candidate 1 for ngIRCd Release 20.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 20~rc1
|
||||
%define version 20~rc2
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ if [ $? -ne 0 ]; then
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo "$NAME: Checking for \"./autogen.sh\" script ..."
|
||||
if [ -r ./autogen.sh ]; then
|
||||
echo "$NAME: Checking for \"./configure\" script ..."
|
||||
if [ ! -e ./configure ]; then
|
||||
echo "$NAME: Running \"./autogen.sh\" ..."
|
||||
[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
|
||||
fi
|
||||
@@ -76,7 +76,7 @@ if [ -r ./configure ]; then
|
||||
R_RUN=$R_CHECK
|
||||
else
|
||||
./src/ngircd/ngircd --help 2>/dev/null \
|
||||
| grep "^ngircd" >/dev/null
|
||||
| grep "^ngIRCd" >/dev/null
|
||||
[ $? -eq 0 ] && R_RUN=1
|
||||
fi
|
||||
fi
|
||||
@@ -85,9 +85,9 @@ fi
|
||||
|
||||
# Get target platform information
|
||||
if [ -r "src/config.h" ]; then
|
||||
CPU=`grep "TARGET_CPU" "src/config.h" | cut -d'"' -f2`
|
||||
OS=`grep "TARGET_OS" "src/config.h" | cut -d'"' -f2`
|
||||
VENDOR=`grep "TARGET_VENDOR" "src/config.h" | cut -d'"' -f2`
|
||||
CPU=`grep "HOST_CPU" "src/config.h" | cut -d'"' -f2`
|
||||
OS=`grep "HOST_OS" "src/config.h" | cut -d'"' -f2`
|
||||
VENDOR=`grep "HOST_VENDOR" "src/config.h" | cut -d'"' -f2`
|
||||
PLATFORM="$CPU/$VENDOR/$OS"
|
||||
fi
|
||||
if [ -z "$PLATFORM" ]; then
|
||||
|
||||
@@ -39,8 +39,8 @@ i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
|
||||
i386/pc/solaris2.11 gcc 3.4.3 19 12-02-26 alex Y Y N Y (4)
|
||||
i386/pc/solaris2.11 gcc 4.2.3 19.1 12-05-29 goetz Y Y Y Y (4)
|
||||
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
i386/unknown/freebsd6.2 gcc 3.4.6 19 12-02-26 alex Y Y Y Y (3)
|
||||
i386/unknown/freebsd7.3 gcc 4.2.1 19 12-02-26 alex Y Y Y Y (3)
|
||||
i386/unknown/freebsd6.2 gcc 3.4.6 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
i386/unknown/freebsd7.3 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
i686/unknown/gnu0.3 gcc 4.4.5 19 12-02-29 alex Y Y Y Y
|
||||
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y (3)
|
||||
i386/unknown/netbsdelf1.6.2 gcc 2.95.3 18 11-07-10 goetz Y Y Y Y
|
||||
@@ -73,10 +73,12 @@ powerpc/unknown/openbsd3.6 gcc 2.95.3 0.10.0 06-10-08 alex Y Y N Y
|
||||
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
|
||||
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||
x86_64/unknown/freebsd8.1 gcc 4.2.1 19 12-02-26 alex Y Y Y Y (3)
|
||||
x86_64/apple/darwin12.2.0 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
x86_64/unknown/freebsd8.1 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
x86_64/unkn./freebsd8.1-gnu gcc 4.4.5 19 12-02-26 alex Y Y Y Y (3)
|
||||
x86_64/unknown/linux-gnu gcc 4.4.5 19 12-02-26 alex Y Y Y Y (1)
|
||||
x86_64/unknown/openbsd4.7 gcc 3.3.5 19 12-02-26 alex Y Y Y Y (3)
|
||||
x86_64/unknown/linux-gnu gcc 4.4.5 20~rc1 12-02-26 alex Y Y Y Y (1)
|
||||
x86_64/unknown/openbsd4.7 gcc 3.3.5 20~rc1 12-02-26 alex Y Y Y Y (3)
|
||||
x86_64/unknown/openbsd4.8 gcc 4.2.1 20~rc1 12-11-13 alex Y Y Y Y (3)
|
||||
|
||||
|
||||
Notes
|
||||
|
||||
@@ -225,6 +225,7 @@ new server link", <serverflag> "M"), even if it doesn't support the given
|
||||
The following <key> names are defined:
|
||||
|
||||
- "host": the hostname of a client (can't be empty)
|
||||
- "cloakhost": the cloaked hostname of a client
|
||||
- "info": info text ("real name") of a client
|
||||
- "user": the user name of a client (can't be empty)
|
||||
|
||||
|
||||
@@ -671,7 +671,6 @@ Client_OrigUser(CLIENT *Client) {
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Return the hostname of a client.
|
||||
* @param Client Pointer to client structure
|
||||
@@ -682,11 +681,22 @@ Client_Hostname(CLIENT *Client)
|
||||
{
|
||||
assert (Client != NULL);
|
||||
return Client->host;
|
||||
} /* Client_Hostname */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get potentially cloaked hostname of a client.
|
||||
* Return the cloaked hostname of a client, if set.
|
||||
* @param Client Pointer to the client structure.
|
||||
* @return Pointer to the cloaked hostname or NULL if not set.
|
||||
*/
|
||||
GLOBAL char *
|
||||
Client_HostnameCloaked(CLIENT *Client)
|
||||
{
|
||||
assert(Client != NULL);
|
||||
return Client->cloaked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get (potentially cloaked) hostname of a client to display it to other users.
|
||||
*
|
||||
* If the client has not enabled cloaking, the real hostname is used.
|
||||
* Please note that this function uses a global static buffer, so you can't
|
||||
@@ -696,35 +706,63 @@ Client_Hostname(CLIENT *Client)
|
||||
* @return Pointer to client hostname
|
||||
*/
|
||||
GLOBAL char *
|
||||
Client_HostnameCloaked(CLIENT *Client)
|
||||
Client_HostnameDisplayed(CLIENT *Client)
|
||||
{
|
||||
static char Cloak_Buffer[CLIENT_HOST_LEN];
|
||||
|
||||
assert(Client != NULL);
|
||||
|
||||
/* Client isn't cloaked at all, return real hostname: */
|
||||
if (!Client_HasMode(Client, 'x'))
|
||||
return Client_Hostname(Client);
|
||||
|
||||
/* Client has received METADATA command, so it got the eventually
|
||||
* cloaked hostname set correctly and this server doesn't need
|
||||
* to cloak it on its own: */
|
||||
if (strchr(Client_Flags(Client), 'M'))
|
||||
return Client_Hostname(Client);
|
||||
/* Use an already saved cloaked hostname, if there is one */
|
||||
if (Client->cloaked[0])
|
||||
return Client->cloaked;
|
||||
|
||||
/* Do simple mapping to the server ID? */
|
||||
if (!*Conf_CloakHostModeX)
|
||||
return Client_ID(Client->introducer);
|
||||
Client_UpdateCloakedHostname(Client, NULL, NULL);
|
||||
return Client->cloaked;
|
||||
}
|
||||
|
||||
strlcpy(Cloak_Buffer, Client->host, CLIENT_HOST_LEN);
|
||||
strlcat(Cloak_Buffer, Conf_CloakHostSalt, CLIENT_HOST_LEN);
|
||||
/**
|
||||
* Update (and generate, if necessary) the cloaked hostname of a client.
|
||||
*
|
||||
* The newly set cloaked hostname is announced in the network using METADATA
|
||||
* commands to peers that support this feature.
|
||||
*
|
||||
* @param Client The client of which the cloaked hostname should be updated.
|
||||
* @param Origin The originator of the hostname change, or NULL if this server.
|
||||
* @param Hostname The new cloaked hostname, or NULL if it should be generated.
|
||||
*/
|
||||
GLOBAL void
|
||||
Client_UpdateCloakedHostname(CLIENT *Client, CLIENT *Origin,
|
||||
const char *Hostname)
|
||||
{
|
||||
static char Cloak_Buffer[CLIENT_HOST_LEN];
|
||||
|
||||
snprintf(Cloak_Buffer, CLIENT_HOST_LEN, Conf_CloakHostModeX,
|
||||
Hash(Cloak_Buffer));
|
||||
assert(Client != NULL);
|
||||
if (!Origin)
|
||||
Origin = Client_ThisServer();
|
||||
|
||||
return Cloak_Buffer;
|
||||
} /* Client_HostnameCloaked */
|
||||
if (!Hostname) {
|
||||
/* Generate new cloaked hostname */
|
||||
if (*Conf_CloakHostModeX) {
|
||||
strlcpy(Cloak_Buffer, Client->host, CLIENT_HOST_LEN);
|
||||
strlcat(Cloak_Buffer, Conf_CloakHostSalt,
|
||||
CLIENT_HOST_LEN);
|
||||
snprintf(Client->cloaked, sizeof(Client->cloaked),
|
||||
Conf_CloakHostModeX, Hash(Cloak_Buffer));
|
||||
} else
|
||||
strlcpy(Client->cloaked, Client_ID(Client->introducer),
|
||||
sizeof(Client->cloaked));
|
||||
} else
|
||||
strlcpy(Client->cloaked, Hostname, sizeof(Client->cloaked));
|
||||
LogDebug("Cloaked hostname of \"%s\" updated to \"%s\"",
|
||||
Client_ID(Client), Client->cloaked);
|
||||
|
||||
/* Inform other servers in the network */
|
||||
IRC_WriteStrServersPrefixFlag(Client_NextHop(Origin), Origin, 'M',
|
||||
"METADATA %s cloakhost :%s",
|
||||
Client_ID(Client), Client->cloaked);
|
||||
}
|
||||
|
||||
GLOBAL char *
|
||||
Client_Modes( CLIENT *Client )
|
||||
@@ -837,7 +875,7 @@ Client_MaskCloaked(CLIENT *Client)
|
||||
return Client_Mask(Client);
|
||||
|
||||
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user,
|
||||
Client_HostnameCloaked(Client));
|
||||
Client_HostnameDisplayed(Client));
|
||||
|
||||
return Mask_Buffer;
|
||||
} /* Client_MaskCloaked */
|
||||
@@ -1346,7 +1384,7 @@ Client_RegisterWhowas( CLIENT *Client )
|
||||
sizeof( My_Whowas[slot].id ));
|
||||
strlcpy( My_Whowas[slot].user, Client_User( Client ),
|
||||
sizeof( My_Whowas[slot].user ));
|
||||
strlcpy( My_Whowas[slot].host, Client_HostnameCloaked( Client ),
|
||||
strlcpy( My_Whowas[slot].host, Client_HostnameDisplayed( Client ),
|
||||
sizeof( My_Whowas[slot].host ));
|
||||
strlcpy( My_Whowas[slot].info, Client_Info( Client ),
|
||||
sizeof( My_Whowas[slot].info ));
|
||||
|
||||
@@ -48,6 +48,7 @@ typedef struct _CLIENT
|
||||
struct _CLIENT *introducer; /* ID of the servers which the client is connected to */
|
||||
struct _CLIENT *topserver; /* toplevel servers (only valid if client is a server) */
|
||||
char host[CLIENT_HOST_LEN]; /* hostname of the client */
|
||||
char cloaked[CLIENT_HOST_LEN]; /* cloaked hostname of the client */
|
||||
char user[CLIENT_USER_LEN]; /* user name ("login") */
|
||||
#if defined(PAM) && defined(IDENTAUTH)
|
||||
char orig_user[CLIENT_USER_LEN];/* user name supplied by USER command */
|
||||
@@ -107,7 +108,8 @@ GLOBAL char *Client_User PARAMS(( CLIENT *Client ));
|
||||
GLOBAL char *Client_OrigUser PARAMS(( CLIENT *Client ));
|
||||
#endif
|
||||
GLOBAL char *Client_Hostname PARAMS(( CLIENT *Client ));
|
||||
GLOBAL char *Client_HostnameCloaked PARAMS(( CLIENT *Client ));
|
||||
GLOBAL char *Client_HostnameCloaked PARAMS((CLIENT *Client));
|
||||
GLOBAL char *Client_HostnameDisplayed PARAMS(( CLIENT *Client ));
|
||||
GLOBAL char *Client_Modes PARAMS(( CLIENT *Client ));
|
||||
GLOBAL char *Client_Flags PARAMS(( CLIENT *Client ));
|
||||
GLOBAL CLIENT *Client_Introducer PARAMS(( CLIENT *Client ));
|
||||
@@ -166,6 +168,10 @@ GLOBAL void Client_Reject PARAMS((CLIENT *Client, const char *Reason,
|
||||
bool InformClient));
|
||||
GLOBAL void Client_Introduce PARAMS((CLIENT *From, CLIENT *Client, int Type));
|
||||
|
||||
GLOBAL void Client_UpdateCloakedHostname PARAMS((CLIENT *Client,
|
||||
CLIENT *Originator,
|
||||
const char *hostname));
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
GLOBAL void Client_DebugDump PARAMS((void));
|
||||
|
||||
@@ -727,7 +727,7 @@ IRC_USERHOST(CLIENT *Client, REQUEST *Req)
|
||||
strlcat(rpl, "+", sizeof(rpl));
|
||||
strlcat(rpl, Client_User(c), sizeof(rpl));
|
||||
strlcat(rpl, "@", sizeof(rpl));
|
||||
strlcat(rpl, Client_HostnameCloaked(c), sizeof(rpl));
|
||||
strlcat(rpl, Client_HostnameDisplayed(c), sizeof(rpl));
|
||||
strlcat(rpl, " ", sizeof(rpl));
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ write_whoreply(CLIENT *Client, CLIENT *c, const char *channelname, const char *f
|
||||
{
|
||||
return IRC_WriteStrClient(Client, RPL_WHOREPLY_MSG, Client_ID(Client),
|
||||
channelname, Client_User(c),
|
||||
Client_HostnameCloaked(c),
|
||||
Client_HostnameDisplayed(c),
|
||||
Client_ID(Client_Introducer(c)), Client_ID(c),
|
||||
flags, Client_Hops(c), Client_Info(c));
|
||||
}
|
||||
@@ -987,7 +987,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps)
|
||||
if (IRC_CheckListTooBig(Client, count, MAX_RPL_WHO, "WHO"))
|
||||
break;
|
||||
|
||||
strcpy(flags, who_flags_status(Client_Modes(c)));
|
||||
strlcpy(flags, who_flags_status(Client_Modes(c)), sizeof(flags));
|
||||
if (strchr(Client_Modes(c), 'o'))
|
||||
strlcat(flags, "*", sizeof(flags));
|
||||
|
||||
@@ -1080,7 +1080,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
|
||||
/* Nick, user, hostname and client info */
|
||||
if (!IRC_WriteStrClient(from, RPL_WHOISUSER_MSG, Client_ID(from),
|
||||
Client_ID(c), Client_User(c),
|
||||
Client_HostnameCloaked(c), Client_Info(c)))
|
||||
Client_HostnameDisplayed(c), Client_Info(c)))
|
||||
return DISCONNECTED;
|
||||
|
||||
/* Server */
|
||||
|
||||
@@ -443,7 +443,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
|
||||
punctuation is allowed.*/
|
||||
ptr = Req->argv[0];
|
||||
while (*ptr) {
|
||||
if (!isalnum(*ptr) &&
|
||||
if (!isalnum((int)*ptr) &&
|
||||
*ptr != '+' && *ptr != '-' &&
|
||||
*ptr != '.' && *ptr != '_') {
|
||||
Conn_Close(Client_Conn(Client), NULL,
|
||||
|
||||
@@ -66,7 +66,7 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
|
||||
Client_ID(Client), Req->argv[0]);
|
||||
|
||||
LogDebug("Got \"METADATA\" command from \"%s\" for client \"%s\": \"%s=%s\".",
|
||||
Client_ID(Client), Client_ID(target),
|
||||
Client_ID(prefix), Client_ID(target),
|
||||
Req->argv[1], Req->argv[2]);
|
||||
|
||||
/* Mark client: it has receiveda a METADATA command */
|
||||
@@ -76,9 +76,23 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
|
||||
Client_SetFlags(target, new_flags);
|
||||
}
|
||||
|
||||
if (*Req->argv[2] && strcasecmp(Req->argv[1], "host") == 0)
|
||||
if (strcasecmp(Req->argv[1], "cloakhost") == 0) {
|
||||
Client_UpdateCloakedHostname(target, prefix, Req->argv[2]);
|
||||
if (Client_Conn(target) > NONE && Client_HasMode(target, 'x'))
|
||||
IRC_WriteStrClientPrefix(target, prefix,
|
||||
RPL_HOSTHIDDEN_MSG, Client_ID(target),
|
||||
Client_HostnameDisplayed(target));
|
||||
/* The Client_UpdateCloakedHostname() function already
|
||||
* forwarded the METADATA command, don't do it twice: */
|
||||
return CONNECTED;
|
||||
}
|
||||
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "host") == 0) {
|
||||
Client_SetHostname(target, Req->argv[2]);
|
||||
else if (strcasecmp(Req->argv[1], "info") == 0)
|
||||
if (Client_Conn(target) > NONE && !Client_HasMode(target, 'x'))
|
||||
IRC_WriteStrClientPrefix(target, prefix,
|
||||
RPL_HOSTHIDDEN_MSG, Client_ID(target),
|
||||
Client_HostnameDisplayed(target));
|
||||
} else if (strcasecmp(Req->argv[1], "info") == 0)
|
||||
Client_SetInfo(target, Req->argv[2]);
|
||||
else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0)
|
||||
Client_SetUser(target, Req->argv[2], true);
|
||||
@@ -88,6 +102,7 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
|
||||
Client_ID(Client), Client_ID(target),
|
||||
Req->argv[1], Req->argv[2]);
|
||||
|
||||
/* Forward the METADATA command to peers that support it: */
|
||||
IRC_WriteStrServersPrefixFlag(Client, prefix, 'M', "METADATA %s %s :%s",
|
||||
Client_ID(target), Req->argv[1], Req->argv[2]);
|
||||
return CONNECTED;
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#include "irc-mode.h"
|
||||
|
||||
|
||||
static void Announce_Client_Hostname PARAMS((CLIENT *Origin, CLIENT *Client));
|
||||
|
||||
static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
|
||||
CLIENT *Target));
|
||||
static bool Channel_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
|
||||
@@ -156,7 +154,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
|
||||
/* Mode request: let's answer it :-) */
|
||||
if (Req->argc == 1)
|
||||
return IRC_WriteStrClient(Origin, RPL_UMODEIS_MSG,
|
||||
Client_ID(Origin),
|
||||
Client_ID(Target),
|
||||
Client_Modes(Target));
|
||||
|
||||
mode_arg = 1;
|
||||
@@ -368,9 +366,17 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
|
||||
"MODE %s :%s",
|
||||
Client_ID(Target),
|
||||
the_modes);
|
||||
if (send_RPL_HOSTHIDDEN_MSG)
|
||||
Announce_Client_Hostname(Origin, Client);
|
||||
}
|
||||
|
||||
if (send_RPL_HOSTHIDDEN_MSG && Client_Conn(Target) > NONE) {
|
||||
/* A new (cloaked) hostname must be annoucned */
|
||||
IRC_WriteStrClientPrefix(Target, Origin,
|
||||
RPL_HOSTHIDDEN_MSG,
|
||||
Client_ID(Target),
|
||||
Client_HostnameDisplayed(Target));
|
||||
|
||||
}
|
||||
|
||||
LogDebug("%s \"%s\": Mode change, now \"%s\".",
|
||||
Client_TypeText(Target), Client_Mask(Target),
|
||||
Client_Modes(Target));
|
||||
@@ -381,27 +387,6 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
|
||||
} /* Client_Mode */
|
||||
|
||||
|
||||
/**
|
||||
* Announce changed client hostname in the network.
|
||||
*
|
||||
* @param Client The client of which the hostname changed.
|
||||
*/
|
||||
static void
|
||||
Announce_Client_Hostname(CLIENT *Origin, CLIENT *Client)
|
||||
{
|
||||
assert(Client != NULL);
|
||||
|
||||
/* Inform the client itself */
|
||||
IRC_WriteStrClient(Client, RPL_HOSTHIDDEN_MSG, Client_ID(Client),
|
||||
Client_HostnameCloaked(Client));
|
||||
|
||||
/* Inform other servers in the network */
|
||||
IRC_WriteStrServersPrefixFlag(Origin, Client_ThisServer(), 'M',
|
||||
"METADATA %s host :%s", Client_ID(Client),
|
||||
Client_HostnameCloaked(Client));
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel)
|
||||
{
|
||||
|
||||
@@ -457,7 +457,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
|
||||
if (nick != NULL && host != NULL) {
|
||||
if (strcasecmp(nick, Client_ID(cl)) == 0 &&
|
||||
strcasecmp(user, Client_User(cl)) == 0 &&
|
||||
strcasecmp(host, Client_HostnameCloaked(cl)) == 0)
|
||||
strcasecmp(host, Client_HostnameDisplayed(cl)) == 0)
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
@@ -465,7 +465,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
|
||||
if (strcasecmp(user, Client_User(cl)) != 0)
|
||||
continue;
|
||||
if (host != NULL && strcasecmp(host,
|
||||
Client_HostnameCloaked(cl)) != 0)
|
||||
Client_HostnameDisplayed(cl)) != 0)
|
||||
continue;
|
||||
if (server != NULL && strcasecmp(server,
|
||||
Client_ID(Client_Introducer(cl))) != 0)
|
||||
|
||||
@@ -179,24 +179,40 @@ Announce_User(CLIENT * Client, CLIENT * User)
|
||||
Client_ID(User), Client_ID(User),
|
||||
modes);
|
||||
}
|
||||
return CONNECTED;
|
||||
} else {
|
||||
/* RFC 2813 mode: one combined NICK or SERVICE command */
|
||||
if (Client_Type(User) == CLIENT_SERVICE
|
||||
&& strchr(Client_Flags(Client), 'S'))
|
||||
return IRC_WriteStrClient(Client,
|
||||
"SERVICE %s %d * +%s %d :%s", Client_Mask(User),
|
||||
Client_MyToken(Client_Introducer(User)),
|
||||
Client_Modes(User), Client_Hops(User) + 1,
|
||||
Client_Info(User));
|
||||
else
|
||||
return IRC_WriteStrClient(Client,
|
||||
"NICK %s %d %s %s %d +%s :%s",
|
||||
Client_ID(User), Client_Hops(User) + 1,
|
||||
Client_User(User), Client_Hostname(User),
|
||||
Client_MyToken(Client_Introducer(User)),
|
||||
Client_Modes(User), Client_Info(User));
|
||||
&& strchr(Client_Flags(Client), 'S')) {
|
||||
if (!IRC_WriteStrClient(Client,
|
||||
"SERVICE %s %d * +%s %d :%s",
|
||||
Client_Mask(User),
|
||||
Client_MyToken(Client_Introducer(User)),
|
||||
Client_Modes(User), Client_Hops(User) + 1,
|
||||
Client_Info(User)))
|
||||
return DISCONNECTED;
|
||||
} else {
|
||||
if (!IRC_WriteStrClient(Client,
|
||||
"NICK %s %d %s %s %d +%s :%s",
|
||||
Client_ID(User), Client_Hops(User) + 1,
|
||||
Client_User(User), Client_Hostname(User),
|
||||
Client_MyToken(Client_Introducer(User)),
|
||||
Client_Modes(User), Client_Info(User)))
|
||||
return DISCONNECTED;
|
||||
}
|
||||
}
|
||||
|
||||
if (strchr(Client_Flags(Client), 'M')) {
|
||||
/* Synchronize metadata */
|
||||
if (Client_HostnameCloaked(User)) {
|
||||
if (!IRC_WriteStrClient(Client,
|
||||
"METADATA %s cloakhost :%s",
|
||||
Client_ID(User),
|
||||
Client_HostnameCloaked(User)))
|
||||
return DISCONNECTED;
|
||||
}
|
||||
}
|
||||
|
||||
return CONNECTED;
|
||||
} /* Announce_User */
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ if test -t 1 2>/dev/null; then
|
||||
fi
|
||||
|
||||
echo_n "running ${test} ..."
|
||||
expect "$e_tmp" > logs/${test}.log; r=$?
|
||||
expect "$e_exec" > logs/${test}.log; r=$?
|
||||
[ $r -eq 0 ] && echo " ok." || echo " failure!"
|
||||
|
||||
rm -f "$e_tmp"
|
||||
|
||||
@@ -84,7 +84,7 @@ ngt_UpperStr(char *String)
|
||||
|
||||
ptr = String;
|
||||
while(*ptr) {
|
||||
*ptr = toupper(*ptr);
|
||||
*ptr = toupper((int)*ptr);
|
||||
ptr++;
|
||||
}
|
||||
return String;
|
||||
@@ -103,7 +103,7 @@ ngt_LowerStr(char *String)
|
||||
|
||||
ptr = String;
|
||||
while(*ptr) {
|
||||
*ptr = tolower(*ptr);
|
||||
*ptr = tolower((int)*ptr);
|
||||
ptr++;
|
||||
}
|
||||
return String;
|
||||
|
||||
Reference in New Issue
Block a user