Module: ngircd.git Branch: master Commit: aa7db2c0e9e1112591cbdb3d346342d34ca21a6a URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=aa7db...
Author: Christoph Biedl ngircd.anoy@manchmal.in-ulm.de Date: Sat Jun 9 01:55:22 2012 +0200
Introduce new configuration option "CloakModeHost"
This closes bug #124.
---
src/ngircd/client.c | 3 ++- src/ngircd/conf.c | 8 ++++++++ src/ngircd/conf.h | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 1b35684..9861a0d 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -825,7 +825,8 @@ Client_MaskCloaked(CLIENT *Client) return Client_Mask(Client);
snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s", - Client->id, Client->user, Client_ID(Client->introducer)); + Client->id, Client->user, + *Conf_CloakModeHost ? Conf_CloakModeHost : Client_ID(Client->introducer)); return Mask_Buffer; } /* Client_MaskCloaked */
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index f274eb8..2a259eb 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -358,6 +358,7 @@ Conf_Test( void ) printf(" AllowRemoteOper = %s\n", yesno_to_str(Conf_AllowRemoteOper)); printf(" ChrootDir = %s\n", Conf_Chroot); printf(" CloakHost = %s\n", Conf_CloakHost); + printf(" CloakModeHost = %s\n", Conf_CloakModeHost); printf(" CloakUserToNick = %s\n", yesno_to_str(Conf_CloakUserToNick)); #ifdef WANT_IPV6 printf(" ConnectIPv4 = %s\n", yesno_to_str(Conf_ConnectIPv6)); @@ -684,6 +685,7 @@ Set_Defaults(bool InitServers) #endif strlcpy(Conf_Chroot, CHROOT_DIR, sizeof(Conf_Chroot)); strcpy(Conf_CloakHost, ""); + strcpy(Conf_CloakModeHost, ""); Conf_CloakUserToNick = false; Conf_ConnectIPv4 = true; #ifdef WANT_IPV6 @@ -1477,6 +1479,12 @@ Handle_OPTIONS(int Line, char *Var, char *Arg) Config_Error_TooLong(Line, Var); return; } + if (strcasecmp(Var, "CloakModeHost") == 0) { + len = strlcpy(Conf_CloakModeHost, Arg, sizeof(Conf_CloakModeHost)); + if (len >= sizeof(Conf_CloakModeHost)) + Config_Error_TooLong(Line, Var); + return; + } if (strcasecmp(Var, "CloakUserToNick") == 0) { Conf_CloakUserToNick = Check_ArgIsTrue(Arg); return; diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h index be19afc..171a838 100644 --- a/src/ngircd/conf.h +++ b/src/ngircd/conf.h @@ -166,6 +166,9 @@ GLOBAL bool Conf_AllowRemoteOper; /** Cloaked hostname of the clients */ GLOBAL char Conf_CloakHost[CLIENT_ID_LEN];
+/** Cloaked hostname for clients that did +x */ +GLOBAL char Conf_CloakModeHost[CLIENT_ID_LEN]; + /** Use nick name as user name? */ GLOBAL bool Conf_CloakUserToNick;
ngircd-commits@lists.barton.de