]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Merge branch 'bug124-CloakHostModeX'
authorAlexander Barton <alex@barton.de>
Mon, 11 Jun 2012 08:44:02 +0000 (10:44 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 11 Jun 2012 08:44:28 +0000 (10:44 +0200)
* bug124-CloakHostModeX:
  Describe "CloakHostModeX" in sample-ngircd.conf an ngircd.conf(5)
  Rename "CloakModeHost" option to "CloakHostModeX"
  Introduce new configuration option "CloakModeHost"

This closes bug #124.

doc/sample-ngircd.conf.tmpl
man/ngircd.conf.5.tmpl
src/ngircd/client.c
src/ngircd/conf.c
src/ngircd/conf.h

index f696dc6de0a9d2335d20ded837ad4990f15367d2..e8b2fb0df098088fa2ebfd082fbcae0525c0b4ef 100644 (file)
        # Set this hostname for every client instead of the real one.
        # Please note: don't use the percentage sign ("%"), it is reserved for
        # future extensions!
-       ;CloakHost = irc.example.net
+       ;CloakHost = cloaked.host
+
+       # Use this hostname for hostname cloaking on clients that have the
+       # user mode "+x" set, instead of the name of the server.
+       # Please note: don't use the percentage sign ("%"), it is reserved for
+       # future extensions!
+       ;CloakHostModeX = cloaked.user
 
        # Set every clients' user name to their nick name
        ;CloakUserToNick = yes
index 85cf73ffb3083b1923f1470962fc8ce06f958757..0473206046296e8d57abf2d37405aa8f67f0e30d 100644 (file)
@@ -220,6 +220,17 @@ don't change.
 Don't use the percentage sign ("%"), it is reserved for future extensions!
 .RE
 .TP
+\fBCloakHostModeX\fR (string)
+Use this hostname for hostname cloaking on clients that have the user mode
+"+x" set, instead of the name of the server. Default: empty, use the name
+of the server.
+.PP
+.RS
+.B Please note:
+.br
+Don't use the percentage sign ("%"), it is reserved for future extensions!
+.RE
+.TP
 \fBCloakUserToNick\fR (boolean)
 Set every clients' user name to their nick name and hide the one supplied
 by the IRC client. Default: no.
index 1b356848090b835772db30921d8764c87da39869..e203cdd0e79df243089066d09a80eedec5355a46 100644 (file)
@@ -825,7 +825,9 @@ 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_CloakHostModeX ? Conf_CloakHostModeX
+                                     : Client_ID(Client->introducer));
        return Mask_Buffer;
 } /* Client_MaskCloaked */
 
index f274eb826391dd3c0975383f77c48963a64ef4c1..5f7b24fcfdced17a4681d260f6546f4980c7481f 100644 (file)
@@ -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("  CloakHostModeX = %s\n", Conf_CloakHostModeX);
        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_CloakHostModeX, "");
        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, "CloakHostModeX") == 0) {
+               len = strlcpy(Conf_CloakHostModeX, Arg, sizeof(Conf_CloakHostModeX));
+               if (len >= sizeof(Conf_CloakHostModeX))
+                       Config_Error_TooLong(Line, Var);
+               return;
+       }
        if (strcasecmp(Var, "CloakUserToNick") == 0) {
                Conf_CloakUserToNick = Check_ArgIsTrue(Arg);
                return;
index be19afc692f000cb3a530f3f5468bfb03cf79c19..86f00fe429b03a5ed99e68724f8b35b471bd83d0 100644 (file)
@@ -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_CloakHostModeX[CLIENT_ID_LEN];
+
 /** Use nick name as user name? */
 GLOBAL bool Conf_CloakUserToNick;